diff --git a/GUI/extenwindow.cpp b/GUI/extenwindow.cpp index 28e4fb3..dfd343b 100644 --- a/GUI/extenwindow.cpp +++ b/GUI/extenwindow.cpp @@ -118,7 +118,7 @@ bool ExtenWindow::eventFilter(QObject* target, QEvent* event) void ExtenWindow::keyPressEvent(QKeyEvent* event) { - if (event->key() == Qt::Key_Delete && ui->extenList->currentItem() != nullptr) + if (event->key() == Qt::Key_Delete && ui->extenList->currentItem()) { Unload(ui->extenList->currentIndex().row()); Sync(); diff --git a/GUI/host/host.cpp b/GUI/host/host.cpp index 00985c6..eb9f1a0 100644 --- a/GUI/host/host.cpp +++ b/GUI/host/host.cpp @@ -29,7 +29,7 @@ namespace TextHook GetHook(uint64_t addr) { - if (view == nullptr) return {}; + if (!view) return {}; std::scoped_lock lock(viewMutex); for (auto hook : view) if (hook.address == addr) return hook; diff --git a/extensions/extension.h b/extensions/extension.h index b7f5a8f..a8925e6 100644 --- a/extensions/extension.h +++ b/extensions/extension.h @@ -14,7 +14,7 @@ struct SentenceInfo // nullptr marks end of info array int64_t operator[](std::string propertyName) { - for (auto info = infoArray; info->name != nullptr; ++info) if (propertyName == info->name) return info->value; + for (auto info = infoArray; info->name; ++info) if (propertyName == info->name) return info->value; throw; } diff --git a/extensions/extrawindow.cpp b/extensions/extrawindow.cpp index d0f9508..28b352f 100644 --- a/extensions/extrawindow.cpp +++ b/extensions/extrawindow.cpp @@ -136,7 +136,7 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved case DLL_PROCESS_DETACH: { std::lock_guard l(m); - if (window != nullptr) + if (window) { window->settings->setValue(WINDOW, window->geometry()); window->settings->sync(); @@ -155,7 +155,7 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) { std::lock_guard l(m); - if (window == nullptr || !sentenceInfo["current select"]) return false; + if (!window || !sentenceInfo["current select"]) return false; QMetaObject::invokeMethod(window, [=] { window->display->setText(QString::fromStdWString(sentence)); }); return false; } diff --git a/extensions/lua.cpp b/extensions/lua.cpp index c1ed1af..5c0eabc 100644 --- a/extensions/lua.cpp +++ b/extensions/lua.cpp @@ -127,7 +127,7 @@ bool ProcessSentence(std::wstring& sentence, SentenceInfo sentenceInfo) } lua_pushstring(L, WideStringToString(sentence).c_str()); lua_createtable(L, 0, 0); - for (auto info = sentenceInfo.infoArray; info->name != nullptr; ++info) + for (auto info = sentenceInfo.infoArray; info->name; ++info) { lua_pushstring(L, info->name); lua_pushinteger(L, info->value);