diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2016-03-22 17:58:45 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2016-03-22 22:03:54 -0500 |
| commit | 2628f3cc8f91a52d9dcc800afb6c4a7dc0c785e0 (patch) | |
| tree | 218a69ade6504638f42db4f4c855cbd15d29cb73 /src/libstd | |
| parent | bd71d11a8f75b9957489c795a1551a0cd489eca3 (diff) | |
| download | rust-2628f3cc8f91a52d9dcc800afb6c4a7dc0c785e0.tar.gz rust-2628f3cc8f91a52d9dcc800afb6c4a7dc0c785e0.zip | |
fix alignment
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/common/net.rs | 12 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/net.rs | 10 | ||||
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 12 | ||||
| -rw-r--r-- | src/libstd/sys/unix/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 07c535bf730..d5d967114c4 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -49,7 +49,7 @@ pub fn setsockopt<T>(sock: &Socket, opt: c_int, val: c_int, unsafe { let payload = &payload as *const T as *const c_void; cvt(c::setsockopt(*sock.as_inner(), opt, val, payload, - mem::size_of::<T>() as c::socklen_t))?; + mem::size_of::<T>() as c::socklen_t))?; Ok(()) } } @@ -60,8 +60,8 @@ pub fn getsockopt<T: Copy>(sock: &Socket, opt: c_int, let mut slot: T = mem::zeroed(); let mut len = mem::size_of::<T>() as c::socklen_t; cvt(c::getsockopt(*sock.as_inner(), opt, val, - &mut slot as *mut _ as *mut _, - &mut len))?; + &mut slot as *mut _ as *mut _, + &mut len))?; assert_eq!(len as usize, mem::size_of::<T>()); Ok(slot) } @@ -147,7 +147,7 @@ pub fn lookup_host(host: &str) -> io::Result<LookupHost> { let mut res = ptr::null_mut(); unsafe { cvt_gai(c::getaddrinfo(c_host.as_ptr(), ptr::null(), ptr::null(), - &mut res))?; + &mut res))?; Ok(LookupHost { original: res, cur: res }) } } @@ -308,7 +308,7 @@ impl TcpListener { // the OS to clean up the previous one. if !cfg!(windows) { setsockopt(&sock, c::SOL_SOCKET, c::SO_REUSEADDR, - 1 as c_int)?; + 1 as c_int)?; } // Bind our new socket @@ -334,7 +334,7 @@ impl TcpListener { let mut storage: c::sockaddr_storage = unsafe { mem::zeroed() }; let mut len = mem::size_of_val(&storage) as c::socklen_t; let sock = self.inner.accept(&mut storage as *mut _ as *mut _, - &mut len)?; + &mut len)?; let addr = sockaddr_to_addr(&storage, len as usize)?; Ok((TcpStream { inner: sock, }, addr)) } diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index 51ac8cb82d1..a74f7ea13b4 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -642,11 +642,11 @@ impl UnixDatagram { let (addr, len) = sockaddr_un(path)?; let count = cvt(libc::sendto(*d.0.as_inner(), - buf.as_ptr() as *const _, - buf.len(), - 0, - &addr as *const _ as *const _, - len))?; + buf.as_ptr() as *const _, + buf.len(), + 0, + &addr as *const _ as *const _, + len))?; Ok(count as usize) } } diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 0d77f344914..eed62c9ecfd 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -181,15 +181,15 @@ pub fn current_exe() -> io::Result<PathBuf> { -1 as c_int]; let mut sz: libc::size_t = 0; cvt(libc::sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint, - ptr::null_mut(), &mut sz, ptr::null_mut(), - 0 as libc::size_t))?; + ptr::null_mut(), &mut sz, ptr::null_mut(), + 0 as libc::size_t))?; if sz == 0 { return Err(io::Error::last_os_error()) } let mut v: Vec<u8> = Vec::with_capacity(sz as usize); cvt(libc::sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint, - v.as_mut_ptr() as *mut libc::c_void, &mut sz, - ptr::null_mut(), 0 as libc::size_t))?; + v.as_mut_ptr() as *mut libc::c_void, &mut sz, + ptr::null_mut(), 0 as libc::size_t))?; if sz == 0 { return Err(io::Error::last_os_error()); } @@ -218,10 +218,10 @@ pub fn current_exe() -> io::Result<PathBuf> { let mib = mib.as_mut_ptr(); let mut argv_len = 0; cvt(libc::sysctl(mib, 4, 0 as *mut _, &mut argv_len, - 0 as *mut _, 0))?; + 0 as *mut _, 0))?; let mut argv = Vec::<*const libc::c_char>::with_capacity(argv_len as usize); cvt(libc::sysctl(mib, 4, argv.as_mut_ptr() as *mut _, - &mut argv_len, 0 as *mut _, 0))?; + &mut argv_len, 0 as *mut _, 0))?; argv.set_len(argv_len as usize); if argv[0].is_null() { return Err(io::Error::new(io::ErrorKind::Other, diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index b712091dc0b..6f56f3ade06 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -392,7 +392,7 @@ impl Command { let mut set: libc::sigset_t = mem::uninitialized(); t!(cvt(libc::sigemptyset(&mut set))); t!(cvt(libc::pthread_sigmask(libc::SIG_SETMASK, &set, - ptr::null_mut()))); + ptr::null_mut()))); let ret = libc::signal(libc::SIGPIPE, libc::SIG_DFL); if ret == libc::SIG_ERR { return io::Error::last_os_error() diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 46397e14718..529e42248f6 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -290,7 +290,7 @@ impl File { unsafe { let mut info: c::BY_HANDLE_FILE_INFORMATION = mem::zeroed(); cvt(c::GetFileInformationByHandle(self.handle.raw(), - &mut info))?; + &mut info))?; let mut attr = FileAttr { attributes: info.dwFileAttributes, creation_time: info.ftCreationTime, diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index f479b36ebbd..f4957297581 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -188,9 +188,9 @@ impl Command { let stderr = self.stderr.as_ref().unwrap_or(&default); let stdin = stdin.to_handle(c::STD_INPUT_HANDLE, &mut pipes.stdin)?; let stdout = stdout.to_handle(c::STD_OUTPUT_HANDLE, - &mut pipes.stdout)?; + &mut pipes.stdout)?; let stderr = stderr.to_handle(c::STD_ERROR_HANDLE, - &mut pipes.stderr)?; + &mut pipes.stderr)?; si.hStdInput = stdin.raw(); si.hStdOutput = stdout.raw(); si.hStdError = stderr.raw(); |
