Skip to content

Commit

Permalink
Use raw pointers in std::sys::cloudabi when passing MaybeUninit values
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed Jul 23, 2019
1 parent 0ac6afa commit b70f217
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/libstd/sys/cloudabi/abi/cloudabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
}

Expand Down Expand Up @@ -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_)
}

Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/cloudabi/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Condvar {
&subscription,
event.as_mut_ptr(),
1,
nevents.get_mut()
nevents.as_mut_ptr()
);
assert_eq!(
ret,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/cloudabi/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
}
Expand Down Expand Up @@ -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() }
}
Expand Down

0 comments on commit b70f217

Please sign in to comment.