enable warning 4296: 'operator': expression is always false

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-19 16:16:28 -07:00
parent c1f236a70b
commit 62a0041245
39 changed files with 93 additions and 105 deletions
+17 -22
View File
@@ -60,34 +60,29 @@ bool C3DConnexionDriver::InitDevice()
{
UINT nchars = 300;
TCHAR deviceName[300];
if (GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICENAME, deviceName, &nchars) >= 0)
{
//_RPT3(_CRT_WARN, "Device[%d]: handle=0x%x name = %S\n", i, g_pRawInputDeviceList[i].hDevice, deviceName);
}
GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICENAME, deviceName, &nchars);
RID_DEVICE_INFO dinfo;
UINT sizeofdinfo = sizeof(dinfo);
dinfo.cbSize = sizeofdinfo;
if (GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICEINFO, &dinfo, &sizeofdinfo) >= 0)
GetRawInputDeviceInfo(m_pRawInputDeviceList[i].hDevice,
RIDI_DEVICEINFO, &dinfo, &sizeofdinfo);
if (dinfo.dwType == RIM_TYPEHID)
{
if (dinfo.dwType == RIM_TYPEHID)
RID_DEVICE_INFO_HID* phidInfo = &dinfo.hid;
// Add this one to the list of interesting devices?
// Actually only have to do this once to get input from all usage 1, usagePage 8 devices
// This just keeps out the other usages.
// You might want to put up a list for users to select amongst the different devices.
// In particular, to assign separate functionality to the different devices.
if (phidInfo->usUsagePage == 1 && phidInfo->usUsage == 8)
{
RID_DEVICE_INFO_HID* phidInfo = &dinfo.hid;
// Add this one to the list of interesting devices?
// Actually only have to do this once to get input from all usage 1, usagePage 8 devices
// This just keeps out the other usages.
// You might want to put up a list for users to select amongst the different devices.
// In particular, to assign separate functionality to the different devices.
if (phidInfo->usUsagePage == 1 && phidInfo->usUsage == 8)
{
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsagePage = phidInfo->usUsagePage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsage = phidInfo->usUsage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].dwFlags = 0;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].hwndTarget = nullptr;
m_nUsagePage1Usage8Devices++;
}
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsagePage = phidInfo->usUsagePage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].usUsage = phidInfo->usUsage;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].dwFlags = 0;
m_pRawInputDevices[m_nUsagePage1Usage8Devices].hwndTarget = nullptr;
m_nUsagePage1Usage8Devices++;
}
}
}