summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2022-01-03 10:56:03 +0100
committerKim Woelders <kim@woelders.dk>2022-01-03 17:29:06 +0100
commit7d60151ba9696ef07be79af68d5c631a97c63906 (patch)
treefee563d76f8b4b274b2d55e4c2947086cea2b572
parent31d6d8532c40530631b9a587174094728ea3be35 (diff)
downloadimlib2-7d60151ba9696ef07be79af68d5c631a97c63906.tar.gz
ICO loader: Fix compilation on big endian architectures
Commit ff79901a071a76ec73cc98c7ff15102c514afb7b refactors the ico_read_idir function and removed the local nr variable. Unfortunately, this variable is still used within an `#ifdef WORDS_BIGENDIAN` block on big endian architectures as a for loop index variable. As such, the code does presently not compile since the aforementioned commit. This patch fixes this issue by re-introducing the variable conditionally on big endian architectures. Note: It would likely be cleaner to declare the nr variable as part of the loop declaration, however, this C99 feature does not seem to be used anywhere in the code base, hence I refrained from using it here.
-rw-r--r--src/modules/loaders/loader_ico.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/loaders/loader_ico.c b/src/modules/loaders/loader_ico.c
index e8cef41..66c3643 100644
--- a/src/modules/loaders/loader_ico.c
+++ b/src/modules/loaders/loader_ico.c
@@ -139,6 +139,9 @@ ico_read_icon(ico_t * ico, int ino)
{
ie_t *ie;
unsigned int size;
+#ifdef WORDS_BIGENDIAN
+ unsigned int nr;
+#endif
ie = &ico->ie[ino];