GlobalShortcut_win.cpp: Fix MinGW compilation warnings #2823

Merged
merged 1 commit into from Feb 6, 2017

Projects

None yet

2 participants

@davidebeatrici
Member
GlobalShortcut_win.h: In constructor 'GlobalShortcutWin::GlobalShortcutWin()':
GlobalShortcut_win.h:77:7: warning: 'GlobalShortcutWin::nxboxinput' will be initialized after [-Wreorder]
   int nxboxinput;
       ^~~~~~~~~~
GlobalShortcut_win.h:61:16: warning:   'unsigned int GlobalShortcutWin::uiHardwareDevices' [-Wreorder]
   unsigned int uiHardwareDevices;
                ^~~~~~~~~~~~~~~~~
GlobalShortcut_win.cpp:44:1: warning:   when initialized here [-Wreorder]
 GlobalShortcutWin::GlobalShortcutWin()
 ^~~~~~~~~~~~~~~~~
GlobalShortcut_win.cpp: In member function 'virtual void GlobalShortcutWin::run()':
GlobalShortcut_win.cpp:85:85: warning: passing NULL to non-pointer argument 3 of 'LONG RegOpenKeyExA(HKEY, LPCSTR, DWORD, REGSAM, PHKEY)' [-Wconversion-null]
  if (RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", NULL, KEY_READ, &key) == ERROR_SUCCESS) {
                                                                                     ^
GlobalShortcut_win.cpp:88:85: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
    qWarning("GlobalShortcutWin: Found LowLevelHooksTimeout with value = 0x%x", value);
                                                                                     ^
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'LONG {aka long int}' [-Wformat=]
    qWarning("GlobalShortcutWin: Error looking up LowLevelHooksTimeout. (Error: 0x%x, Type: 0x%x, Value: 0x%x)", err, type, value);
                                                                                                                                 ^
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GlobalShortcut_win.cpp: In static member function 'static BOOL GlobalShortcutWin::EnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE, LPVOID)':
GlobalShortcut_win.cpp:378:28: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
            qPrintable(name));
                            ^
GlobalShortcut_win.cpp: In static member function 'static BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE, LPVOID)':
GlobalShortcut_win.cpp:463:29: warning: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'DWORD {aka long unsigned int}' [-Wformat=]
             pdidi->dwDevType);
                             ^
GlobalShortcut_win.cpp:529:51: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'DWORD {aka long unsigned int}' [-Wformat=]
            qPrintable(id->vguidproduct.toString()));
                                                   ^
@davidebeatrici davidebeatrici added the build label Feb 6, 2017
src/mumble/GlobalShortcut_win.cpp
} else if (err == ERROR_FILE_NOT_FOUND) {
qWarning("GlobalShortcutWin: No LowLevelHooksTimeout registry key found.");
} else {
- qWarning("GlobalShortcutWin: Error looking up LowLevelHooksTimeout. (Error: 0x%x, Type: 0x%x, Value: 0x%x)", err, type, value);
+ qWarning("GlobalShortcutWin: Error looking up LowLevelHooksTimeout. (Error: 0x%li, Type: 0x%lx, Value: 0x%lx)", err, static_cast<unsigned long>(type), static_cast<unsigned long>(value));
@mkrautz
mkrautz Feb 6, 2017 Member

First one is still %li instead of %lx.

@davidebeatrici davidebeatrici GlobalShortcut_win.cpp: Fix MinGW compilation warnings
GlobalShortcut_win.h: In constructor 'GlobalShortcutWin::GlobalShortcutWin()':
GlobalShortcut_win.h:77:7: warning: 'GlobalShortcutWin::nxboxinput' will be initialized after [-Wreorder]
   int nxboxinput;
       ^~~~~~~~~~
GlobalShortcut_win.h:61:16: warning:   'unsigned int GlobalShortcutWin::uiHardwareDevices' [-Wreorder]
   unsigned int uiHardwareDevices;
                ^~~~~~~~~~~~~~~~~
GlobalShortcut_win.cpp:44:1: warning:   when initialized here [-Wreorder]
 GlobalShortcutWin::GlobalShortcutWin()
 ^~~~~~~~~~~~~~~~~
GlobalShortcut_win.cpp: In member function 'virtual void GlobalShortcutWin::run()':
GlobalShortcut_win.cpp:85:85: warning: passing NULL to non-pointer argument 3 of 'LONG RegOpenKeyExA(HKEY, LPCSTR, DWORD, REGSAM, PHKEY)' [-Wconversion-null]
  if (RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", NULL, KEY_READ, &key) == ERROR_SUCCESS) {
                                                                                     ^
GlobalShortcut_win.cpp:88:85: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
    qWarning("GlobalShortcutWin: Found LowLevelHooksTimeout with value = 0x%x", value);
                                                                                     ^
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'LONG {aka long int}' [-Wformat=]
    qWarning("GlobalShortcutWin: Error looking up LowLevelHooksTimeout. (Error: 0x%x, Type: 0x%x, Value: 0x%x)", err, type, value);
                                                                                                                                 ^
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GlobalShortcut_win.cpp:92:129: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
GlobalShortcut_win.cpp: In static member function 'static BOOL GlobalShortcutWin::EnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE, LPVOID)':
GlobalShortcut_win.cpp:378:28: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
            qPrintable(name));
                            ^
GlobalShortcut_win.cpp: In static member function 'static BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE, LPVOID)':
GlobalShortcut_win.cpp:463:29: warning: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'DWORD {aka long unsigned int}' [-Wformat=]
             pdidi->dwDevType);
                             ^
GlobalShortcut_win.cpp:529:51: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'DWORD {aka long unsigned int}' [-Wformat=]
            qPrintable(id->vguidproduct.toString()));
                                                   ^
7e72e77
@mkrautz
mkrautz approved these changes Feb 6, 2017 View changes
@mkrautz mkrautz merged commit 4400a80 into mumble-voip:master Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment