diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-09-22 12:35:45 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-09-22 12:41:28 +0100 |
commit | 2e1d4bf444637450b5412780c36f8d2b5bfa4550 (patch) | |
tree | 8c9bc477d15ee1af3b2bb2bc699453b10201b1d7 /src/qt | |
parent | b66f6dcb26906ca8187c7e54735e21168b8101c7 (diff) | |
parent | befb42f1462f886bf5bed562ba1dae00853cecde (diff) |
Merge bitcoin-core/gui#755: Silence `-Wcast-function-type` warning
befb42f1462f886bf5bed562ba1dae00853cecde qt: Silence `-Wcast-function-type` warning (Hennadii Stepanov)
Pull request description:
On Fedora 38 @ 8f7b9eb8711fdb32e8bdb59d2a7462a46c7a8086:
```
$ x86_64-w64-mingw32-g++ --version | head -1
x86_64-w64-mingw32-g++ (GCC) 12.2.1 20221121 (Fedora MinGW 12.2.1-8.fc38)
$ ./configure CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS="-Wno-return-type -Wcast-function-type"
$ make > /dev/null
qt/winshutdownmonitor.cpp: In static member function 'static void WinShutdownMonitor::registerShutdownBlockReason(const QString&, HWND__* const&)':
qt/winshutdownmonitor.cpp:46:42: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'PSHUTDOWNBRCREATE' {aka 'int (*)(HWND__*, const wchar_t*)'} [-Wcast-function-type]
46 | PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[Required](https://github.com/bitcoin/bitcoin/pull/25972#issuecomment-1713999563) for https://github.com/bitcoin/bitcoin/pull/25972.
Picked from https://trac.nginx.org/nginx/ticket/1865.
ACKs for top commit:
MarcoFalke:
review ACK befb42f1462f886bf5bed562ba1dae00853cecde
Tree-SHA512: b37b2c5dd8702caf84d1833c3511bc46ee14f23b84678b8de0fd04e24e5ecc5fd4d27ba38be0d0b08de91299369f70d4924c895a71fd8e0b6feffcfb7407574a
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/winshutdownmonitor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qt/winshutdownmonitor.cpp b/src/qt/winshutdownmonitor.cpp index 386d593eea..97a9ec318c 100644 --- a/src/qt/winshutdownmonitor.cpp +++ b/src/qt/winshutdownmonitor.cpp @@ -43,7 +43,7 @@ bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pM void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId) { typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR); - PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate"); + PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)(void*)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate"); if (shutdownBRCreate == nullptr) { qWarning() << "registerShutdownBlockReason: GetProcAddress for ShutdownBlockReasonCreate failed"; return; |