File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 33#include <ctype.h>
44#include <string.h>
55#include <stdbool.h>
6- #include <endian.h>
76
87#include "eeplib.h"
98
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff line change 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
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))
You can’t perform that action at this time.
0 commit comments