diff --git a/src/g_shared/sbarinfo_commands.cpp b/src/g_shared/sbarinfo_commands.cpp index a34983a3e..8c55206c3 100644 --- a/src/g_shared/sbarinfo_commands.cpp +++ b/src/g_shared/sbarinfo_commands.cpp @@ -361,7 +361,7 @@ class CommandDrawSwitchableImage : public CommandDrawImage } } // [BL] I have word that MSVC++ wants this static_cast ;) Shut up MSVC! - for(unsigned int i = 0;i < static_cast (conditionAnd ? 3 : 1);i++) + for(unsigned int i = 0;i < (conditionAnd ? 3u : 1u);i++) { sc.MustGetToken(','); sc.MustGetToken(TK_StringConst); diff --git a/src/menu/listmenu.cpp b/src/menu/listmenu.cpp index 89d1fd879..2f14ee5e1 100644 --- a/src/menu/listmenu.cpp +++ b/src/menu/listmenu.cpp @@ -218,7 +218,7 @@ bool DListMenu::MouseEvent(int type, int x, int y) { if (mDesc->mItems[i]->CheckCoordinate(x, y)) { - if (i != static_cast (mDesc->mSelectedItem)) + if ((int)i != mDesc->mSelectedItem) { //S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE); } @@ -258,7 +258,7 @@ void DListMenu::Drawer () { for(unsigned i=0;imItems.Size(); i++) { - if (mDesc->mItems[i]->mEnabled) mDesc->mItems[i]->Drawer(static_cast (mDesc->mSelectedItem) == i); + if (mDesc->mItems[i]->mEnabled) mDesc->mItems[i]->Drawer(mDesc->mSelectedItem == (int)i); } if (mDesc->mSelectedItem >= 0 && mDesc->mSelectedItem < (int)mDesc->mItems.Size()) mDesc->mItems[mDesc->mSelectedItem]->DrawSelector(mDesc->mSelectOfsX, mDesc->mSelectOfsY, mDesc->mSelector); diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 8a07976bf..d0ac38894 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -604,7 +604,7 @@ void DLoadSaveMenu::Drawer () { color = CR_ORANGE; } - else if (j == static_cast (Selected)) + else if ((int)j == Selected) { color = CR_WHITE; } @@ -612,7 +612,8 @@ void DLoadSaveMenu::Drawer () { color = CR_TAN; } - if (j == static_cast (Selected)) + + if ((int)j == Selected) { screen->Clear (listboxLeft, listboxTop+rowHeight*i, listboxRight, listboxTop+rowHeight*(i+1), -1, diff --git a/src/menu/optionmenu.cpp b/src/menu/optionmenu.cpp index 988e87e37..9d3213716 100644 --- a/src/menu/optionmenu.cpp +++ b/src/menu/optionmenu.cpp @@ -392,13 +392,14 @@ void DOptionMenu::Drawer () for (i = 0; i < mDesc->mItems.Size() && y <= lastrow; i++, y += fontheight) { // Don't scroll the uppermost items - if (i == static_cast (mDesc->mScrollTop)) + if ((int)i == mDesc->mScrollTop) { i += mDesc->mScrollPos; if (i >= mDesc->mItems.Size()) break; // skipped beyond end of menu } - int cur_indent = mDesc->mItems[i]->Draw(mDesc, y, indent, static_cast (mDesc->mSelectedItem) == i); - if (cur_indent >= 0 && static_cast (mDesc->mSelectedItem) == i && mDesc->mItems[i]->Selectable()) + bool isSelected = mDesc->mSelectedItem == (int)i; + int cur_indent = mDesc->mItems[i]->Draw(mDesc, y, indent, isSelected); + if (cur_indent >= 0 && isSelected && mDesc->mItems[i]->Selectable()) { if (((DMenu::MenuTime%8) < 6) || DMenu::CurrentMenu != this) { diff --git a/src/menu/playermenu.cpp b/src/menu/playermenu.cpp index 2bf6ae97f..e41d6094d 100644 --- a/src/menu/playermenu.cpp +++ b/src/menu/playermenu.cpp @@ -796,13 +796,13 @@ void DPlayerMenu::UpdateSkins() else { PlayerSkins.Clear(); - for(unsigned i=0;i<(unsigned)numskins; i++) + for(int i=0;i<(int)numskins; i++) { if (PlayerClass->CheckSkin(i)) { int j = PlayerSkins.Push(i); li->SetString(j, skins[i].name); - if (static_cast (players[consoleplayer].userinfo.skin) == i) + if (players[consoleplayer].userinfo.skin == i) { sel = j; } diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 772cdc3a7..3c631c4e9 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -929,7 +929,7 @@ public: void Drawer() { const char *speakerName; - int i, x, y, linesize; + int x, y, linesize; int width, fontheight; int labelofs; @@ -973,6 +973,7 @@ public: // Dim the screen behind the dialogue (but only if there is no backdrop). if (!CurNode->Backdrop.isValid()) { + int i; for (i = 0; mDialogueLines[i].Width >= 0; ++i) { } screen->Dim (0, 0.45f, 14 * screen->GetWidth() / 320, 13 * screen->GetHeight() / 200, @@ -995,7 +996,7 @@ public: y += linesize * 3 / 2; } x = 24 * screen->GetWidth() / 320; - for (i = 0; mDialogueLines[i].Width >= 0; ++i) + for (int i = 0; mDialogueLines[i].Width >= 0; ++i) { screen->DrawText (SmallFont, CR_UNTRANSLATED, x, y, mDialogueLines[i].Text, DTA_CleanNoMove, true, TAG_DONE); @@ -1024,14 +1025,14 @@ public: fontheight = OptionSettings.mLinespacing; int response = 0; - for (i = 0; i < (int)mResponseLines.Size(); i++, y += fontheight) + for (unsigned i = 0; i < mResponseLines.Size(); i++, y += fontheight) { width = SmallFont->StringWidth(mResponseLines[i]); x = 64; screen->DrawText (SmallFont, CR_GREEN, x, y, mResponseLines[i], DTA_Clean, true, TAG_DONE); - if (static_cast (i) == mResponses[response]) + if (i == mResponses[response]) { char tbuf[16]; diff --git a/src/p_spec.cpp b/src/p_spec.cpp index be2c4163d..d48ef90d6 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -256,7 +256,7 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType) // end of changed code if (developer && buttonSuccess) { - Printf ("Line special %d activated on line %i\n", special, static_cast (line - lines)); + Printf ("Line special %d activated on line %i\n", special, int(line - lines)); } return true; }