Skip to content

Commit

Permalink
chore: addr_of usage for static variables
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 23, 2024
1 parent 9feb569 commit cb654bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontends/libretro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::{
ffi::CStr,
fmt::{self, Display, Formatter},
os::raw::{c_char, c_float, c_uint, c_void},
ptr,
ptr::{self, addr_of},
slice::from_raw_parts,
};

Expand Down Expand Up @@ -295,7 +295,7 @@ pub extern "C" fn retro_run() {
unsafe {
environment_cb(
RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE,
&UPDATED as *const _ as *const c_void,
addr_of!(UPDATED) as *const _ as *const c_void,
);
if UPDATED {
update_vars();
Expand Down Expand Up @@ -544,7 +544,7 @@ unsafe fn update_palette() {
let environment_cb = ENVIRONMENT_CALLBACK.as_ref().unwrap();
environment_cb(
RETRO_ENVIRONMENT_GET_VARIABLE,
&VARIABLE as *const _ as *const c_void,
addr_of!(VARIABLE) as *const _ as *const c_void,
);
if VARIABLE.value.is_null() {
return;
Expand Down

0 comments on commit cb654bf

Please sign in to comment.