From f9c5c0cfbce40c096a73a465e3ad2b1c4e230d60 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Thu, 12 Jan 2023 14:09:38 +0000 Subject: [PATCH] Silence sign-cpmpare warnings in pickit2.c --- src/pickit2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pickit2.c b/src/pickit2.c index ca8824f9..7014b069 100644 --- a/src/pickit2.c +++ b/src/pickit2.c @@ -199,7 +199,7 @@ static int pickit2_open(PROGRAMMER *pgm, const char *port) { strcpy(cbuf, pgm->desc); // Convert from wide chars and overlay over initial part of desc - for (int i = 0; i < sizeof wbuf/sizeof*wbuf && wbuf[i]; i++) + for(size_t i = 0; i < sizeof wbuf/sizeof*wbuf && wbuf[i]; i++) cbuf[i] = (char) wbuf[i]; // TODO what about little/big endian??? pgm->desc = cache_string(cbuf); } @@ -1058,7 +1058,7 @@ static int usb_read_interrupt(const PROGRAMMER *pgm, void *buff, int size, int t GetOverlappedResult(PDATA(pgm)->usb_handle, &ovr, &bytesRead, 0); - return bytesRead > 0 ? bytesRead : -1; + return bytesRead > 0? (int) bytesRead: -1; } // simple write with timeout @@ -1083,7 +1083,7 @@ static int usb_write_interrupt(const PROGRAMMER *pgm, const void *buff, int size GetOverlappedResult(PDATA(pgm)->usb_handle, &ovr, &bytesWritten, 0); - return bytesWritten > 0 ? bytesWritten : -1; + return bytesWritten > 0? (int) bytesWritten: -1; } static int pickit2_write_report(const PROGRAMMER *pgm, const unsigned char report[65]) {