Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4226,7 +4226,7 @@ f! {
}

pub fn uname(buf: *mut crate::utsname) -> c_int {
__xuname(256, buf as *mut c_void)
__xuname(256, buf.cast())
}

pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub const RTAX_BRD: c_int = 7;
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut cmsghdr {
if (*mhdr).msg_controllen as usize >= size_of::<cmsghdr>() {
(*mhdr).msg_control.cast::<cmsghdr>()
(*mhdr).msg_control.cast()
} else {
core::ptr::null_mut()
}
Expand Down
8 changes: 4 additions & 4 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl siginfo_t {
__pad1: Padding<c_int>,
_pid: crate::pid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._pid
(*(self as *const siginfo_t).cast::<siginfo_timer>())._pid
}

pub unsafe fn si_uid(&self) -> crate::uid_t {
Expand All @@ -97,7 +97,7 @@ impl siginfo_t {
_pid: crate::pid_t,
_uid: crate::uid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._uid
(*(self as *const siginfo_t).cast::<siginfo_timer>())._uid
}

pub unsafe fn si_value(&self) -> crate::sigval {
Expand All @@ -112,7 +112,7 @@ impl siginfo_t {
_uid: crate::uid_t,
value: crate::sigval,
}
(*(self as *const siginfo_t as *const siginfo_timer)).value
(*(self as *const siginfo_t).cast::<siginfo_timer>()).value
}

pub unsafe fn si_status(&self) -> c_int {
Expand All @@ -127,7 +127,7 @@ impl siginfo_t {
_uid: crate::uid_t,
status: c_int,
}
(*(self as *const siginfo_t as *const siginfo_timer)).status
(*(self as *const siginfo_t).cast::<siginfo_timer>()).status
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ impl siginfo_t {
_stime: crate::clock_t,
_status: crate::c_int,
}
(*(self as *const siginfo_t as *const siginfo_proc))._status
(*(self as *const siginfo_t).cast::<siginfo_proc>())._status
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/unix/cygwin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ impl siginfo_t {
_si_errno: c_int,
si_addr: *mut c_void,
}
(*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr
(*(self as *const siginfo_t).cast::<siginfo_si_addr>()).si_addr
}

pub unsafe fn si_status(&self) -> c_int {
Expand All @@ -547,7 +547,7 @@ impl siginfo_t {
_si_errno: c_int,
si_status: c_int,
}
(*(self as *const siginfo_t as *const siginfo_sigchld)).si_status
(*(self as *const siginfo_t).cast::<siginfo_sigchld>()).si_status
}

pub unsafe fn si_pid(&self) -> pid_t {
Expand All @@ -568,7 +568,7 @@ impl siginfo_t {
_si_errno: c_int,
si_value: sigval,
}
(*(self as *const siginfo_t as *const siginfo_si_value)).si_value
(*(self as *const siginfo_t).cast::<siginfo_si_value>()).si_value
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ const fn CMSG_ALIGN(len: usize) -> usize {
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
if (*mhdr).msg_controllen as usize >= size_of::<cmsghdr>() {
(*mhdr).msg_control as *mut cmsghdr
(*mhdr).msg_control.cast()
} else {
core::ptr::null_mut::<cmsghdr>()
}
Expand Down
4 changes: 2 additions & 2 deletions src/unix/hurd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3363,7 +3363,7 @@ const fn CMSG_ALIGN(len: usize) -> usize {
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
if (*mhdr).msg_controllen as usize >= size_of::<cmsghdr>() {
(*mhdr).msg_control.cast::<cmsghdr>()
(*mhdr).msg_control.cast()
} else {
core::ptr::null_mut::<cmsghdr>()
}
Expand Down Expand Up @@ -3392,7 +3392,7 @@ f! {
{
core::ptr::null_mut::<cmsghdr>()
} else {
next.cast::<cmsghdr>()
next.cast()
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3285,7 +3285,7 @@ f! {
if (next.offset(1)) as usize > max {
core::ptr::null_mut::<cmsghdr>()
} else {
next as *mut cmsghdr
next.cast()
}
}

Expand Down Expand Up @@ -3747,7 +3747,7 @@ impl siginfo_t {
_si_code: c_int,
si_addr: *mut c_void,
}
(*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr
(*(self as *const siginfo_t).cast::<siginfo_sigfault>()).si_addr
}

pub unsafe fn si_value(&self) -> crate::sigval {
Expand All @@ -3760,13 +3760,13 @@ impl siginfo_t {
_si_overrun: c_int,
si_sigval: crate::sigval,
}
(*(self as *const siginfo_t as *const siginfo_timer)).si_sigval
(*(self as *const siginfo_t).cast::<siginfo_timer>()).si_sigval
}
}

impl siginfo_t {
unsafe fn sifields(&self) -> &sifields {
&(*(self as *const siginfo_t as *const siginfo_f)).sifields
&(*(self as *const siginfo_t).cast::<siginfo_f>()).sifields
}

pub unsafe fn si_pid(&self) -> crate::pid_t {
Expand Down
28 changes: 14 additions & 14 deletions src/unix/linux_like/emscripten/lfs64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub unsafe extern "C" fn creat64(path: *const c_char, mode: crate::mode_t) -> c_

#[inline]
pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int {
crate::fgetpos(stream, pos as *mut _)
crate::fgetpos(stream, pos.cast())
}

#[inline]
Expand Down Expand Up @@ -38,12 +38,12 @@ pub unsafe extern "C" fn fseeko64(

#[inline]
pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int {
crate::fsetpos(stream, pos as *mut _)
crate::fsetpos(stream, pos.cast())
}

#[inline]
pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int {
crate::fstat(fildes, buf as *mut _)
crate::fstat(fildes, buf.cast())
}

#[inline]
Expand All @@ -53,17 +53,17 @@ pub unsafe extern "C" fn fstatat64(
buf: *mut crate::stat64,
flag: c_int,
) -> c_int {
crate::fstatat(fd, path, buf as *mut _, flag)
crate::fstatat(fd, path, buf.cast(), flag)
}

#[inline]
pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int {
crate::fstatfs(fd, buf as *mut _)
crate::fstatfs(fd, buf.cast())
}

#[inline]
pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int {
crate::fstatvfs(fd, buf as *mut _)
crate::fstatvfs(fd, buf.cast())
}

#[inline]
Expand All @@ -78,7 +78,7 @@ pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int {

#[inline]
pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int {
crate::getrlimit(resource, rlim as *mut _)
crate::getrlimit(resource, rlim.cast())
}

#[inline]
Expand All @@ -88,7 +88,7 @@ pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> o

#[inline]
pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int {
crate::lstat(path, buf as *mut _)
crate::lstat(path, buf.cast())
}

#[inline]
Expand Down Expand Up @@ -171,7 +171,7 @@ pub unsafe extern "C" fn pwritev64(

#[inline]
pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 {
crate::readdir(dirp) as *mut _
crate::readdir(dirp).cast()
}

#[inline]
Expand All @@ -180,27 +180,27 @@ pub unsafe extern "C" fn readdir64_r(
entry: *mut crate::dirent64,
result: *mut *mut crate::dirent64,
) -> c_int {
crate::readdir_r(dirp, entry as *mut _, result as *mut _)
crate::readdir_r(dirp, entry.cast(), result.cast())
}

#[inline]
pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int {
crate::setrlimit(resource, rlim as *mut _)
crate::setrlimit(resource, rlim.cast())
}

#[inline]
pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int {
crate::stat(pathname, statbuf as *mut _)
crate::stat(pathname, statbuf.cast())
}

#[inline]
pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int {
crate::statfs(pathname, buf as *mut _)
crate::statfs(pathname, buf.cast())
}

#[inline]
pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int {
crate::statvfs(path, buf as *mut _)
crate::statvfs(path, buf.cast())
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ f! {
if (next.offset(1)) as usize >= max {
core::ptr::null_mut::<cmsghdr>()
} else {
next as *mut cmsghdr
next.cast()
}
}

Expand Down
30 changes: 15 additions & 15 deletions src/unix/linux_like/linux/musl/lfs64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub unsafe extern "C" fn fallocate64(

#[inline]
pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int {
crate::fgetpos(stream, pos as *mut _)
crate::fgetpos(stream, pos.cast())
}

#[inline]
Expand Down Expand Up @@ -46,12 +46,12 @@ pub unsafe extern "C" fn fseeko64(

#[inline]
pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int {
crate::fsetpos(stream, pos as *mut _)
crate::fsetpos(stream, pos.cast())
}

#[inline]
pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int {
crate::fstat(fildes, buf as *mut _)
crate::fstat(fildes, buf.cast())
}

#[inline]
Expand All @@ -61,17 +61,17 @@ pub unsafe extern "C" fn fstatat64(
buf: *mut crate::stat64,
flag: c_int,
) -> c_int {
crate::fstatat(fd, path, buf as *mut _, flag)
crate::fstatat(fd, path, buf.cast(), flag)
}

#[inline]
pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int {
crate::fstatfs(fd, buf as *mut _)
crate::fstatfs(fd, buf.cast())
}

#[inline]
pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int {
crate::fstatvfs(fd, buf as *mut _)
crate::fstatvfs(fd, buf.cast())
}

#[inline]
Expand All @@ -86,7 +86,7 @@ pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int {

#[inline]
pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int {
crate::getrlimit(resource, rlim as *mut _)
crate::getrlimit(resource, rlim.cast())
}

#[inline]
Expand All @@ -96,7 +96,7 @@ pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> o

#[inline]
pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int {
crate::lstat(path, buf as *mut _)
crate::lstat(path, buf.cast())
}

#[inline]
Expand Down Expand Up @@ -164,7 +164,7 @@ pub unsafe extern "C" fn prlimit64(
new_limit: *const crate::rlimit64,
old_limit: *mut crate::rlimit64,
) -> c_int {
crate::prlimit(pid, resource, new_limit as *mut _, old_limit as *mut _)
crate::prlimit(pid, resource, new_limit.cast(), old_limit.cast())
}

#[inline]
Expand All @@ -189,7 +189,7 @@ pub unsafe extern "C" fn pwritev64(

#[inline]
pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 {
crate::readdir(dirp) as *mut _
crate::readdir(dirp).cast()
}

#[inline]
Expand All @@ -198,7 +198,7 @@ pub unsafe extern "C" fn readdir64_r(
entry: *mut crate::dirent64,
result: *mut *mut crate::dirent64,
) -> c_int {
crate::readdir_r(dirp, entry as *mut _, result as *mut _)
crate::readdir_r(dirp, entry.cast(), result.cast())
}

#[inline]
Expand All @@ -213,22 +213,22 @@ pub unsafe extern "C" fn sendfile64(

#[inline]
pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int {
crate::setrlimit(resource, rlim as *mut _)
crate::setrlimit(resource, rlim.cast())
}

#[inline]
pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int {
crate::stat(pathname, statbuf as *mut _)
crate::stat(pathname, statbuf.cast())
}

#[inline]
pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int {
crate::statfs(pathname, buf as *mut _)
crate::statfs(pathname, buf.cast())
}

#[inline]
pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int {
crate::statvfs(path, buf as *mut _)
crate::statvfs(path, buf.cast())
}

#[inline]
Expand Down
Loading