diff --git a/src/header/stdio/printf.rs b/src/header/stdio/printf.rs index f875c91253..442c4d4c64 100644 --- a/src/header/stdio/printf.rs +++ b/src/header/stdio/printf.rs @@ -951,7 +951,7 @@ pub(crate) unsafe fn inner_printf( varargs.get(index, &mut ap, Some((arg.fmtkind, arg.intkind))) } { VaArg::c_double(i) => i, - VaArg::c_longdouble(i) => unsafe { relibc_ldtod(&i as *const c_longdouble) }, + VaArg::c_longdouble(i) => unsafe { relibc_ldtod(&raw const i) }, _ => panic!("this should not be possible"), }; if float.is_finite() { @@ -970,7 +970,7 @@ pub(crate) unsafe fn inner_printf( varargs.get(index, &mut ap, Some((arg.fmtkind, arg.intkind))) } { VaArg::c_double(i) => i, - VaArg::c_longdouble(i) => unsafe { relibc_ldtod(&i as *const c_longdouble) }, + VaArg::c_longdouble(i) => unsafe { relibc_ldtod(&raw const i) }, _ => panic!("this should not be possible"), }; if float.is_finite() { @@ -986,7 +986,7 @@ pub(crate) unsafe fn inner_printf( varargs.get(index, &mut ap, Some((arg.fmtkind, arg.intkind))) } { VaArg::c_double(i) => i, - VaArg::c_longdouble(i) => unsafe { relibc_ldtod(&i as *const c_longdouble) }, + VaArg::c_longdouble(i) => unsafe { relibc_ldtod(&raw const i) }, _ => panic!("this should not be possible"), }; if float.is_finite() { diff --git a/src/platform/redox/socket.rs b/src/platform/redox/socket.rs index 166d0251cc..d150fa32bc 100644 --- a/src/platform/redox/socket.rs +++ b/src/platform/redox/socket.rs @@ -429,10 +429,9 @@ unsafe fn deserialize_ancillary_data_from_stream( let cmsg_data_from_stream = &msg_stream[*cursor..*cursor + cmsg_data_len_in_stream]; *cursor += cmsg_data_len_in_stream; - let mut actual_posix_cmsg_data_len: usize = 0; let mut temp_posix_cmsg_data_buf: Vec = Vec::new(); - match (cmsg_level, cmsg_type) { + let actual_posix_cmsg_data_len = match (cmsg_level, cmsg_type) { (SOL_SOCKET, SCM_RIGHTS) => { if cmsg_data_len_in_stream != mem::size_of::() { return Err(Errno(EINVAL)); @@ -458,7 +457,7 @@ unsafe fn deserialize_ancillary_data_from_stream( for fd in fds_usize { temp_posix_cmsg_data_buf.extend_from_slice(&(fd as c_int).to_le_bytes()); } - actual_posix_cmsg_data_len = temp_posix_cmsg_data_buf.len(); + temp_posix_cmsg_data_buf.len() } (SOL_SOCKET, SCM_CREDENTIALS) => { if cmsg_data_len_in_stream @@ -480,12 +479,12 @@ unsafe fn deserialize_ancillary_data_from_stream( mem::size_of::(), ) }); - actual_posix_cmsg_data_len = temp_posix_cmsg_data_buf.len(); + temp_posix_cmsg_data_buf.len() } _ => { return Err(Errno(EINVAL)); } - } + }; let space_needed_for_posix_cmsg = unsafe { CMSG_SPACE(actual_posix_cmsg_data_len as u32) } as usize;