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
-1
View File
@@ -2634,7 +2634,6 @@ void EditorViewportWidget::ShowCursor()
//////////////////////////////////////////////////////////////////////////
void EditorViewportWidget::PushDisableRendering()
{
assert(m_disableRenderingCount >= 0);
++m_disableRenderingCount;
}
+2 -2
View File
@@ -2038,7 +2038,7 @@ bool CBaseObject::HitHelperAtTest(HitContext& hc, const Vec3& pos)
//////////////////////////////////////////////////////////////////////////
CBaseObject* CBaseObject::GetChild(size_t const i) const
{
assert(i >= 0 && i < m_childs.size());
assert(i < m_childs.size());
return m_childs[i];
}
@@ -2729,7 +2729,7 @@ void CBaseObject::SetMinSpec(uint32 nSpec, bool bSetChildren)
// Set min spec for all childs.
if (bSetChildren)
{
for (size_t i = m_childs.size() - 1; i >= 0; --i)
for (int i = static_cast<int>(m_childs.size()) - 1; i >= 0; --i)
{
m_childs[i]->SetMinSpec(nSpec, true);
}
+1 -1
View File
@@ -1413,7 +1413,7 @@ void CEntityObject::PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx
void CEntityObject::ResolveEventTarget(CBaseObject* object, unsigned int index)
{
// Find target id.
assert(index >= 0 && index < m_eventTargets.size());
assert(index < m_eventTargets.size());
if (object)
{
object->AddEventListener(this);
+1 -1
View File
@@ -49,7 +49,7 @@ public:
}
void Undo(bool bUndo) override
{
for (size_t i = m_undoSteps.size() - 1; i >= 0; i--)
for (int i = static_cast<int>(m_undoSteps.size()) - 1; i >= 0; i--)
{
m_undoSteps[i]->Undo(bUndo);
}
+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++;
}
}
}
+1 -1
View File
@@ -467,7 +467,7 @@ bool CKDTree::FindNearestVertexRecursively(KDTreeNode* pNode, const Vec3& raySrc
uint32 nVertexIndex = pNode->GetVertexIndex(i);
uint32 nObjIndex = pNode->GetObjIndex(i);
assert(nObjIndex < m_StatObjectList.size() && nObjIndex >= 0);
assert(nObjIndex < m_StatObjectList.size());
const SStatObj* pStatObjInfo = &(m_StatObjectList[nObjIndex]);
+2
View File
@@ -769,7 +769,9 @@ namespace
void PySetViewPaneLayout(unsigned int layoutId)
{
AZ_PUSH_DISABLE_WARNING(4296, "-Wunknown-warning-option")
if ((layoutId >= ET_Layout0) && (layoutId <= ET_Layout8))
AZ_POP_DISABLE_WARNING
{
CLayoutWnd* layout = GetIEditor()->GetViewManager()->GetLayout();
if (layout)