Fix some clang complaints

This commit is contained in:
Kim Woelders 2023-08-24 19:07:43 +02:00
parent 5300f19575
commit 74dae151cd
6 changed files with 20 additions and 15 deletions

View File

@ -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;

View File

@ -9,7 +9,7 @@
#include "span.h"
ImlibPoly *
__imlib_polygon_new()
__imlib_polygon_new(void)
{
ImlibPoly *poly;

View File

@ -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)
{
}

View File

@ -264,7 +264,7 @@ init(ImlibFilterInfo * info)
}
void
deinit()
deinit(void)
{
return;
}

View File

@ -245,7 +245,7 @@ init(ImlibFilterInfo * info)
}
void
deinit()
deinit(void)
{
return;
}

View File

@ -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;