diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-09-14 20:27:36 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-09-16 14:37:48 -0700 |
| commit | fc525eeb4ec3443d29bce677f589b19f31c189bb (patch) | |
| tree | d807bad5c91171751157a945dde963dcfd4ea95e /src/libnative | |
| parent | d8dfe1957b6541de8fe2797e248fe4bd2fac02d9 (diff) | |
| download | rust-fc525eeb4ec3443d29bce677f589b19f31c189bb.tar.gz rust-fc525eeb4ec3443d29bce677f589b19f31c189bb.zip | |
Fallout from renaming
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/file_unix.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/file_windows.rs | 18 | ||||
| -rw-r--r-- | src/libnative/io/helper_thread.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/net.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/pipe_unix.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/pipe_windows.rs | 22 | ||||
| -rw-r--r-- | src/libnative/io/process.rs | 34 | ||||
| -rw-r--r-- | src/libnative/io/timer_unix.rs | 8 | ||||
| -rw-r--r-- | src/libnative/io/timer_windows.rs | 12 | ||||
| -rw-r--r-- | src/libnative/io/tty_windows.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/util.rs | 14 |
12 files changed, 62 insertions, 62 deletions
diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs index bc1d877dc54..3c49e1c40d6 100644 --- a/src/libnative/io/file_unix.rs +++ b/src/libnative/io/file_unix.rs @@ -355,7 +355,7 @@ pub fn readdir(p: &CString) -> IoResult<Vec<CString>> { let root = unsafe { CString::new(root.as_ptr(), false) }; let root = Path::new(root); - dirs.move_iter().filter(|path| { + dirs.into_iter().filter(|path| { path.as_vec() != b"." && path.as_vec() != b".." }).map(|path| root.join(path).to_c_str()).collect() } diff --git a/src/libnative/io/file_windows.rs b/src/libnative/io/file_windows.rs index adc97c6bede..6aa965948fd 100644 --- a/src/libnative/io/file_windows.rs +++ b/src/libnative/io/file_windows.rs @@ -52,7 +52,7 @@ impl FileDesc { let ret = unsafe { libc::ReadFile(self.handle(), buf.as_ptr() as libc::LPVOID, buf.len() as libc::DWORD, &mut read, - ptr::mut_null()) + ptr::null_mut()) }; if ret != 0 { Ok(read as uint) @@ -68,7 +68,7 @@ impl FileDesc { let ret = unsafe { libc::WriteFile(self.handle(), cur as libc::LPVOID, remaining as libc::DWORD, &mut amt, - ptr::mut_null()) + ptr::null_mut()) }; if ret != 0 { remaining -= amt as uint; @@ -313,10 +313,10 @@ pub fn open(path: &CString, fm: rtio::FileMode, fa: rtio::FileAccess) libc::CreateFileW(path.as_ptr(), dwDesiredAccess, dwShareMode, - ptr::mut_null(), + ptr::null_mut(), dwCreationDisposition, dwFlagsAndAttributes, - ptr::mut_null()) + ptr::null_mut()) }; if handle == libc::INVALID_HANDLE_VALUE { Err(super::last_error()) @@ -337,7 +337,7 @@ pub fn mkdir(p: &CString, _mode: uint) -> IoResult<()> { let p = try!(to_utf16(p)); super::mkerr_winbool(unsafe { // FIXME: turn mode into something useful? #2623 - libc::CreateDirectoryW(p.as_ptr(), ptr::mut_null()) + libc::CreateDirectoryW(p.as_ptr(), ptr::null_mut()) }) } @@ -346,7 +346,7 @@ pub fn readdir(p: &CString) -> IoResult<Vec<CString>> { let root = unsafe { CString::new(root.as_ptr(), false) }; let root = Path::new(root); - dirs.move_iter().filter(|path| { + dirs.into_iter().filter(|path| { path.as_vec() != b"." && path.as_vec() != b".." }).map(|path| root.join(path).to_c_str()).collect() } @@ -428,10 +428,10 @@ pub fn readlink(p: &CString) -> IoResult<CString> { libc::CreateFileW(p.as_ptr(), libc::GENERIC_READ, libc::FILE_SHARE_READ, - ptr::mut_null(), + ptr::null_mut(), libc::OPEN_EXISTING, libc::FILE_ATTRIBUTE_NORMAL, - ptr::mut_null()) + ptr::null_mut()) }; if handle == libc::INVALID_HANDLE_VALUE { return Err(super::last_error()) @@ -468,7 +468,7 @@ pub fn link(src: &CString, dst: &CString) -> IoResult<()> { let src = try!(to_utf16(src)); let dst = try!(to_utf16(dst)); super::mkerr_winbool(unsafe { - libc::CreateHardLinkW(dst.as_ptr(), src.as_ptr(), ptr::mut_null()) + libc::CreateHardLinkW(dst.as_ptr(), src.as_ptr(), ptr::null_mut()) }) } diff --git a/src/libnative/io/helper_thread.rs b/src/libnative/io/helper_thread.rs index 8e92aa56d3c..1f51f8eacd6 100644 --- a/src/libnative/io/helper_thread.rs +++ b/src/libnative/io/helper_thread.rs @@ -172,7 +172,7 @@ mod imp { pub fn new() -> (HANDLE, HANDLE) { unsafe { - let handle = CreateEventA(ptr::mut_null(), libc::FALSE, libc::FALSE, + let handle = CreateEventA(ptr::null_mut(), libc::FALSE, libc::FALSE, ptr::null()); (handle, handle) } diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index 7881e088388..86f72bf65dd 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -267,7 +267,7 @@ impl rtio::IoFactory for IoFactory { Vec<Option<Box<rtio::RtioPipe + Send>>>)> { process::Process::spawn(cfg).map(|(p, io)| { (box p as Box<rtio::RtioProcess + Send>, - io.move_iter().map(|p| p.map(|p| { + io.into_iter().map(|p| p.map(|p| { box p as Box<rtio::RtioPipe + Send> })).collect()) }) diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index ba951cdef26..af7508ccbe9 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -543,7 +543,7 @@ impl TcpAcceptor { while !self.inner.closed.load(atomic::SeqCst) { match retry(|| unsafe { - libc::accept(self.fd(), ptr::mut_null(), ptr::mut_null()) + libc::accept(self.fd(), ptr::null_mut(), ptr::null_mut()) }) { -1 if util::wouldblock() => {} -1 => return Err(os::last_error()), @@ -608,7 +608,7 @@ impl TcpAcceptor { if wsaevents.lNetworkEvents & c::FD_ACCEPT == 0 { continue } match unsafe { - libc::accept(self.fd(), ptr::mut_null(), ptr::mut_null()) + libc::accept(self.fd(), ptr::null_mut(), ptr::null_mut()) } { -1 if util::wouldblock() => {} -1 => return Err(os::last_error()), diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs index a3564dfe2cc..c222907fa5b 100644 --- a/src/libnative/io/pipe_unix.rs +++ b/src/libnative/io/pipe_unix.rs @@ -50,7 +50,7 @@ fn addr_to_sockaddr_un(addr: &CString, }) } s.sun_family = libc::AF_UNIX as libc::sa_family_t; - for (slot, value) in s.sun_path.mut_iter().zip(addr.iter()) { + for (slot, value) in s.sun_path.iter_mut().zip(addr.iter()) { *slot = value; } diff --git a/src/libnative/io/pipe_windows.rs b/src/libnative/io/pipe_windows.rs index 1f1880d712d..2de9cd9a41c 100644 --- a/src/libnative/io/pipe_windows.rs +++ b/src/libnative/io/pipe_windows.rs @@ -104,7 +104,7 @@ struct Event(libc::HANDLE); impl Event { fn new(manual_reset: bool, initial_state: bool) -> IoResult<Event> { let event = unsafe { - libc::CreateEventW(ptr::mut_null(), + libc::CreateEventW(ptr::null_mut(), manual_reset as libc::BOOL, initial_state as libc::BOOL, ptr::null()) @@ -164,7 +164,7 @@ unsafe fn pipe(name: *const u16, init: bool) -> libc::HANDLE { 65536, 65536, 0, - ptr::mut_null() + ptr::null_mut() ) } @@ -225,10 +225,10 @@ impl UnixStream { libc::CreateFileW(p, libc::GENERIC_READ | libc::GENERIC_WRITE, 0, - ptr::mut_null(), + ptr::null_mut(), libc::OPEN_EXISTING, libc::FILE_FLAG_OVERLAPPED, - ptr::mut_null()) + ptr::null_mut()) }; if result != libc::INVALID_HANDLE_VALUE { return Some(result) @@ -240,10 +240,10 @@ impl UnixStream { libc::CreateFileW(p, libc::GENERIC_READ | libc::FILE_WRITE_ATTRIBUTES, 0, - ptr::mut_null(), + ptr::null_mut(), libc::OPEN_EXISTING, libc::FILE_FLAG_OVERLAPPED, - ptr::mut_null()) + ptr::null_mut()) }; if result != libc::INVALID_HANDLE_VALUE { return Some(result) @@ -255,10 +255,10 @@ impl UnixStream { libc::CreateFileW(p, libc::GENERIC_WRITE | libc::FILE_READ_ATTRIBUTES, 0, - ptr::mut_null(), + ptr::null_mut(), libc::OPEN_EXISTING, libc::FILE_FLAG_OVERLAPPED, - ptr::mut_null()) + ptr::null_mut()) }; if result != libc::INVALID_HANDLE_VALUE { return Some(result) @@ -280,8 +280,8 @@ impl UnixStream { let ret = unsafe { libc::SetNamedPipeHandleState(inner.handle, &mut mode, - ptr::mut_null(), - ptr::mut_null()) + ptr::null_mut(), + ptr::null_mut()) }; return if ret == 0 { Err(super::last_error()) @@ -341,7 +341,7 @@ impl UnixStream { } fn cancel_io(&self) -> IoResult<()> { - match unsafe { c::CancelIoEx(self.handle(), ptr::mut_null()) } { + match unsafe { c::CancelIoEx(self.handle(), ptr::null_mut()) } { 0 if os::errno() == libc::ERROR_NOT_FOUND as uint => { Ok(()) } diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index e5165929ad3..cb392e1675f 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -313,7 +313,7 @@ fn spawn_process_os(cfg: ProcessConfig, if b"PATH" != key.as_bytes_no_nul() { continue } // Split the value and test each path to see if the program exists. - for path in os::split_paths(v.as_bytes_no_nul()).move_iter() { + for path in os::split_paths(v.as_bytes_no_nul()).into_iter() { let path = path.join(cfg.program.as_bytes_no_nul()) .with_extension(os::consts::EXE_EXTENSION); if path.exists() { @@ -347,7 +347,7 @@ fn spawn_process_os(cfg: ProcessConfig, let size = mem::size_of::<libc::SECURITY_ATTRIBUTES>(); let mut sa = libc::SECURITY_ATTRIBUTES { nLength: size as libc::DWORD, - lpSecurityDescriptor: ptr::mut_null(), + lpSecurityDescriptor: ptr::null_mut(), bInheritHandle: 1, }; let filename: Vec<u16> = "NUL".utf16_units().collect(); @@ -359,7 +359,7 @@ fn spawn_process_os(cfg: ProcessConfig, &mut sa, libc::OPEN_EXISTING, 0, - ptr::mut_null()); + ptr::null_mut()); if *slot == INVALID_HANDLE_VALUE { return Err(super::last_error()) } @@ -399,8 +399,8 @@ fn spawn_process_os(cfg: ProcessConfig, cmd_str = cmd_str.append_one(0); let created = CreateProcessW(ptr::null(), cmd_str.as_mut_ptr(), - ptr::mut_null(), - ptr::mut_null(), + ptr::null_mut(), + ptr::null_mut(), TRUE, flags, envp, dirp, &mut si, &mut pi); @@ -437,9 +437,9 @@ fn spawn_process_os(cfg: ProcessConfig, fn zeroed_startupinfo() -> libc::types::os::arch::extra::STARTUPINFO { libc::types::os::arch::extra::STARTUPINFO { cb: 0, - lpReserved: ptr::mut_null(), - lpDesktop: ptr::mut_null(), - lpTitle: ptr::mut_null(), + lpReserved: ptr::null_mut(), + lpDesktop: ptr::null_mut(), + lpTitle: ptr::null_mut(), dwX: 0, dwY: 0, dwXSize: 0, @@ -450,7 +450,7 @@ fn zeroed_startupinfo() -> libc::types::os::arch::extra::STARTUPINFO { dwFlags: 0, wShowWindow: 0, cbReserved2: 0, - lpReserved2: ptr::mut_null(), + lpReserved2: ptr::null_mut(), hStdInput: libc::INVALID_HANDLE_VALUE, hStdOutput: libc::INVALID_HANDLE_VALUE, hStdError: libc::INVALID_HANDLE_VALUE, @@ -460,8 +460,8 @@ fn zeroed_startupinfo() -> libc::types::os::arch::extra::STARTUPINFO { #[cfg(windows)] fn zeroed_process_information() -> libc::types::os::arch::extra::PROCESS_INFORMATION { libc::types::os::arch::extra::PROCESS_INFORMATION { - hProcess: ptr::mut_null(), - hThread: ptr::mut_null(), + hProcess: ptr::null_mut(), + hThread: ptr::null_mut(), dwProcessId: 0, dwThreadId: 0 } @@ -596,7 +596,7 @@ fn spawn_process_os(cfg: ProcessConfig, Err(..) => { Ok(SpawnProcessResult { pid: pid, - handle: ptr::mut_null() + handle: ptr::null_mut() }) } Ok(..) => fail!("short read on the cloexec pipe"), @@ -806,7 +806,7 @@ fn with_envp<T>(env: Option<&[(&CString, &CString)]>, cb: |*mut c_void| -> T) -> cb(blk.as_mut_ptr() as *mut c_void) } - _ => cb(ptr::mut_null()) + _ => cb(ptr::null_mut()) } } @@ -1050,14 +1050,14 @@ fn waitpid(pid: pid_t, deadline: u64) -> IoResult<rtio::ProcessExit> { tv = util::ms_to_timeval(ms); (&mut tv as *mut _, idx) } - None => (ptr::mut_null(), -1), + None => (ptr::null_mut(), -1), }; // Wait for something to happen c::fd_set(&mut set, input); c::fd_set(&mut set, read_fd); - match unsafe { c::select(max, &mut set, ptr::mut_null(), - ptr::mut_null(), p) } { + match unsafe { c::select(max, &mut set, ptr::null_mut(), + ptr::null_mut(), p) } { // interrupted, retry -1 if os::errno() == libc::EINTR as int => continue, @@ -1129,7 +1129,7 @@ fn waitpid(pid: pid_t, deadline: u64) -> IoResult<rtio::ProcessExit> { // Once this helper thread is done, we re-register the old sigchld // handler and close our intermediate file descriptors. unsafe { - assert_eq!(c::sigaction(c::SIGCHLD, &old, ptr::mut_null()), 0); + assert_eq!(c::sigaction(c::SIGCHLD, &old, ptr::null_mut()), 0); let _ = libc::close(read_fd); let _ = libc::close(WRITE_FD); WRITE_FD = -1; diff --git a/src/libnative/io/timer_unix.rs b/src/libnative/io/timer_unix.rs index 801434f8101..0a5de325c09 100644 --- a/src/libnative/io/timer_unix.rs +++ b/src/libnative/io/timer_unix.rs @@ -88,7 +88,7 @@ pub enum Req { pub fn now() -> u64 { unsafe { let mut now: libc::timeval = mem::zeroed(); - assert_eq!(c::gettimeofday(&mut now, ptr::mut_null()), 0); + assert_eq!(c::gettimeofday(&mut now, ptr::null_mut()), 0); return (now.tv_sec as u64) * 1000 + (now.tv_usec as u64) / 1000; } } @@ -133,7 +133,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) { 'outer: loop { let timeout = if active.len() == 0 { // Empty array? no timeout (wait forever for the next request) - ptr::mut_null() + ptr::null_mut() } else { let now = now(); // If this request has already expired, then signal it and go @@ -154,8 +154,8 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) { c::fd_set(&mut set, input); match unsafe { - c::select(input + 1, &mut set, ptr::mut_null(), - ptr::mut_null(), timeout) + c::select(input + 1, &mut set, ptr::null_mut(), + ptr::null_mut(), timeout) } { // timed out 0 => signal(&mut active, &mut dead), diff --git a/src/libnative/io/timer_windows.rs b/src/libnative/io/timer_windows.rs index 8d781f50d35..82d31811172 100644 --- a/src/libnative/io/timer_windows.rs +++ b/src/libnative/io/timer_windows.rs @@ -107,7 +107,7 @@ impl Timer { unsafe { HELPER.boot(|| {}, helper) } let obj = unsafe { - imp::CreateWaitableTimerA(ptr::mut_null(), 0, ptr::null()) + imp::CreateWaitableTimerA(ptr::null_mut(), 0, ptr::null()) }; if obj.is_null() { Err(super::last_error()) @@ -141,8 +141,8 @@ impl rtio::RtioTimer for Timer { // 100ns intervals, so we multiply by 10^4. let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER; assert_eq!(unsafe { - imp::SetWaitableTimer(self.obj, &due, 0, ptr::mut_null(), - ptr::mut_null(), 0) + imp::SetWaitableTimer(self.obj, &due, 0, ptr::null_mut(), + ptr::null_mut(), 0) }, 1); let _ = unsafe { imp::WaitForSingleObject(self.obj, libc::INFINITE) }; @@ -154,8 +154,8 @@ impl rtio::RtioTimer for Timer { // see above for the calculation let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER; assert_eq!(unsafe { - imp::SetWaitableTimer(self.obj, &due, 0, ptr::mut_null(), - ptr::mut_null(), 0) + imp::SetWaitableTimer(self.obj, &due, 0, ptr::null_mut(), + ptr::null_mut(), 0) }, 1); unsafe { HELPER.send(NewTimer(self.obj, cb, true)) } @@ -169,7 +169,7 @@ impl rtio::RtioTimer for Timer { let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER; assert_eq!(unsafe { imp::SetWaitableTimer(self.obj, &due, msecs as libc::LONG, - ptr::mut_null(), ptr::mut_null(), 0) + ptr::null_mut(), ptr::null_mut(), 0) }, 1); unsafe { HELPER.send(NewTimer(self.obj, cb, false)) } diff --git a/src/libnative/io/tty_windows.rs b/src/libnative/io/tty_windows.rs index 7f344279cd5..7263036e165 100644 --- a/src/libnative/io/tty_windows.rs +++ b/src/libnative/io/tty_windows.rs @@ -98,7 +98,7 @@ impl RtioTTY for WindowsTTY { utf16.as_mut_ptr() as LPVOID, utf16.len() as u32, &mut num as LPDWORD, - ptr::mut_null()) } { + ptr::null_mut()) } { 0 => return Err(super::last_error()), _ => (), }; @@ -123,7 +123,7 @@ impl RtioTTY for WindowsTTY { utf16.as_ptr() as LPCVOID, utf16.len() as u32, &mut num as LPDWORD, - ptr::mut_null()) } { + ptr::null_mut()) } { 0 => Err(super::last_error()), _ => Ok(()), } diff --git a/src/libnative/io/util.rs b/src/libnative/io/util.rs index 078989b0581..5f69ec00cdd 100644 --- a/src/libnative/io/util.rs +++ b/src/libnative/io/util.rs @@ -155,15 +155,15 @@ pub fn connect_timeout(fd: net::sock_t, // undefined what the value of the 'tv' is after select // returns EINTR). let mut tv = ms_to_timeval(timeout - (::io::timer::now() - start)); - c::select(fd + 1, ptr::mut_null(), set as *mut _, - ptr::mut_null(), &mut tv) + c::select(fd + 1, ptr::null_mut(), set as *mut _, + ptr::null_mut(), &mut tv) }) } #[cfg(windows)] fn await(_fd: net::sock_t, set: &mut c::fd_set, timeout: u64) -> libc::c_int { let mut tv = ms_to_timeval(timeout); - unsafe { c::select(1, ptr::mut_null(), set, ptr::mut_null(), &mut tv) } + unsafe { c::select(1, ptr::null_mut(), set, ptr::null_mut(), &mut tv) } } } @@ -180,15 +180,15 @@ pub fn await(fds: &[net::sock_t], deadline: Option<u64>, } let (read, write) = match status { - Readable => (&mut set as *mut _, ptr::mut_null()), - Writable => (ptr::mut_null(), &mut set as *mut _), + Readable => (&mut set as *mut _, ptr::null_mut()), + Writable => (ptr::null_mut(), &mut set as *mut _), }; let mut tv: libc::timeval = unsafe { mem::zeroed() }; match retry(|| { let now = ::io::timer::now(); let tvp = match deadline { - None => ptr::mut_null(), + None => ptr::null_mut(), Some(deadline) => { // If we're past the deadline, then pass a 0 timeout to // select() so we can poll the status @@ -198,7 +198,7 @@ pub fn await(fds: &[net::sock_t], deadline: Option<u64>, } }; let r = unsafe { - c::select(max as libc::c_int, read, write, ptr::mut_null(), tvp) + c::select(max as libc::c_int, read, write, ptr::null_mut(), tvp) }; r }) { |
