From d5a20ad3c85ca09679fdc83feb3814785d1187cf Mon Sep 17 00:00:00 2001 From: Arisotura Date: Sun, 8 Aug 2021 15:45:44 +0200 Subject: tidbits --- src/frontend/qt_sdl/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 927d9ea..d8eca58 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -208,7 +208,7 @@ void micLoadWav(const char* name) for (int i = 0; i < micWavLength; i++) { - u16 val; + u16 val = 0; switch (SDL_AUDIO_BITSIZE(format.format)) { @@ -228,9 +228,9 @@ void micLoadWav(const char* name) { u32 rawval; if (SDL_AUDIO_ISBIGENDIAN(format.format)) - rawval = (buf[res_pos*4] << 24) | (buf[res_pos*4 + 1] << 16) | (buf[res_pos*4 + 2] << 8) | buf[res_pos * 4 + 3]; + rawval = (buf[res_pos*4] << 24) | (buf[res_pos*4 + 1] << 16) | (buf[res_pos*4 + 2] << 8) | buf[res_pos*4 + 3]; else - rawval = (buf[res_pos*4 + 3] << 24) | (buf[res_pos*4 + 2] << 16) | (buf[res_pos*4 + 1] << 8) | buf[res_pos * 4]; + rawval = (buf[res_pos*4 + 3] << 24) | (buf[res_pos*4 + 2] << 16) | (buf[res_pos*4 + 1] << 8) | buf[res_pos*4]; float fval = *(float*)&rawval; s32 ival = (s32)(fval * 0x8000); -- cgit v1.2.3