Skip to content
Snippets Groups Projects
Verified Commit 866c2306 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: temporary reversion of changes

parent 22ee35dc
No related branches found
No related tags found
No related merge requests found
Pipeline #3160 passed
...@@ -168,8 +168,6 @@ jobs: ...@@ -168,8 +168,6 @@ jobs:
run: rustc --version run: rustc --version
- name: Verify Rust code format - name: Verify Rust code format
run: cd frontends/libretro && cargo fmt --all -- --check run: cd frontends/libretro && cargo fmt --all -- --check
- name: Verify Rust code linting
run: cd frontends/libretro && cargo clippy -- -D warnings -A unknown-lints
- name: Run unit tests - name: Run unit tests
run: cd frontends/libretro && cargo test run: cd frontends/libretro && cargo test
- name: Build development version - name: Build development version
......
...@@ -365,19 +365,16 @@ pub extern "C" fn retro_cheat_reset() { ...@@ -365,19 +365,16 @@ pub extern "C" fn retro_cheat_reset() {
emulator.reset_cheats(); emulator.reset_cheats();
} }
/// # Safety
///
/// This function should not be called only within Lib Retro context.
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn retro_cheat_set(_index: c_uint, enabled: bool, code: *const c_char) { pub extern "C" fn retro_cheat_set(_index: c_uint, enabled: bool, code: *const c_char) {
debugln!("retro_cheat_set()"); debugln!("retro_cheat_set()");
// we'll just ignore cheats that are not enabled, Boytacean // we'll just ignore cheats that are not enabled, Boytacean
// does not support pre-loading cheats // does not support pre-loading cheats
if !enabled { if !enabled {
return; return;
} }
let emulator = EMULATOR.as_mut().unwrap(); let emulator = unsafe { EMULATOR.as_mut().unwrap() };
let code_c = CStr::from_ptr(code); let code_c = unsafe { CStr::from_ptr(code) };
let code_s = code_c.to_string_lossy().into_owned(); let code_s = code_c.to_string_lossy().into_owned();
emulator.add_cheat_code(&code_s).unwrap(); emulator.add_cheat_code(&code_s).unwrap();
} }
......
...@@ -788,7 +788,7 @@ fn main() { ...@@ -788,7 +788,7 @@ fn main() {
// in case the default ROM path is provided and the file does not // in case the default ROM path is provided and the file does not
// exist then fails gracefully // exist then fails gracefully
let path = Path::new(&args.rom_path); let path = Path::new(&args.rom_path);
if args.rom_path == DEFAULT_ROM_PATH && !path.exists() { if &args.rom_path == DEFAULT_ROM_PATH && !path.exists() {
println!("No ROM file provided, please provide one using the --rom-path option"); println!("No ROM file provided, please provide one using the --rom-path option");
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment