From aa36a83182b63736f755755cebd2002bab70d5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 25 Jan 2023 17:25:05 +0800 Subject: [PATCH] Windows: silense some warnings --- src/common/parsing.c | 6 ++++++ src/detection/bluetooth/bluetooth_windows.c | 5 +++++ src/detection/os/os_windows.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/parsing.c b/src/common/parsing.c index 95bba4720..bcaebc3c7 100644 --- a/src/common/parsing.c +++ b/src/common/parsing.c @@ -1,8 +1,12 @@ #include "fastfetch.h" #include "common/parsing.h" + #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat=" + void ffParseSemver(FFstrbuf* buffer, const FFstrbuf* major, const FFstrbuf* minor, const FFstrbuf* patch) { if(major->length > 0) @@ -164,3 +168,5 @@ void ffParseGTK(FFstrbuf* buffer, const FFstrbuf* gtk2, const FFstrbuf* gtk3, co ffStrbufAppendS(buffer, " [GTK4]"); } } + +#pragma GCC diagnostic pop diff --git a/src/detection/bluetooth/bluetooth_windows.c b/src/detection/bluetooth/bluetooth_windows.c index 61af30d67..e713302b4 100644 --- a/src/detection/bluetooth/bluetooth_windows.c +++ b/src/detection/bluetooth/bluetooth_windows.c @@ -3,6 +3,9 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpointer-sign" + void ffDetectBluetoothImpl(FF_MAYBE_UNUSED const FFinstance* instance, FFBluetoothResult* bluetooth) { BLUETOOTH_DEVICE_SEARCH_PARAMS btsp = { @@ -107,3 +110,5 @@ void ffDetectBluetoothImpl(FF_MAYBE_UNUSED const FFinstance* instance, FFBluetoo } } while (BluetoothFindNextDevice(hFind, &btdi)); } + +#pragma GCC diagnostic pop diff --git a/src/detection/os/os_windows.cpp b/src/detection/os/os_windows.cpp index 7b4c6ea2f..aa25e90ae 100644 --- a/src/detection/os/os_windows.cpp +++ b/src/detection/os/os_windows.cpp @@ -31,7 +31,7 @@ static const char* getOsNameByWinbrand(FFstrbuf* osName) //https://dennisbabkin.com/blog/?t=how-to-tell-the-real-version-of-windows-your-app-is-running-on#ver_string if(HMODULE __attribute__((__cleanup__(wrapFreeLibrary))) hWinbrand = LoadLibraryW(L"winbrand.dll")) { - auto BrandingFormatString = (PWSTR(WINAPI*)(PCWSTR))GetProcAddress(hWinbrand, "BrandingFormatString"); + auto BrandingFormatString = (PWSTR(WINAPI*)(PCWSTR))(void*)GetProcAddress(hWinbrand, "BrandingFormatString"); if(!BrandingFormatString) return "GetProcAddress(BrandingFormatString) failed";