diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-06-24 19:33:12 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-06-24 19:33:12 +0800 |
commit | 3756f7b4a1d8d0f53f52d09dd50288582c4a79b6 (patch) | |
tree | c884366f6522bfd126429ae3e8967540fa85cf6a /gdk-pixbuf | |
parent | a82e78f2e815b6cc248b227ef5e00b294c81499e (diff) | |
download | gdk-pixbuf-3756f7b4a1d8d0f53f52d09dd50288582c4a79b6.tar.gz |
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.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/io-bmp.c | 4 |
1 files changed, 3 insertions, 1 deletions
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)++; |