From b75e26bf6d9520a6285e06ab26df6722c70a0682 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Wed, 11 Jan 2023 23:48:04 +0000 Subject: [PATCH] Silence sign-compare warnings in flip1.c --- src/flip1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flip1.c b/src/flip1.c index 2a85ccaa..99193461 100644 --- a/src/flip1.c +++ b/src/flip1.c @@ -374,7 +374,7 @@ int flip1_read_byte(const PROGRAMMER *pgm, const AVRPART *part, const AVRMEM *me if (strcmp(mem->desc, "signature") == 0) { if (flip1_read_sig_bytes(pgm, part, mem) < 0) return -1; - if (addr >= mem->size) { + if (addr >= (unsigned long) mem->size) { pmsg_error("signature address %lu out of range [0, %d]\n", addr, mem->size-1); return -1; } @@ -461,7 +461,7 @@ int flip1_paged_write(const PROGRAMMER *pgm, const AVRPART *part, const AVRMEM * result = flip1_write_memory(FLIP1(pgm)->dfu, mem_unit, addr, mem->buf + addr, n_bytes); - return (result == 0) ? n_bytes : -1; + return result == 0? (int) n_bytes: -1; } int flip1_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *part, const AVRMEM *mem) { @@ -470,7 +470,7 @@ int flip1_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *part, const AVRME if (FLIP1(pgm)->dfu == NULL) return -1; - if (mem->size < sizeof(FLIP1(pgm)->part_sig)) { + if (mem->size < (int) sizeof(FLIP1(pgm)->part_sig)) { pmsg_error("signature read must be at least %u bytes\n", (unsigned int) sizeof(FLIP1(pgm)->part_sig)); return -1; }