time_driver: use regular fn ptr -> raw ptr casts
This commit is contained in:
parent
b1d631d639
commit
05e50e1f4a
2 changed files with 2 additions and 8 deletions
|
@ -208,10 +208,7 @@ impl State {
|
|||
critical_section::with(|cs| {
|
||||
let alarm = self.get_alarm(cs, alarm);
|
||||
|
||||
// safety: it's OK to transmute a fn pointer into a raw pointer
|
||||
let callback_ptr: *const () = unsafe { mem::transmute(callback) };
|
||||
|
||||
alarm.callback.set(callback_ptr);
|
||||
alarm.callback.set(callback as *const ());
|
||||
alarm.ctx.set(ctx);
|
||||
})
|
||||
}
|
||||
|
|
|
@ -232,10 +232,7 @@ impl State {
|
|||
critical_section::with(|cs| {
|
||||
let alarm = self.get_alarm(cs, alarm);
|
||||
|
||||
// safety: it's OK to transmute a fn pointer into a raw pointer
|
||||
let callback_ptr: *const () = unsafe { mem::transmute(callback) };
|
||||
|
||||
alarm.callback.set(callback_ptr);
|
||||
alarm.callback.set(callback as *const ());
|
||||
alarm.ctx.set(ctx);
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue