Fix PVS Studio reported errors (Closes: #425)

pull/432/head
Hleb Valoshka 2019-10-04 20:59:58 +03:00
parent 50a3a8424c
commit 277d9ce678
5 changed files with 6 additions and 9 deletions

View File

@ -10547,7 +10547,7 @@ void Renderer::renderAnnotations(const vector<Annotation>& annotations, FontStyl
#endif
switch (annotations[i].valign)
{
case AlignCenter:
case VerticalAlignCenter:
vOffset = -font[fs]->getHeight() / 2;
break;
case VerticalAlignTop:

View File

@ -623,9 +623,6 @@ static LRESULT
DatePickerCreate(HWND hwnd, CREATESTRUCT& cs)
{
DatePicker* dp = new DatePicker(hwnd, cs);
if (dp == NULL)
return -1;
SetWindowLongPtr(hwnd, 0, reinterpret_cast<DWORD_PTR>(dp));
return 0;

View File

@ -2207,7 +2207,7 @@ static void BuildScriptsMenu(HMENU menuBar, const string& scriptsDir)
}
MENUITEMINFO info;
memset(&info, sizeof(info), 0);
memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info);
info.fMask = MIIM_SUBMENU;
@ -2965,7 +2965,7 @@ static char* skipSpace(char* s)
static char* skipUntilQuote(char* s)
{
while (*s != '"' && s != '\0')
while (*s != '"' && *s != '\0')
s++;
return s;
}

View File

@ -294,14 +294,14 @@ bool operator<(const Mesh::VertexDescription& a,
if (a.nAttributes < b.nAttributes)
return true;
else if (b.nAttributes < b.nAttributes)
if (b.nAttributes < a.nAttributes)
return false;
for (uint32 i = 0; i < a.nAttributes; i++)
{
if (a.attributes[i] < b.attributes[i])
return true;
else if (b.attributes[i] < a.attributes[i])
if (b.attributes[i] < a.attributes[i])
return false;
}

View File

@ -119,7 +119,7 @@ bool WriteCrossIndex(istream& in, ostream& out)
int main(int argc, char* argv[])
{
if (!parseCommandLine(argc, argv) || inputFilename.empty())
if (!parseCommandLine(argc, argv)/* || inputFilename.empty()*/)
{
Usage();
return 1;