Use raw pointers in std::sys::cloudabi when passing MaybeUninit values

This commit is contained in:
Nathan 2019-07-23 13:51:28 -04:00
parent 0ac6afafa6
commit b70f217262
3 changed files with 6 additions and 6 deletions

View file

@ -1884,7 +1884,7 @@ pub unsafe fn clock_res_get(clock_id_: clockid, resolution_: &mut timestamp) ->
/// **time**:
/// The time value of the clock.
#[inline]
pub unsafe fn clock_time_get(clock_id_: clockid, precision_: timestamp, time_: &mut timestamp) -> errno {
pub unsafe fn clock_time_get(clock_id_: clockid, precision_: timestamp, time_: *mut timestamp) -> errno {
cloudabi_sys_clock_time_get(clock_id_, precision_, time_)
}
@ -2643,7 +2643,7 @@ pub unsafe fn mem_unmap(mapping_: &mut [u8]) -> errno {
/// **nevents**:
/// The number of events stored.
#[inline]
pub unsafe fn poll(in_: *const subscription, out_: *mut event, nsubscriptions_: usize, nevents_: &mut usize) -> errno {
pub unsafe fn poll(in_: *const subscription, out_: *mut event, nsubscriptions_: usize, nevents_: *mut usize) -> errno {
cloudabi_sys_poll(in_, out_, nsubscriptions_, nevents_)
}

View file

@ -85,7 +85,7 @@ impl Condvar {
&subscription,
event.as_mut_ptr(),
1,
nevents.get_mut()
nevents.as_mut_ptr()
);
assert_eq!(
ret,
@ -142,7 +142,7 @@ impl Condvar {
subscriptions.as_ptr(),
mem::MaybeUninit::first_ptr_mut(&mut events),
2,
nevents.get_mut()
nevents.as_mut_ptr()
);
assert_eq!(
ret,

View file

@ -19,7 +19,7 @@ impl Instant {
pub fn now() -> Instant {
unsafe {
let mut t: mem::MaybeUninit<abi::timestamp> = mem::MaybeUninit::uninit();
let ret = abi::clock_time_get(abi::clockid::MONOTONIC, 0, t.get_mut());
let ret = abi::clock_time_get(abi::clockid::MONOTONIC, 0, t.as_mut_ptr());
assert_eq!(ret, abi::errno::SUCCESS);
Instant { t: t.assume_init() }
}
@ -60,7 +60,7 @@ impl SystemTime {
pub fn now() -> SystemTime {
unsafe {
let mut t: mem::MaybeUninit<abi::timestamp> = mem::MaybeUninit::uninit();
let ret = abi::clock_time_get(abi::clockid::REALTIME, 0, t.get_mut());
let ret = abi::clock_time_get(abi::clockid::REALTIME, 0, t.as_mut_ptr());
assert_eq!(ret, abi::errno::SUCCESS);
SystemTime { t: t.assume_init() }
}