diff --git a/src/chmod/chmod.rs b/src/chmod/chmod.rs index 363562213..5b869f129 100644 --- a/src/chmod/chmod.rs +++ b/src/chmod/chmod.rs @@ -78,7 +78,7 @@ Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'.", let recursive = matches.opt_present("recursive"); let fmode = matches.opt_str("reference").and_then(|fref| { let mut stat : libc::stat = unsafe { mem::uninitialized() }; - let statres = unsafe { libc::stat(fref.as_ptr() as *const i8, &mut stat as *mut libc::stat) }; + let statres = unsafe { libc::stat(fref.as_ptr() as *const _, &mut stat as *mut libc::stat) }; if statres == 0 { Some(stat.st_mode) } else { diff --git a/src/id/id.rs b/src/id/id.rs index 7e9e89b70..bbf2de03f 100644 --- a/src/id/id.rs +++ b/src/id/id.rs @@ -191,7 +191,7 @@ fn pretty(possible_pw: Option) { print!("uid\t{}\ngroups\t", pw_name); group(possible_pw, true); } else { - let login = unsafe { String::from_utf8_lossy(CStr::from_ptr((getlogin() as *const i8)).to_bytes()).to_string() }; + let login = unsafe { String::from_utf8_lossy(CStr::from_ptr((getlogin() as *const _)).to_bytes()).to_string() }; let rid = unsafe { getuid() }; let pw = unsafe { getpwuid(rid) }; diff --git a/src/uname/uname.rs b/src/uname/uname.rs index 78106e8f2..ef67e522b 100644 --- a/src/uname/uname.rs +++ b/src/uname/uname.rs @@ -35,7 +35,7 @@ extern { } unsafe fn string_from_c_str(ptr: *const i8) -> String { - String::from_utf8_lossy(CStr::from_ptr(ptr).to_bytes()).to_string() + String::from_utf8_lossy(CStr::from_ptr(ptr as *const std::os::raw::c_char).to_bytes()).to_string() } unsafe fn getuname() -> Uts { diff --git a/src/uucore/c_types.rs b/src/uucore/c_types.rs index 54478a107..cdc8b3649 100644 --- a/src/uucore/c_types.rs +++ b/src/uucore/c_types.rs @@ -128,7 +128,7 @@ pub fn get_pw_from_args(free: &Vec) -> Option { } else { let pw_pointer = unsafe { let cstr = CString::new(username).unwrap(); - getpwnam(cstr.as_bytes_with_nul().as_ptr() as *const i8) + getpwnam(cstr.as_bytes_with_nul().as_ptr() as *const _) }; if !pw_pointer.is_null() { Some(unsafe { read(pw_pointer) })