[gdk-pixbuf/fix-pre-c99] io-bmp.c: Fix building on older compilers



commit 3756f7b4a1d8d0f53f52d09dd50288582c4a79b6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jun 24 19:33:12 2020 +0800

    io-bmp.c: Fix building on older compilers
    
    Avoid declaring variables in a for loop initialization so that the code
    continues to build on older compilers.

 gdk-pixbuf/io-bmp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c
index a68794b76..b2d2a4f16 100644
--- a/gdk-pixbuf/io-bmp.c
+++ b/gdk-pixbuf/io-bmp.c
@@ -625,10 +625,12 @@ static gboolean DecodeColormap (guchar *buff,
 static void
 find_bits (int n, int *lowest, int *n_set)
 {
+       unsigned int i;
+
        *lowest = 0;
        *n_set = 0;
 
-       for (unsigned int i = 31; n != 0; n <<= 1, i--)
+       for (i = 31; n != 0; n <<= 1, i--)
                if (n & ((unsigned int) 1 << 31)) {
                        *lowest = i;
                        (*n_set)++;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]