fix warnings (#648)

* fix unknown command line argument

* fix warnings settings for gcc

* fix -Wzero-as-null-pointer-constant

* revert CMakeLists.txt
This commit is contained in:
MihailRis
2025-10-10 23:12:01 +03:00
committed by GitHub
parent 8f3e5e880c
commit 24931770d3
50 changed files with 69 additions and 61 deletions
+3 -3
View File
@@ -126,7 +126,7 @@ bool platform::open_url(const std::string& url) {
return false;
}
#elif defined(_WIN32)
auto res = ShellExecuteW(NULL, L"open", util::quote(url).c_str(), NULL, NULL, SW_SHOWDEFAULT);
auto res = ShellExecuteW(nullptr, L"open", util::quote(url).c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
if (res <= 32) {
logger.warning() << "'open' returned code " << res;
} else {
@@ -155,7 +155,7 @@ void platform::open_folder(const std::filesystem::path& folder) {
logger.warning() << "'" << cmd << "' returned code " << res;
}
#elif defined(_WIN32)
ShellExecuteW(NULL, L"open", folder.wstring().c_str(), NULL, NULL, SW_SHOWDEFAULT);
ShellExecuteW(nullptr, L"open", folder.wstring().c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
#else
auto cmd = "xdg-open " + util::quote(folder.u8string());
if (int res = system(cmd.c_str())) {
@@ -168,7 +168,7 @@ void platform::open_folder(const std::filesystem::path& folder) {
std::filesystem::path platform::get_executable_path() {
#ifdef _WIN32
wchar_t buffer[MAX_PATH];
DWORD result = GetModuleFileNameW(NULL, buffer, MAX_PATH);
DWORD result = GetModuleFileNameW(nullptr, buffer, MAX_PATH);
if (result == 0) {
DWORD error = GetLastError();
throw std::runtime_error("GetModuleFileName failed with code: " + std::to_string(error));