From 838c391093d36b55a980e1171baa011da739c3d0 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Fri, 21 Jan 2022 14:13:20 +0100 Subject: image.c: Avoid potential compile error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/lib/image.c | 7 +++---- 1 file 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; } -- cgit v1.2.1