Skip to content

Commit 32602f5

Browse files
committed
eeptools: Fix compiler warnings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent 193e6e3 commit 32602f5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

eeptools/eepdump.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <ctype.h>
44
#include <string.h>
55
#include <stdbool.h>
6-
#include <endian.h>
76

87
#include "eeplib.h"
98

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

eeptools/eeplib.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <stdbool.h>
66
#include <stdint.h>
77
#include <stdio.h>
8+
#include <endian.h>
89

910
// minimal sizes of data structures
1011
#define HEADER_SIZE 12
@@ -23,7 +24,7 @@
2324
#define CRC16 0x8005
2425

2526
// Signature is "R-Pi" in ASCII. It is required to reversed (little endian) on disk.
26-
#define HEADER_SIGN be32toh((((char)'R' << 24) | ((char)'-' << 16) | ((char)'P' << 8) | ((char)'i')))
27+
#define HEADER_SIGN (uint32_t)be32toh((((char)'R' << 24) | ((char)'-' << 16) | ((char)'P' << 8) | ((char)'i')))
2728

2829
#define count_of(x) ((sizeof(x) / sizeof(x[0])))
2930
#define max(x, y) ((x) > (y) ? (x) : (y))

0 commit comments

Comments
 (0)