Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GlobalShortcut_win.cpp: Fix MinGW compilation warnings #2823

Conversation

@davidebeatrici
Copy link
Member

commented Feb 6, 2017

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

} 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));

This comment has been minimized.

Copy link
@mkrautz

mkrautz Feb 6, 2017

Member

First one is still %li instead of %lx.

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()));
                                                   ^

@davidebeatrici davidebeatrici force-pushed the davidebeatrici:GlobalShortcut_win.cpp_fix-warnings branch from 8d390bb to 7e72e77 Feb 6, 2017

@mkrautz
mkrautz approved these changes Feb 6, 2017

@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
Projects
None yet
2 participants
You can’t perform that action at this time.