summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2022-01-21 14:13:20 +0100
committerKim Woelders <kim@woelders.dk>2022-01-21 16:32:19 +0100
commit838c391093d36b55a980e1171baa011da739c3d0 (patch)
tree86786131234c33f0b9c745b37b5324f7a514044e
parentdde8b3fcd10e388bcb7fb964d63c3e6f304866d8 (diff)
downloadimlib2-838c391093d36b55a980e1171baa011da739c3d0.tar.gz
image.c: Avoid potential compile error
gcc 11.2.1 with -pedantic: image.c: In function ‘__imlib_LoadImage’: image.c:567:9: error: a label can only be part of a statement and a declaration is not a statement [-Werror=pedantic] 567 | ImlibLoader ** loaders = __imlib_GetLoaderList(); clang 13.0.0: image.c:567:9: error: expected expression ImlibLoader ** loaders = __imlib_GetLoaderList(); ^ Also remove pointless self-assignment.
-rw-r--r--src/lib/image.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/image.c b/src/lib/image.c
index 1e01471..4944508 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -557,6 +557,8 @@ __imlib_LoadImage(const char *file, ImlibLoadArgs * ila)
switch (loader_ret)
{
+ ImlibLoader **loaders, *l, *previous_l;
+
case LOAD_BREAK: /* Break signaled by progress callback */
case LOAD_SUCCESS: /* Image loaded successfully */
/* Loader accepted image */
@@ -564,9 +566,7 @@ __imlib_LoadImage(const char *file, ImlibLoadArgs * ila)
break;
case LOAD_FAIL: /* Image was not recognized by loader */
- ImlibLoader ** loaders = __imlib_GetLoaderList();
- ImlibLoader *l, *previous_l;
-
+ loaders = __imlib_GetLoaderList();
errno = 0;
/* run through all loaders and try load until one succeeds */
for (l = *loaders, previous_l = NULL; l; previous_l = l, l = l->next)
@@ -704,7 +704,6 @@ __imlib_LoadProgressRows(ImlibImage * im, int row, int nrows)
{
/* Row index counting down */
nrtot = im->h - row;
- row = row;
nrows = nrtot - lc->row;
}