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