This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository legacy-imlib2.
View the commit online.
commit 74dae151cd02c95d35fbd9ca8a20f21ec1c9cdec
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Thu Aug 24 19:07:43 2023 +0200
Fix some clang complaints
---
src/bin/imlib2_load.c | 8 ++++----
src/lib/draw_polygon.c | 2 +-
src/lib/dynamic_filters.c | 4 ++--
src/modules/filters/filter_bumpmap.c | 2 +-
src/modules/filters/filter_colormod.c | 2 +-
src/modules/loaders/loader_png.c | 17 +++++++++++------
6 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/bin/imlib2_load.c b/src/bin/imlib2_load.c
index 33dcbbf..1488734 100644
--- a/src/bin/imlib2_load.c
+++ b/src/bin/imlib2_load.c
@@ -91,14 +91,14 @@ image_load_mem(const char *file, int *perr)
else
ext = file;
- err = stat(file, &st);
- if (err)
- goto bail;
-
im = NULL;
fd = -1;
fdata = MAP_FAILED;
+ err = stat(file, &st);
+ if (err)
+ goto bail;
+
fd = open(file, O_RDONLY);
if (fd < 0)
goto bail;
diff --git a/src/lib/draw_polygon.c b/src/lib/draw_polygon.c
index bba0ede..b13703d 100644
--- a/src/lib/draw_polygon.c
+++ b/src/lib/draw_polygon.c
@@ -9,7 +9,7 @@
#include "span.h"
ImlibPoly *
-__imlib_polygon_new()
+__imlib_polygon_new(void)
{
ImlibPoly *poly;
diff --git a/src/lib/dynamic_filters.c b/src/lib/dynamic_filters.c
index 45be908..b58cf8e 100644
--- a/src/lib/dynamic_filters.c
+++ b/src/lib/dynamic_filters.c
@@ -75,7 +75,7 @@ __imlib_LoadFilter(char *file)
}
void
-__imlib_dynamic_filters_init()
+__imlib_dynamic_filters_init(void)
{
char **list;
int num_filters, i = 0;
@@ -116,7 +116,7 @@ __imlib_dynamic_filters_init()
}
void
-__imlib_dynamic_filters_deinit()
+__imlib_dynamic_filters_deinit(void)
{
}
diff --git a/src/modules/filters/filter_bumpmap.c b/src/modules/filters/filter_bumpmap.c
index 3ca87d4..2aaa144 100644
--- a/src/modules/filters/filter_bumpmap.c
+++ b/src/modules/filters/filter_bumpmap.c
@@ -264,7 +264,7 @@ init(ImlibFilterInfo * info)
}
void
-deinit()
+deinit(void)
{
return;
}
diff --git a/src/modules/filters/filter_colormod.c b/src/modules/filters/filter_colormod.c
index f166ba7..4c02595 100644
--- a/src/modules/filters/filter_colormod.c
+++ b/src/modules/filters/filter_colormod.c
@@ -245,7 +245,7 @@ init(ImlibFilterInfo * info)
}
void
-deinit()
+deinit(void)
{
return;
}
diff --git a/src/modules/loaders/loader_png.c b/src/modules/loaders/loader_png.c
index b8ad084..8506295 100644
--- a/src/modules/loaders/loader_png.c
+++ b/src/modules/loaders/loader_png.c
@@ -86,7 +86,7 @@ typedef struct __PACKED__ {
png_fctl_t fctl;
png_fdat_t fdat;
};
- uint32_t crc; // Misplaced - just indication
+// uint32_t crc; // Misplaced - just indication
} png_chunk_t;
typedef struct {
@@ -284,7 +284,6 @@ _load(ImlibImage * im, int load_data)
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
ctx_t ctx = { 0 };
- int ic;
unsigned char *fptr;
const png_chunk_t *chunk;
const png_fctl_t *pfctl;
@@ -339,13 +338,16 @@ _load(ImlibImage * im, int load_data)
fptr = (unsigned char *)im->fi->fdata;
fptr += _PNG_SIG_SIZE;
seen_actl = false;
+#ifdef IMLIB2_DEBUG
+ int ic = 0;
+#endif
- for (ic = 0;; ic++, fptr += 8 + len + 4)
+ for (;; fptr += 8 + len + 4)
{
chunk = PCAST(const png_chunk_t *, fptr);
len = htonl(chunk->hdr.len);
- D("Scan %3d: %06lx: %6d: %.4s: ", ic,
+ D("Scan %3d: %06lx: %6d: %.4s: ", ic++,
fptr - (unsigned char *)im->fi->fdata, len, chunk->hdr.name);
if (!mm_check(fptr + len))
break;
@@ -428,13 +430,16 @@ _load(ImlibImage * im, int load_data)
png_process_data(png_ptr, info_ptr, fptr, _PNG_SIG_SIZE);
fptr += _PNG_SIG_SIZE;
+#ifdef IMLIB2_DEBUG
+ ic = 0;
+#endif
- for (ic = 0;; ic++, fptr += 8 + len + 4)
+ for (;; fptr += 8 + len + 4)
{
chunk = PCAST(const png_chunk_t *, fptr);
len = htonl(chunk->hdr.len);
- D("Chunk %3d: %06lx: %6d: %.4s: ", ic,
+ D("Chunk %3d: %06lx: %6d: %.4s: ", ic++,
fptr - (unsigned char *)im->fi->fdata, len, chunk->hdr.name);
if (!mm_check(fptr + len))
break;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.