Skip to content

Commit ab34731

Browse files
committed
eeptools: Add casts to avoid compiler complaints
debian package results in: /<<PKGBUILDDIR>>/eeptools/eeplib.c: In function ‘eepio_end’: /<<PKGBUILDDIR>>/eeptools/eeplib.c:237:25: error: comparison of integer expressions of different signedness: ‘long int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 237 | if (pos != eep_header.eeplen) | ^~ /<<PKGBUILDDIR>>/eeptools/eeplib.c:239:29: error: comparison of integer expressions of different signedness: ‘long int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 239 | if (pos_end != eep_header.eeplen) | ^~ /<<PKGBUILDDIR>>/eeptools/eeplib.c:241:29: error: comparison of integer expressions of different signedness: ‘long int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 241 | if (pos_end != eep_header.eeplen) | ^~ /<<PKGBUILDDIR>>/eeptools/eeplib.c: In function ‘eepio_atom_end’: /<<PKGBUILDDIR>>/eeptools/eeplib.c:287:49: error: comparison of integer expressions of different signedness: ‘long int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 287 | if (pos - eepio_atom_data_start != eep_atom_header.dlen) | ^~ cc1: all warnings being treated as errors make[3]: *** [eeptools/CMakeFiles/eepmake.dir/build.make:93: eeptools/CMakeFiles/eepmake.dir/eeplib.c.o] Error 1 You can see these warnings with "gcc -O2 -Wall"
1 parent 193e6e3 commit ab34731

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

eeptools/eeplib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ bool eepio_end(void)
234234
return eepio_error("ftell failed");
235235
if (pos != pos_end)
236236
eepio_warning("Dump finished before EOF");
237-
if (pos != eep_header.eeplen)
237+
if (pos != (long)eep_header.eeplen)
238238
eepio_warning("Dump finished before length specified in header");
239-
if (pos_end != eep_header.eeplen)
239+
if (pos_end != (long)eep_header.eeplen)
240240
eepio_warning("EOF does not match length specified in header");
241-
if (pos_end != eep_header.eeplen)
241+
if (pos_end != (long)eep_header.eeplen)
242242
eepio_warning("%i bytes of file not processed");
243243
}
244244
return !eepio_got_error();
@@ -284,7 +284,7 @@ void eepio_atom_end(void)
284284
if (eepio_dir == EEPIO_READ)
285285
{
286286
long pos = ftell(eepio_fp);
287-
if (pos - eepio_atom_data_start != eep_atom_header.dlen)
287+
if (pos - eepio_atom_data_start != (long)eep_atom_header.dlen)
288288
eepio_warning("atom data length mismatch");
289289
if (crc_actual != eep_atom_crc)
290290
eepio_warning("atom CRC16 mismatch. Calculated CRC16=0x%02x", crc_actual);

0 commit comments

Comments
 (0)