Change 0 to nullptr

It's 2020 today... I guess it should not cause any problems
This commit is contained in:
Zeex 2020-05-30 19:48:32 +06:00
parent a38a683c31
commit 873e7cd795

View File

@ -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 {