Skip to content

Commit 8e63260

Browse files
authored
Merge pull request #4551 from radarhere/warnings
Fixed comparison warnings
2 parents 713dd17 + 2283013 commit 8e63260

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/libImaging/Jpeg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ typedef struct {
110110

111111
int extra_offset;
112112

113-
int rawExifLen; /* EXIF data length */
113+
size_t rawExifLen; /* EXIF data length */
114114
char* rawExif; /* EXIF buffer pointer */
115115

116116
} JPEGENCODERSTATE;

src/libImaging/Jpeg2KEncode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static OPJ_SIZE_T
5050
j2k_write(void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
5151
{
5252
ImagingCodecState state = (ImagingCodecState)p_user_data;
53-
int result;
53+
unsigned int result;
5454

5555
result = _imaging_write_pyFd(state->fd, p_buffer, p_nb_bytes);
5656

@@ -399,8 +399,8 @@ j2k_encode_entry(Imaging im, ImagingCodecState state)
399399
Py_ssize_t n;
400400
float *pq;
401401

402-
if (len) {
403-
if (len > sizeof(params.tcp_rates) / sizeof(params.tcp_rates[0])) {
402+
if (len > 0) {
403+
if ((unsigned)len > sizeof(params.tcp_rates) / sizeof(params.tcp_rates[0])) {
404404
len = sizeof(params.tcp_rates)/sizeof(params.tcp_rates[0]);
405405
}
406406

src/libImaging/QuantPngQuant.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
int
2121
quantize_pngquant(
2222
Pixel *pixelData,
23-
int width,
24-
int height,
23+
unsigned int width,
24+
unsigned int height,
2525
uint32_t quantPixels,
2626
Pixel **palette,
2727
uint32_t *paletteLength,

src/libImaging/QuantPngQuant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "QuantTypes.h"
55

66
int quantize_pngquant(Pixel *,
7-
int,
8-
int,
7+
unsigned int,
8+
unsigned int,
99
uint32_t,
1010
Pixel **,
1111
uint32_t *,

0 commit comments

Comments
 (0)