Skip to content
Permalink
Browse files

Merge PR #2823: GlobalShortcut_win.cpp: Fix MinGW compilation warnings

  • Loading branch information...
mkrautz committed Feb 6, 2017
2 parents 012429c + 7e72e77 commit 4400a807d0deb7e252f658639d2b55a3567c9e08
Showing with 11 additions and 11 deletions.
  1. +11 −11 src/mumble/GlobalShortcut_win.cpp
@@ -45,15 +45,15 @@ GlobalShortcutWin::GlobalShortcutWin()
: pDI(NULL)
, hhMouse(NULL)
, hhKeyboard(NULL)
, uiHardwareDevices(0)
#ifdef USE_GKEY
, gkey(NULL)
#endif
#ifdef USE_XBOXINPUT
, xboxinput(NULL)
, nxboxinput(0)
#endif
, uiHardwareDevices(0) {

{
// Hidden setting to disable hooking
bHook = g.qs->value(QLatin1String("winhooks"), true).toBool();

@@ -82,14 +82,14 @@ void GlobalShortcutWin::run() {
DWORD type = 0;
DWORD value = 0;
DWORD len = sizeof(DWORD);
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", NULL, KEY_READ, &key) == ERROR_SUCCESS) {
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ, &key) == ERROR_SUCCESS) {
LONG err = RegQueryValueExA(key, "LowLevelHooksTimeout", NULL, &type, reinterpret_cast<LPBYTE>(&value), &len);
if (err == ERROR_SUCCESS && type == REG_DWORD) {
qWarning("GlobalShortcutWin: Found LowLevelHooksTimeout with value = 0x%x", value);
qWarning("GlobalShortcutWin: Found LowLevelHooksTimeout with value = 0x%lx", static_cast<unsigned long>(value));
} 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%lx, Type: 0x%lx, Value: 0x%lx)", static_cast<unsigned long>(err), static_cast<unsigned long>(type), static_cast<unsigned long>(value));
}
}

@@ -371,10 +371,10 @@ BOOL CALLBACK GlobalShortcutWin::EnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINST
id->qhNames[lpddoi->dwType] = name;

if (g.s.bDirectInputVerboseLogging) {
qWarning("GlobalShortcutWin: EnumObjects: device %s %s object 0x%.8x %s",
qWarning("GlobalShortcutWin: EnumObjects: device %s %s object 0x%.8lx %s",
qPrintable(QUuid(id->guid).toString()),
qPrintable(id->name),
lpddoi->dwType,
static_cast<unsigned long>(lpddoi->dwType),
qPrintable(name));
}

@@ -454,13 +454,13 @@ BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE pdidi, LPVOID pContext
// blacklist, we need a more structured aproach.
{
if (id->vendor_id == 0x262A) {
qWarning("GlobalShortcutWin: rejected blacklisted device %s (GUID: %s, PGUID: %s, VID: 0x%.4x, PID: 0x%.4x, TYPE: 0x%.8x)",
qWarning("GlobalShortcutWin: rejected blacklisted device %s (GUID: %s, PGUID: %s, VID: 0x%.4x, PID: 0x%.4x, TYPE: 0x%.8lx)",
qPrintable(id->name),
qPrintable(id->vguid.toString()),
qPrintable(id->vguidproduct.toString()),
id->vendor_id,
id->product_id,
pdidi->dwDevType);
static_cast<unsigned long>(pdidi->dwDevType));
delete id;
return DIENUM_CONTINUE;
}
@@ -520,12 +520,12 @@ BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE pdidi, LPVOID pContext
if (FAILED(hr = id->pDID->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)))
qFatal("GlobalShortcutWin: SetProperty: %lx", hr);

qWarning("Adding device %s %s %s:%d type 0x%.8x guid product %s",
qWarning("Adding device %s %s %s:%d type 0x%.8lx guid product %s",
qPrintable(QUuid(id->guid).toString()),
qPrintable(name),
qPrintable(sname),
id->qhNames.count(),
pdidi->dwDevType,
static_cast<unsigned long>(pdidi->dwDevType),
qPrintable(id->vguidproduct.toString()));

cbgsw->qhInputDevices[id->guid] = id;

0 comments on commit 4400a80

Please sign in to comment.
You can’t perform that action at this time.