x11-misc/rss-glx: Fix if statements partially guarding multistatement macro

Amazingly, this mess didn't cause serious problems; fixing anyway.

Signed-off-by: Alexander Miller <alex.miller@gmx.de>
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
This commit is contained in:
Alexander Miller
2024-05-09 16:18:22 +03:00
committed by Joonas Niilola
parent 67dc6a60f1
commit 3f7db6a36a
2 changed files with 30 additions and 0 deletions
@@ -0,0 +1,29 @@
Fix multistatement macro partially guarded by if
The code still works correctly by chance, but it performs redundant
calls to BZ2_bzBuffToBuffDecompress() and it's a horrible mess.
--- a/src/matrixview.c
+++ b/src/matrixview.c
@@ -248,8 +248,9 @@ void loadNextImage ()
GetExceptionInfo (&exception);
#endif
- if (!pics)
+ if (!pics) {
LOAD_TEXTURE (pics, cpics, cpics_compressedsize, cpics_size)
+ }
if ((text_x != 90) || (text_y != 70)) {
if (!pic)
@@ -279,8 +280,9 @@ void loadNextImage ()
DestroyImage (image);
DestroyImage (scaled_image);
} else {
- if (!pics)
+ if (!pics) {
LOAD_TEXTURE (pics, cpics, cpics_compressedsize, cpics_size)
+ }
pic = (unsigned char *)(pics + ((random () & 15) * (text_x * text_y)));
}
+1
View File
@@ -49,6 +49,7 @@ PATCHES=(
"${FILESDIR}"/${P}-bashism.patch
"${FILESDIR}"/${P}-strict-aliasing.patch
"${FILESDIR}"/${P}-variable-mismatch.patch
"${FILESDIR}"/${P}-macro-if-scope.patch
)
src_prepare() {