Fix static analyzer message "Expression is always true"

V547 Expression '_isFloating == true' is always true. dockingcont.cpp 1080
V547 Expression 'itemSelected == 2' is always true. treeview.cpp 504
V560 A part of conditional expression is always true: 0xff. babygrid.cpp 711
This commit is contained in:
Oleksandr Redko 2017-10-29 17:54:58 +02:00
parent 8a01e5e29b
commit 9181f70d47
3 changed files with 11 additions and 14 deletions

View File

@ -1077,12 +1077,9 @@ void DockingCont::onSize()
else
{
// update floating size
if (_isFloating == true)
for (size_t iTb = 0, len = _vTbData.size(); iTb < len; ++iTb)
{
for (size_t iTb = 0, len = _vTbData.size(); iTb < len; ++iTb)
{
getWindowRect(_vTbData[iTb]->rcFloat);
}
getWindowRect(_vTbData[iTb]->rcFloat);
}
// draw caption

View File

@ -708,7 +708,7 @@ TCHAR GetASCII(WPARAM wParam, LPARAM lParam)
BYTE keys[256];
WORD dwReturnedValue;
GetKeyboardState(keys);
result = ToAscii(static_cast<UINT>(wParam), (lParam >> 16) && 0xff, keys, &dwReturnedValue, 0);
result = ToAscii(static_cast<UINT>(wParam), (lParam >> 16) & 0xff, keys, &dwReturnedValue, 0);
returnvalue = (TCHAR) dwReturnedValue;
if(returnvalue < 0){returnvalue = 0;}
wsprintf(mbuffer, TEXT("return value = %d"), returnvalue);

View File

@ -495,16 +495,16 @@ bool TreeView::swapTreeViewItem(HTREEITEM itemGoDown, HTREEITEM itemGoUp)
removeItem(itemGoDown);
// Restore the selection if needed
if (itemSelected != 0)
switch (itemSelected)
{
if (itemSelected == 1)
{
case 1:
selectItem(hTreeParent2ndInserted);
}
else if (itemSelected == 2)
{
break;
case 2:
selectItem(hTreeParent1stInserted);
}
break;
default:
break;
}
return true;
}