From 8771103abbfd04da9787dea760405364af0d82de Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 23 Feb 2021 20:25:30 +1100 Subject: [PATCH] [client] all: fix more `maybe-uninitialized` when `-O3` is in use Closes #475 --- client/renderers/EGL/egl.c | 3 ++- client/src/core.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index 315f9683..13495dda 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -335,7 +335,8 @@ static void egl_calc_mouse_size(struct Inst * this) if (!this->formatValid) return; - int w, h; + int w = 0, h = 0; + switch(this->format.rotate) { case LG_ROTATE_0: diff --git a/client/src/core.c b/client/src/core.c index c777684d..4fab406f 100644 --- a/client/src/core.c +++ b/client/src/core.c @@ -176,8 +176,9 @@ void core_updatePositionInfo(void) if (!g_state.haveSrcSize) goto done; - float srcW; - float srcH; + float srcW = 0.0f; + float srcH = 0.0f; + switch(g_params.winRotate) { case LG_ROTATE_0: