Skip to content

Commit

Permalink
refactor: Void unused variables inside ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
shmocz committed Jun 8, 2024
1 parent a59cb5a commit 9482d24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static unsigned long suspend_thread(void* handle) {
#ifdef _WIN32
return windows_utils::suspend_thread(handle);
#elif __linux__
(void)handle;
return 1;
#else
#error Not implemented
Expand Down Expand Up @@ -158,6 +159,7 @@ unsigned long process::get_pid(void* handle) {
#ifdef _WIN32
return windows_utils::get_pid(handle);
#elif __linux__
(void)handle;
return 1;
#else
#error Not implemented
Expand Down Expand Up @@ -195,6 +197,7 @@ void Process::write_memory(void* dest, const void* src, std::size_t size,
}
}
#elif __linux__
(void)dest;
return;
#else
#error Not implemented
Expand All @@ -209,6 +212,7 @@ void Process::read_memory(void* dest, const void* src, std::size_t size) {
fmt::format("ReadProcessMemory src={},count={}", src, size));
}
#elif __linux__
(void)dest;
return;
#else
#error Not implemented
Expand Down Expand Up @@ -249,6 +253,7 @@ void Process::for_each_thread(std::function<void(Thread*, void*)> callback,
}
});
#elif __linux__
(void)cb_ctx;
return;
#else
#error Not implemented
Expand Down
4 changes: 2 additions & 2 deletions src/x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void x86::restore_regs(Xbyak::CodeGenerator* c) {
#ifdef XBYAK32
c->popfd();
c->popad();
#elif defined(XBYAK64)
#else
c->popfq();
#endif
}
Expand All @@ -44,7 +44,7 @@ void x86::save_regs(Xbyak::CodeGenerator* c) {
#ifdef XBYAK32
c->pushad();
c->pushfd();
#elif defined(XBYAK64)
#else
c->pushfq();
#endif
}

0 comments on commit 9482d24

Please sign in to comment.