From d9c6ccd0ec9f266db9f118c1d8adeab9ec5300fa Mon Sep 17 00:00:00 2001 From: Vladimir Kocjancic Date: Sat, 14 Oct 2023 10:33:14 +0200 Subject: [PATCH] Fixed two warnings that prevented W4 and treat warnings as errors There were two warnings in this file that prevented code to build in VS 2022 with C++20 when W4 and treat warnings as errors were enabled. Apparently assignment in at the same time as comparison is a no no. --- olcPixelGameEngine.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/olcPixelGameEngine.h b/olcPixelGameEngine.h index 92dee603..1980cb7e 100644 --- a/olcPixelGameEngine.h +++ b/olcPixelGameEngine.h @@ -4257,11 +4257,12 @@ namespace olc PFD_MAIN_PLANE, 0, 0, 0, 0 }; - int pf = 0; - if (!(pf = ChoosePixelFormat(glDeviceContext, &pfd))) return olc::FAIL; + int pf = ChoosePixelFormat(glDeviceContext, &pfd); + if (!pf) return olc::FAIL; SetPixelFormat(glDeviceContext, pf, &pfd); - - if (!(glRenderContext = wglCreateContext(glDeviceContext))) return olc::FAIL; + + glRenderContext = wglCreateContext(glDeviceContext); + if (!glRenderContext) return olc::FAIL; wglMakeCurrent(glDeviceContext, glRenderContext); // Remove Frame cap @@ -6693,4 +6694,3 @@ namespace olc // O------------------------------------------------------------------------------O // | END OF OLC_PGE_APPLICATION | // O------------------------------------------------------------------------------O -