From 4c75260097135edb171501942e451474fce66c50 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sun, 12 Nov 2023 22:59:52 +0100 Subject: Fix misc 21 (#1573) * Make `sNew` in (unused) `code_800FC620.c` a string It is passed as a filename to `__osMallocDebug` so should be a nul-terminated string, not a char[3] missing an explicit \0 * Fix gcc warning in `JpegDecoder_ParseNextSymbol` about SLL on negative value -1U is an unsigned value, aka 0xFFFFFFFF I keep -1 because it seems that's what a jpeg standard has too References: https://stackoverflow.com/questions/40508958/shifting-a-negative-signed-value-is-undefined https://www.w3.org/Graphics/JPEG/itu-t81.pdf (page 105, figure F.12) * Small cleanup * Fix few mistakes (thanks gcc warnings) * Add `@bug` in file select settings draw code, using the wrong array * format * format main * rename arg for a happy formatter * Move important function call out of a printf --- src/code/jpegdecoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/code/jpegdecoder.c') diff --git a/src/code/jpegdecoder.c b/src/code/jpegdecoder.c index 3301817d0..c0c772abd 100644 --- a/src/code/jpegdecoder.c +++ b/src/code/jpegdecoder.c @@ -154,7 +154,7 @@ s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* out if (sym) { *outCoeff = JpegDecoder_ReadBits(sym); if (*outCoeff < (1 << (sym - 1))) { - *outCoeff += (-1 << sym) + 1; + *outCoeff += (-1U << sym) + 1; } } -- cgit v1.2.3