diff options
author | Zeex <zeex@rocketmail.com> | 2020-05-30 19:48:32 +0600 |
---|---|---|
committer | Zeex <zeex@rocketmail.com> | 2020-05-30 19:49:24 +0600 |
commit | 873e7cd795ea7f4a97db7f50c361589626f39cea (patch) | |
tree | 07c7830b3dae7ee685d86b695bfdb68070540d7a | |
parent | a38a683c31a8ee4c4c761fb38f76324f085536c8 (diff) | |
download | subhook-873e7cd795ea7f4a97db7f50c361589626f39cea.zip subhook-873e7cd795ea7f4a97db7f50c361589626f39cea.tar.gz subhook-873e7cd795ea7f4a97db7f50c361589626f39cea.tar.bz2 |
Change 0 to nullptr
It's 2020 today... I guess it should not cause any problems
-rw-r--r-- | subhook.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -164,7 +164,7 @@ inline void SetDisasmHandler(subhook_disasm_handler_t handler) { class Hook { public: - Hook() : hook_(0) {} + Hook() : hook_(nullptr) {} Hook(void *src, void *dst, HookFlags flags = HookNoFlags) : hook_(subhook_new(src, dst, (subhook_flags_t)flags)) { @@ -180,20 +180,20 @@ class Hook { void *GetTrampoline() const { return subhook_get_trampoline(hook_); } bool Install() { - return subhook_install(hook_) >= 0; + return subhook_install(hook_) == 0; } bool Install(void *src, void *dst, HookFlags flags = HookNoFlags) { - if (hook_ == 0) { + if (hook_ == nullptr) { hook_ = subhook_new(src, dst, (subhook_flags_t)flags); } return Install(); } bool Remove() { - return subhook_remove(hook_) >= 0; + return subhook_remove(hook_) == 0; } bool IsInstalled() const { |