Skip to content

Commit

Permalink
Fixed: Some 'dead code' warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Dec 21, 2023
1 parent 5e0b67a commit 32a22ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use reloaded_hooks_x86_sys::x86::length_disassembler::LengthDisassemblerX86;
use reloaded_hooks_x86_sys::x86::rewriter::CodeRewriterX86;

// Assembler benches.
#[allow(dead_code)]
pub(crate) fn benchmark_create_assembly_hook(c: &mut Criterion) {
// Allocate the function.
let add_addr = alloc_function(&CALCULATOR_ADD_CDECL_X86).unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ use reloaded_memory_buffers::{
pub(crate) type Add = extern "win64" fn(i64, i64) -> i64;

// add_msft_x64.asm
#[allow(dead_code)]
pub const CALCULATOR_ADD_CDECL_X86: [u8; 11] = [
0x55, 0x89, 0xE5, 0x8B, 0x45, 0x08, 0x03, 0x45, 0x0C, 0x5D, 0xC3,
];

#[allow(dead_code)]
pub(crate) fn alloc_function(bytes: &[u8]) -> Result<usize, BufferSearchError> {
let settings = BufferSearchSettings {
min_address: 0,
Expand Down
7 changes: 3 additions & 4 deletions projects/reloaded-hooks-x86-sys/benches/my_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
mod benchmarks;
use benchmarks::{
assembler_bench_64::{benchmark_assemble_x64_total, benchmark_compile_only},
assembly_hook_bench_64::benchmark_create_assembly_hook,
};
use benchmarks::assembler_bench_64::{benchmark_assemble_x64_total, benchmark_compile_only};
#[allow(unused_imports)]
use benchmarks::assembly_hook_bench_64::benchmark_create_assembly_hook; // commented out
use criterion::{criterion_group, criterion_main, Criterion};

#[cfg(not(target_os = "windows"))]
Expand Down

0 comments on commit 32a22ff

Please sign in to comment.