Silence some compiler warnings

This commit is contained in:
Stefan Rueger 2022-11-16 02:32:32 +00:00
parent 2abb666bd2
commit a3eeedd176
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
3 changed files with 8 additions and 8 deletions

View File

@ -1152,9 +1152,9 @@ static void dev_pgm_raw(const PROGRAMMER *pgm) {
dev_raw_dump(dp.usbproduct, strlen(dp.usbproduct)+1, id, "usbprod", 0); dev_raw_dump(dp.usbproduct, strlen(dp.usbproduct)+1, id, "usbprod", 0);
// Zap all bytes beyond terminating nul of desc, type and port array // Zap all bytes beyond terminating nul of desc, type and port array
if((len = strlen(dp.type)+1) < sizeof dp.type) if((len = (int) strlen(dp.type)+1) < (int) sizeof dp.type)
memset(dp.type + len, 0, sizeof dp.type - len); memset(dp.type + len, 0, sizeof dp.type - len);
if((len = strlen(dp.port)+1) < sizeof dp.port) if((len = (int) strlen(dp.port)+1) < (int) sizeof dp.port)
memset(dp.port + len, 0, sizeof dp.port - len); memset(dp.port + len, 0, sizeof dp.port - len);
// Zap address values // Zap address values

View File

@ -185,7 +185,7 @@ static int chardump_line(char *buffer, unsigned char *p, int n, int pad) {
unsigned char b[128]; unsigned char b[128];
// Sanity check // Sanity check
n = n < 1? 1: n > sizeof b? sizeof b: n; n = n < 1? 1: n > (int) sizeof b? (int) sizeof b: n;
memcpy(b, p, n); memcpy(b, p, n);
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)

View File

@ -1569,7 +1569,7 @@ static int ur_readEF(const PROGRAMMER *pgm, const AVRPART *p, uint8_t *buf, uint
int classic = !(p->prog_modes & (PM_UPDI | PM_PDI | PM_aWire)); int classic = !(p->prog_modes & (PM_UPDI | PM_PDI | PM_aWire));
pmsg_debug("ur_readEF(%s, %s, %s, %p, 0x%06x, %d, %c)\n", pmsg_debug("ur_readEF(%s, %s, %s, %p, 0x%06x, %d, %c)\n",
pgm? ldata(lfirst(pgm->id)): "?", p->desc, mchr=='F'? "flash": "eeprom", buf, badd, len, mchr); (char *) ldata(lfirst(pgm->id)), p->desc, mchr=='F'? "flash": "eeprom", buf, badd, len, mchr);
if(mchr == 'F' && ur.urprotocol && !(ur.urfeatures & UB_READ_FLASH)) if(mchr == 'F' && ur.urprotocol && !(ur.urfeatures & UB_READ_FLASH))
Return("bootloader does not have flash read capability"); Return("bootloader does not have flash read capability");
@ -2098,8 +2098,8 @@ static int urclock_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVR
} }
int urclock_write_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int urclock_write_byte(const PROGRAMMER *pgm_uu, const AVRPART *p_uu, const AVRMEM *mem,
unsigned long addr, unsigned char data) { unsigned long addr_uu, unsigned char data_uu) {
pmsg_error("bootloader does not implement byte-wise write to %s \n", mem->desc); pmsg_error("bootloader does not implement byte-wise write to %s \n", mem->desc);
return -1; return -1;
@ -2155,7 +2155,7 @@ static void urclock_display(const PROGRAMMER *pgm, const char *p_unused) {
// Return whether an address is write protected // Return whether an address is write protected
static int urclock_readonly(const struct programmer_t *pgm, const AVRPART *p, static int urclock_readonly(const struct programmer_t *pgm, const AVRPART *p_unused,
const AVRMEM *mem, unsigned int addr) { const AVRMEM *mem, unsigned int addr) {
if(avr_mem_is_flash_type(mem)) { if(avr_mem_is_flash_type(mem)) {
@ -2268,7 +2268,7 @@ static int urclock_parseextparms(const PROGRAMMER *pgm, LISTID extparms) {
msg_error("%s -c %s extended options:\n", progname, (char *) ldata(lfirst(pgm->id))); msg_error("%s -c %s extended options:\n", progname, (char *) ldata(lfirst(pgm->id)));
for(size_t i=0; i<sizeof options/sizeof*options; i++) { for(size_t i=0; i<sizeof options/sizeof*options; i++) {
msg_error(" -x%s%s%*s%s\n", options[i].name, options[i].assign? "=<arg>": "", msg_error(" -x%s%s%*s%s\n", options[i].name, options[i].assign? "=<arg>": "",
urmax(0, 16-(long) strlen(options[i].name)-(options[i].assign? 6: 0)), "", options[i].help); urmax(0, 16-(int) strlen(options[i].name)-(options[i].assign? 6: 0)), "", options[i].help);
} }
if(rc == 0) if(rc == 0)
exit(0); exit(0);