From cd276d94be13523c97054f3b7e4b438562ea9292 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 28 Jan 2019 20:50:26 +0000 Subject: [PATCH] Fix possible bug in CortBox2 Cppcheck was complaining about duplicate conditions --- src/Draw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Draw.cpp b/src/Draw.cpp index 27d6b6f0..40dbbe8e 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -375,8 +375,8 @@ void CortBox2(RECT *rect, uint32_t col, int surf_no) SDL_SetRenderTarget(gRenderer, surf[surf_no].texture); - const unsigned char col_red = col & 0xFF0000 >> 16; - const unsigned char col_green = col & 0x00FF00 >> 8; + const unsigned char col_red = (col & 0xFF0000) >> 16; + const unsigned char col_green = (col & 0x00FF00) >> 8; const unsigned char col_blue = col & 0x0000FF; const unsigned char col_alpha = (col_red || col_green || col_blue) ? 0xFF : 0;