From 651dfbc49fcb06cb63c7e23191972d86f16e856e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 4 Jan 2020 12:59:26 +0200 Subject: [PATCH] - fixed a few compilation warnings src/d_main.cpp:280:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] src/rendering/r_videoscale.cpp:147:22: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] src/sound/s_reverbedit.cpp:250:18: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] --- src/d_main.cpp | 2 +- src/rendering/r_videoscale.cpp | 2 +- src/sound/s_reverbedit.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 12ea85c47..91fde3cfa 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -277,7 +277,7 @@ void D_ToggleHud() static int saved_screenblocks; static bool saved_drawplayersprite, saved_showmessages; - if (hud_toggled = !hud_toggled) + if ((hud_toggled = !hud_toggled)) { saved_screenblocks = screenblocks; saved_drawplayersprite = r_drawplayersprites; diff --git a/src/rendering/r_videoscale.cpp b/src/rendering/r_videoscale.cpp index d86221ede..5a3f228a5 100644 --- a/src/rendering/r_videoscale.cpp +++ b/src/rendering/r_videoscale.cpp @@ -144,7 +144,7 @@ namespace }; bool isOutOfBounds(int x) { - return (x < 0 || x >= NUMSCALEMODES || vScaleTable[x].isValid == false); + return (x < 0 || x >= int(NUMSCALEMODES) || vScaleTable[x].isValid == false); } } diff --git a/src/sound/s_reverbedit.cpp b/src/sound/s_reverbedit.cpp index abbaceef1..7c41b10eb 100644 --- a/src/sound/s_reverbedit.cpp +++ b/src/sound/s_reverbedit.cpp @@ -236,7 +236,6 @@ void ExportEnvironments(const char *filename, uint32_t count, const ReverbContai { const ReverbContainer *env = envs[i]; const ReverbContainer *base; - size_t j; if ((unsigned int)env->Properties.Environment < 26) { @@ -247,7 +246,7 @@ void ExportEnvironments(const char *filename, uint32_t count, const ReverbContai base = nullptr; } f->Printf("\"%s\" %u %u\n{\n", env->Name, HIBYTE(env->ID), LOBYTE(env->ID)); - for (j = 0; j < NumReverbs; ++j) + for (int j = 0; j < NumReverbs; ++j) { const FReverbField *ctl = &ReverbFields[j]; const char *ctlName = ReverbFieldNames[j];