Skip to content

Commit

Permalink
Merge pull request #1800 from stefanrueger/silence-printf-warnings
Browse files Browse the repository at this point in the history
Silence compiler warnings
  • Loading branch information
stefanrueger authored May 17, 2024
2 parents 37ac6eb + e35cacf commit dc845ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/dfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ void dfu_show_info(struct dfu_dev *dfu)
msg_info(" USB Product : 0x%04hX\n",
(unsigned short) dfu->dev_desc.idProduct);

msg_info(" USB Release : %hu.%hu.%hu\n",
((unsigned short) dfu->dev_desc.bcdDevice >> 8) & 0xFF,
((unsigned short) dfu->dev_desc.bcdDevice >> 4) & 0xF,
((unsigned short) dfu->dev_desc.bcdDevice >> 0) & 0xF);
msg_info(" USB Release : %u.%u.%u\n",
(dfu->dev_desc.bcdDevice >> 8) & 0xFF,
(dfu->dev_desc.bcdDevice >> 4) & 0xF,
(dfu->dev_desc.bcdDevice >> 0) & 0xF);

if (dfu->serno_str != NULL)
msg_info(" USB Serial No : %s\n", dfu->serno_str);
Expand Down
10 changes: 5 additions & 5 deletions src/flip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ static void flip2_show_info(struct flip2 *flip2) {
(char) (flip2->part_rev / 26 - 1 + 'A'),
(char) (flip2->part_rev % 26 + 'A'));

msg_info(" Bootloader version : 2.%hu.%hu\n",
((unsigned short) flip2->boot_ver >> 4) & 0xF,
((unsigned short) flip2->boot_ver >> 0) & 0xF);
msg_info(" Bootloader version : 2.%u.%u\n",
(flip2->boot_ver >> 4) & 0xF,
(flip2->boot_ver >> 0) & 0xF);

msg_info(" USB max packet size : %hu\n",
(unsigned short) flip2->dfu->dev_desc.bMaxPacketSize0);
Expand Down Expand Up @@ -778,7 +778,7 @@ static int flip2_read_max1k(struct dfu_dev *dfu,
if (status.bStatus == ((FLIP2_STATUS_OUTOFRANGE >> 8) & 0xFF) &&
status.bState == ((FLIP2_STATUS_OUTOFRANGE >> 0) & 0xFF))
{
pmsg_error("address out of range [0x%04hX,0x%04hX]\n", offset, offset+size-1);
pmsg_error("address out of range [0x%04X,0x%04X]\n", offset, (offset+size-1) & 0xffff);
} else
pmsg_error("DFU status %s\n", flip2_status_str(&status));
dfu_clrstatus(dfu);
Expand Down Expand Up @@ -836,7 +836,7 @@ static int flip2_write_max1k(struct dfu_dev *dfu,
if (status.bStatus == ((FLIP2_STATUS_OUTOFRANGE >> 8) & 0xFF) &&
status.bState == ((FLIP2_STATUS_OUTOFRANGE >> 0) & 0xFF))
{
pmsg_error("address out of range [0x%04hX,0x%04hX]\n", offset, offset+size-1);
pmsg_error("address out of range [0x%04X,0x%04X]\n", offset, (offset+size-1) & 0xffff);
} else
pmsg_error("DFU status %s\n", flip2_status_str(&status));
dfu_clrstatus(dfu);
Expand Down
4 changes: 2 additions & 2 deletions src/updi_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int updi_physical_send(const PROGRAMMER *pgm, unsigned char *buf, size_t
size_t i;
int rv;

pmsg_debug("sending %lu bytes [", len);
pmsg_debug("sending %lu bytes [", (unsigned long) len);
for (i=0; i<len; i++) {
msg_debug("0x%02x", buf[i]);
if (i<len-1) {
Expand All @@ -114,7 +114,7 @@ static int updi_physical_recv(const PROGRAMMER *pgm, unsigned char *buf, size_t
return -1;
}

pmsg_debug("received %lu bytes [", len);
pmsg_debug("received %lu bytes [", (unsigned long) len);
for (i=0; i<len; i++) {
msg_debug("0x%02x", buf[i]);
if (i<len-1) {
Expand Down

0 comments on commit dc845ec

Please sign in to comment.