From 0a20eed2db233dad2eb9594cf28790842970c1d6 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 2 Nov 2011 11:42:51 +0100 Subject: Make ptr::addr_of return an immutable vec, add mut_addr_of --- doc/tutorial/ffi.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/tutorial') diff --git a/doc/tutorial/ffi.md b/doc/tutorial/ffi.md index 9b42a3dd601..4c4ad0eba7b 100644 --- a/doc/tutorial/ffi.md +++ b/doc/tutorial/ffi.md @@ -162,9 +162,10 @@ This program uses the Posix function `gettimeofday` to get a microsecond-resolution timer. use std; - type timeval = {tv_sec: u32, tv_usec: u32}; + type timeval = {mutable tv_sec: u32, + mutable tv_usec: u32}; native "cdecl" mod libc = "" { - fn gettimeofday(tv: *mutable timeval, tz: *()) -> i32; + fn gettimeofday(tv: *timeval, tz: *()) -> i32; } fn unix_time_in_microseconds() -> u64 unsafe { let x = {tv_sec: 0u32, tv_usec: 0u32}; -- cgit 1.4.1-3-g733a5