about summary refs log tree commit diff
path: root/doc/tutorial
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-11-02 11:42:51 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2011-11-02 12:20:12 +0100
commit0a20eed2db233dad2eb9594cf28790842970c1d6 (patch)
tree7388d493e37656a119d81cec71bd65a8cae11abe /doc/tutorial
parenteaf9e05611e966344c250353b8e220469885c93c (diff)
Make ptr::addr_of return an immutable vec, add mut_addr_of
Diffstat (limited to 'doc/tutorial')
-rw-r--r--doc/tutorial/ffi.md5
1 files changed, 3 insertions, 2 deletions
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};