From 8cd3cf04e7fdc27cfa3ba21634e7ff8ec178d7f6 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 8 Apr 2018 12:53:41 +0300 Subject: [PATCH] Fixed a few compilation warnings src/gl/renderer/gl_renderer.cpp:775:39: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare] src/gl/renderer/gl_renderer.cpp:776:39: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare] src/gl/renderer/gl_renderer.cpp:777:39: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare] src/gl/renderer/gl_renderer.cpp:778:45: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare] src/gl/renderer/gl_renderer.cpp:779:40: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare] src/gl/renderer/gl_renderer.cpp:780:45: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare] src/v_draw.cpp:1144:51: warning: '&' within '|' [-Wbitwise-op-parentheses] src/textures/texture.cpp:1050:20: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] src\intermission\intermission.cpp(80): warning C4101: 'lumpnum': unreferenced local variable --- src/gl/renderer/gl_renderer.cpp | 12 ++++++------ src/intermission/intermission.cpp | 2 -- src/textures/texture.cpp | 2 +- src/v_draw.cpp | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index 0a744d4f0..731b6daac 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -778,12 +778,12 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer) gl_RenderState.BlendFunc(sb, db); // Rather than adding remapping code, let's enforce that the constants here are equal. - static_assert(F2DDrawer::DTM_Normal == TM_MODULATE, "DTM_Normal != TM_MODULATE"); - static_assert(F2DDrawer::DTM_Opaque == TM_OPAQUE, "DTM_Opaque != TM_OPAQUE"); - static_assert(F2DDrawer::DTM_Invert == TM_INVERSE, "DTM_Invert != TM_INVERSE"); - static_assert(F2DDrawer::DTM_InvertOpaque == TM_INVERTOPAQUE, "DTM_InvertOpaque != TM_INVERTOPAQUE"); - static_assert(F2DDrawer::DTM_Stencil == TM_MASK, "DTM_Stencil != TM_MASK"); - static_assert(F2DDrawer::DTM_AlphaTexture == TM_REDTOALPHA, "DTM_AlphaTexture != TM_REDTOALPHA"); + static_assert(int(F2DDrawer::DTM_Normal) == int(TM_MODULATE), "DTM_Normal != TM_MODULATE"); + static_assert(int(F2DDrawer::DTM_Opaque) == int(TM_OPAQUE), "DTM_Opaque != TM_OPAQUE"); + static_assert(int(F2DDrawer::DTM_Invert) == int(TM_INVERSE), "DTM_Invert != TM_INVERSE"); + static_assert(int(F2DDrawer::DTM_InvertOpaque) == int(TM_INVERTOPAQUE), "DTM_InvertOpaque != TM_INVERTOPAQUE"); + static_assert(int(F2DDrawer::DTM_Stencil) == int(TM_MASK), "DTM_Stencil != TM_MASK"); + static_assert(int(F2DDrawer::DTM_AlphaTexture) == int(TM_REDTOALPHA), "DTM_AlphaTexture != TM_REDTOALPHA"); gl_RenderState.SetTextureMode(cmd.mDrawMode); if (cmd.mFlags & F2DDrawer::DTF_Scissor) { diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 02fa5723a..25750a58e 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -77,8 +77,6 @@ CVAR(Bool, nointerscrollabort, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); void DIntermissionScreen::Init(FIntermissionAction *desc, bool first) { - int lumpnum; - if (desc->mCdTrack == 0 || !S_ChangeCDMusic (desc->mCdTrack, desc->mCdId)) { if (desc->mMusic.IsEmpty()) diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 2914b43c6..3fc7c9a5c 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -1047,7 +1047,7 @@ void FTexture::AddAutoMaterials() if (dot > slash) searchname.Truncate(dot); } - for (int i = 0; i < countof(autosearchpaths); i++) + for (size_t i = 0; i < countof(autosearchpaths); i++) { auto &layer = autosearchpaths[i]; if (this->*(layer.pointer) == nullptr) // only if no explicit assignment had been done. diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 477a20b05..f16f09d0d 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1141,7 +1141,7 @@ void DFrameBuffer::DoDim(PalEntry color, float amount, int x1, int y1, int w, in { amount = 1; } - m2DDrawer.AddColorOnlyQuad(x1, y1, w, h, color.d & 0xffffff | (int(amount * 255) << 24), style); + m2DDrawer.AddColorOnlyQuad(x1, y1, w, h, (color.d & 0xffffff) | (int(amount * 255) << 24), style); } void DFrameBuffer::Dim(PalEntry color, float damount, int x1, int y1, int w, int h, FRenderStyle *style)