about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-01-21 09:31:32 -0500
committerDaniel Micay <danielmicay@gmail.com>2014-01-22 23:13:53 -0500
commit802d41fe235794d84084897ae6187ee5cc27dd95 (patch)
tree6cd1eecb0ec529673396040e2c43ad08941732e9 /src/libnative
parentfce792249e72a181f2ad52413b25b1db643c371f (diff)
downloadrust-802d41fe235794d84084897ae6187ee5cc27dd95.tar.gz
rust-802d41fe235794d84084897ae6187ee5cc27dd95.zip
libc: switch `free` to the proper signature
This does not attempt to fully propagate the mutability everywhere, but
gives new code a hint to avoid the same issues.
Diffstat (limited to 'src/libnative')
-rw-r--r--src/libnative/io/file.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libnative/io/file.rs b/src/libnative/io/file.rs
index af6ed51729e..af06533d44b 100644
--- a/src/libnative/io/file.rs
+++ b/src/libnative/io/file.rs
@@ -548,13 +548,13 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
             let p = Path::new(p);
             let star = p.join("*");
             as_utf16_p(star.as_str().unwrap(), |path_ptr| {
-                let wfd_ptr = malloc_raw(rust_list_dir_wfd_size() as uint) as *c_void;
+                let wfd_ptr = malloc_raw(rust_list_dir_wfd_size() as uint);
                 let find_handle = FindFirstFileW(path_ptr, wfd_ptr as HANDLE);
                 if find_handle as libc::c_int != INVALID_HANDLE_VALUE {
                     let mut paths = ~[];
                     let mut more_files = 1 as libc::c_int;
                     while more_files != 0 {
-                        let fp_buf = rust_list_dir_wfd_fp_buf(wfd_ptr);
+                        let fp_buf = rust_list_dir_wfd_fp_buf(wfd_ptr as *c_void);
                         if fp_buf as uint == 0 {
                             fail!("os::list_dir() failure: got null ptr from wfd");
                         }
@@ -567,7 +567,7 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
                         more_files = FindNextFileW(find_handle, wfd_ptr as HANDLE);
                     }
                     FindClose(find_handle);
-                    free(wfd_ptr);
+                    free(wfd_ptr as *mut c_void);
                     Ok(paths)
                 } else {
                     Err(super::last_error())