Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eeptools/eepdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
#include <endian.h>

#include "eeplib.h"

Expand Down
8 changes: 4 additions & 4 deletions eeptools/eeplib.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ bool eepio_end(void)
return eepio_error("ftell failed");
if (pos != pos_end)
eepio_warning("Dump finished before EOF");
if (pos != eep_header.eeplen)
if (pos != (long)eep_header.eeplen)
eepio_warning("Dump finished before length specified in header");
if (pos_end != eep_header.eeplen)
if (pos_end != (long)eep_header.eeplen)
eepio_warning("EOF does not match length specified in header");
if (pos_end != eep_header.eeplen)
if (pos_end != (long)eep_header.eeplen)
eepio_warning("%i bytes of file not processed");
}
return !eepio_got_error();
Expand Down Expand Up @@ -284,7 +284,7 @@ void eepio_atom_end(void)
if (eepio_dir == EEPIO_READ)
{
long pos = ftell(eepio_fp);
if (pos - eepio_atom_data_start != eep_atom_header.dlen)
if (pos - eepio_atom_data_start != (long)eep_atom_header.dlen)
eepio_warning("atom data length mismatch");
if (crc_actual != eep_atom_crc)
eepio_warning("atom CRC16 mismatch. Calculated CRC16=0x%02x", crc_actual);
Expand Down
3 changes: 2 additions & 1 deletion eeptools/eeplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <endian.h>

// minimal sizes of data structures
#define HEADER_SIZE 12
Expand All @@ -23,7 +24,7 @@
#define CRC16 0x8005

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

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