From eb5208848701b7cc1b59febcee2551462450a4f0 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 13 Aug 2017 16:42:08 +0300 Subject: [PATCH] Fixed compilation warnings reported by Clang src/gl/scene/gl_sprite.cpp:685:34: warning: '&&' within '||' [-Wlogical-op-parentheses] src/polyrenderer/scene/poly_sprite.cpp:297:34: warning: '&&' within '||' [-Wlogical-op-parentheses] src/swrenderer/scene/r_opaque_pass.cpp:975:35: warning: '&&' within '||' [-Wlogical-op-parentheses] src/sound/mididevices/music_timiditypp_mididevice.cpp:548:30: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] --- src/gl/scene/gl_sprite.cpp | 4 ++-- src/polyrenderer/scene/poly_sprite.cpp | 2 +- src/sound/mididevices/music_timiditypp_mididevice.cpp | 2 +- src/swrenderer/scene/r_opaque_pass.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index acd1d6d5d1..f3b6983600 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -682,7 +682,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) // check renderrequired vs ~r_rendercaps, if anything matches we don't support that feature, // check renderhidden vs r_rendercaps, if anything matches we do support that feature and should hide it. - if (!r_debug_disable_vis_filter && (!!(thing->RenderRequired & ~r_renderercaps)) || + if ((!r_debug_disable_vis_filter && !!(thing->RenderRequired & ~r_renderercaps)) || (!!(thing->RenderHidden & r_renderercaps))) return; @@ -1298,4 +1298,4 @@ void GLSceneDrawer::RenderActorsInPortal(FGLLinePortal *glport) } } } -} \ No newline at end of file +} diff --git a/src/polyrenderer/scene/poly_sprite.cpp b/src/polyrenderer/scene/poly_sprite.cpp index 185f009a92..02667b19b9 100644 --- a/src/polyrenderer/scene/poly_sprite.cpp +++ b/src/polyrenderer/scene/poly_sprite.cpp @@ -294,7 +294,7 @@ bool RenderPolySprite::IsThingCulled(AActor *thing) // check renderrequired vs ~r_rendercaps, if anything matches we don't support that feature, // check renderhidden vs r_rendercaps, if anything matches we do support that feature and should hide it. - if (!r_debug_disable_vis_filter && (!!(thing->RenderRequired & ~r_renderercaps)) || + if ((!r_debug_disable_vis_filter && !!(thing->RenderRequired & ~r_renderercaps)) || (!!(thing->RenderHidden & r_renderercaps))) return true; diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index 254b840a04..934ceacbbd 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -545,7 +545,7 @@ bool TimidityPPMIDIDevice::LaunchTimidity () globfree(&glb); int strCount = 1; - for (spaceIdx = 0; spaceIdx < CommandLine.Len(); spaceIdx++) + for (spaceIdx = 0; spaceIdx < static_cast(CommandLine.Len()); spaceIdx++) { if (CommandLine[spaceIdx] == ' ') { diff --git a/src/swrenderer/scene/r_opaque_pass.cpp b/src/swrenderer/scene/r_opaque_pass.cpp index 5935b1ff4c..03467ce729 100644 --- a/src/swrenderer/scene/r_opaque_pass.cpp +++ b/src/swrenderer/scene/r_opaque_pass.cpp @@ -972,7 +972,7 @@ namespace swrenderer // check renderrequired vs ~r_rendercaps, if anything matches we don't support that feature, // check renderhidden vs r_rendercaps, if anything matches we do support that feature and should hide it. - if (!r_debug_disable_vis_filter && (!!(thing->RenderRequired & ~r_renderercaps)) || + if ((!r_debug_disable_vis_filter && !!(thing->RenderRequired & ~r_renderercaps)) || (!!(thing->RenderHidden & r_renderercaps))) return false;