diff --git a/drivers/at86rf215/at86rf215_netdev.c b/drivers/at86rf215/at86rf215_netdev.c index 58b1b02f95..5e0baf8754 100644 --- a/drivers/at86rf215/at86rf215_netdev.c +++ b/drivers/at86rf215/at86rf215_netdev.c @@ -158,8 +158,8 @@ static int _send(netdev_t *netdev, const iolist_t *iolist) /* current packet data + FCS too long */ if ((len + iol->iol_len + IEEE802154_FCS_LEN) > AT86RF215_MAX_PKT_LENGTH) { - DEBUG("[at86rf215] error: packet too large (%u byte) to be send\n", - (unsigned)len + IEEE802154_FCS_LEN); + DEBUG("[at86rf215] error: packet too large (%" PRIuSIZE + " byte) to be send\n", len + IEEE802154_FCS_LEN); at86rf215_tx_abort(dev); return -EOVERFLOW; } diff --git a/drivers/at86rf2xx/at86rf2xx_netdev.c b/drivers/at86rf2xx/at86rf2xx_netdev.c index 3767223cda..122f92eebf 100644 --- a/drivers/at86rf2xx/at86rf2xx_netdev.c +++ b/drivers/at86rf2xx/at86rf2xx_netdev.c @@ -30,6 +30,7 @@ #include #include +#include "architecture.h" #include "iolist.h" #include "net/eui64.h" @@ -216,8 +217,8 @@ static int _send(netdev_t *netdev, const iolist_t *iolist) for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) { /* current packet data + FCS too long */ if ((len + iol->iol_len + 2) > AT86RF2XX_MAX_PKT_LENGTH) { - DEBUG("[at86rf2xx] error: packet too large (%u byte) to be send\n", - (unsigned)len + 2); + DEBUG("[at86rf2xx] error: packet too large (%" PRIuSIZE + " byte) to be send\n", len + 2); return -EOVERFLOW; } if (iol->iol_len) { diff --git a/drivers/cc110x/cc110x_netdev.c b/drivers/cc110x/cc110x_netdev.c index 5d66fc856a..3c686fe92d 100644 --- a/drivers/cc110x/cc110x_netdev.c +++ b/drivers/cc110x/cc110x_netdev.c @@ -425,10 +425,9 @@ static int cc110x_send(netdev_t *netdev, const iolist_t *iolist) if (iol->iol_len) { if (size + iol->iol_len > CC110X_MAX_FRAME_SIZE) { cc110x_release(dev); - DEBUG("[cc110x] netdev_driver_t::send(): Frame size of %uB " - "exceeds maximum supported size of %uB\n", - (unsigned)(size + iol->iol_len), - (unsigned)CC110X_MAX_FRAME_SIZE); + DEBUG("[cc110x] netdev_driver_t::send(): Frame size of %" + PRIuSIZE "B exceeds maximum supported size of %uB\n", + size + iol->iol_len, (unsigned)CC110X_MAX_FRAME_SIZE); return -1; } memcpy(dev->buf.data + size, iol->iol_base, iol->iol_len); diff --git a/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c b/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c index 4a328978a2..f12149d447 100644 --- a/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c +++ b/drivers/cc1xxx_common/gnrc_netif_cc1xxx.c @@ -120,7 +120,7 @@ static int cc1xxx_adpt_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt) /* get the payload size and the dst address details */ size = gnrc_pkt_len(pkt->next); - DEBUG("[cc1xxx-gnrc] send: payload of packet is %i\n", (int)size); + DEBUG("[cc1xxx-gnrc] send: payload of packet is %" PRIuSIZE "\n", size); netif_hdr = (gnrc_netif_hdr_t *)pkt->data; l2hdr.src_addr = cc1xxx_dev->addr; diff --git a/drivers/cc2420/cc2420.c b/drivers/cc2420/cc2420.c index d190be3546..037d4c3d34 100644 --- a/drivers/cc2420/cc2420.c +++ b/drivers/cc2420/cc2420.c @@ -133,7 +133,7 @@ size_t cc2420_tx_prepare(cc2420_t *dev, const iolist_t *iolist) cc2420_fifo_write(dev, iol->iol_base, iol->iol_len); } } - DEBUG("cc2420: tx_prep: loaded %i byte into the TX FIFO\n", (int)pkt_len); + DEBUG("cc2420: tx_prep: loaded %" PRIuSIZE " byte into the TX FIFO\n", pkt_len); return pkt_len; } diff --git a/drivers/dose/dose.c b/drivers/dose/dose.c index b8ea8c0355..17a43dc6dd 100644 --- a/drivers/dose/dose.c +++ b/drivers/dose/dose.c @@ -443,7 +443,7 @@ static int _recv(netdev_t *dev, void *buf, size_t len, void *info) size_t dummy; if (crb_get_chunk_size(&ctx->rb, &dummy)) { - DEBUG("dose: %u byte pkt in rx queue\n", (unsigned)dummy); + DEBUG("dose: %" PRIuSIZE " byte pkt in rx queue\n", dummy); netdev_trigger_event_isr(&ctx->netdev); } diff --git a/drivers/enc28j60/enc28j60.c b/drivers/enc28j60/enc28j60.c index 22b626d1f7..17fb3f7503 100644 --- a/drivers/enc28j60/enc28j60.c +++ b/drivers/enc28j60/enc28j60.c @@ -330,8 +330,8 @@ static int nd_recv(netdev_t *netdev, void *buf, size_t max_len, void *info) next = (uint16_t)((head[1] << 8) | head[0]); size = (uint16_t)((head[3] << 8) | head[2]) - 4; /* discard CRC */ - DEBUG("[enc28j60] recv: size=%i next=%i buf=%p len=%d\n", - (int)size, (int)next, buf, max_len); + DEBUG("[enc28j60] recv: size=%u next=%u buf=%p len=%" PRIuSIZE "\n", + size, next, buf, max_len); if (buf != NULL) { /* read packet content into the supplied buffer */ diff --git a/drivers/kw41zrf/kw41zrf_netdev.c b/drivers/kw41zrf/kw41zrf_netdev.c index c8910b1bba..51a8e650f4 100644 --- a/drivers/kw41zrf/kw41zrf_netdev.c +++ b/drivers/kw41zrf/kw41zrf_netdev.c @@ -243,14 +243,14 @@ static int kw41zrf_netdev_send(netdev_t *netdev, const iolist_t *iolist) for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) { /* current packet data + FCS too long */ if ((len + iol->iol_len) > (KW41ZRF_MAX_PKT_LENGTH - IEEE802154_FCS_LEN)) { - LOG_ERROR("[kw41zrf] packet too large (%u byte) to fit\n", - (unsigned)len + IEEE802154_FCS_LEN); + LOG_ERROR("[kw41zrf] packet too large (%" PRIuSIZE " byte) to fit\n", + len + IEEE802154_FCS_LEN); return -EOVERFLOW; } len = kw41zrf_tx_load(iol->iol_base, iol->iol_len, len); } - DEBUG("[kw41zrf] TX %u bytes\n", len); + DEBUG("[kw41zrf] TX %" PRIuSIZE " bytes\n", len); /* * First octet in the TX buffer contains the frame length. diff --git a/drivers/lcd/lcd.c b/drivers/lcd/lcd.c index b6a89333f2..d520f3bb96 100644 --- a/drivers/lcd/lcd.c +++ b/drivers/lcd/lcd.c @@ -428,8 +428,8 @@ void lcd_pixmap(lcd_t *dev, uint16_t x1, uint16_t x2, size_t num_pix = (x2 - x1 + 1) * (y2 - y1 + 1); DEBUG("[lcd]: Write x1: %" PRIu16 ", x2: %" PRIu16 ", " - "y1: %" PRIu16 ", y2: %" PRIu16 ". Num pixels: %lu\n", - x1, x2, y1, y2, (unsigned long)num_pix); + "y1: %" PRIu16 ", y2: %" PRIu16 ". Num pixels: %" PRIuSIZE "\n", + x1, x2, y1, y2, num_pix); lcd_ll_acquire(dev); diff --git a/drivers/usbdev_mock/usbdev_mock.c b/drivers/usbdev_mock/usbdev_mock.c index 944cef9381..ea3751f2cc 100644 --- a/drivers/usbdev_mock/usbdev_mock.c +++ b/drivers/usbdev_mock/usbdev_mock.c @@ -17,6 +17,7 @@ #include #include +#include "architecture.h" #include "periph/usbdev.h" #include "test_utils/expect.h" #include "usbdev_mock.h" @@ -200,8 +201,8 @@ void _ep_esr(usbdev_ep_t *ep) int _xmit(usbdev_ep_t *ep, uint8_t *buf, size_t len) { - DEBUG("[mock]: Readying EP %u, dir %s, len %u\n", - ep->num, ep->dir == USB_EP_DIR_OUT ? "out" : "in", (unsigned)len); + DEBUG("[mock]: Readying EP %u, dir %s, len %" PRIuSIZE "\n", + ep->num, ep->dir == USB_EP_DIR_OUT ? "out" : "in", len); if (ep->num == 0) { usbdev_mock_t *usbdev_mock = _ep2dev(ep); usbdev_mock_ep_t *mock_ep = (usbdev_mock_ep_t *)ep; diff --git a/drivers/xbee/gnrc_xbee.c b/drivers/xbee/gnrc_xbee.c index 27a32f9aca..a0173e1529 100644 --- a/drivers/xbee/gnrc_xbee.c +++ b/drivers/xbee/gnrc_xbee.c @@ -111,7 +111,7 @@ static int xbee_adpt_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt) /* get the payload size and the dst address details */ size = gnrc_pkt_len(pkt->next); - DEBUG("[xbee-gnrc] send: payload of packet is %i\n", (int)size); + DEBUG("[xbee-gnrc] send: payload of packet is %" PRIuSIZE "\n", size); hdr = (gnrc_netif_hdr_t *)pkt->data; if (hdr->flags & BCAST) { uint16_t addr = 0xffff; diff --git a/drivers/xbee/xbee.c b/drivers/xbee/xbee.c index 7dcbb718d9..a71cdba7c5 100644 --- a/drivers/xbee/xbee.c +++ b/drivers/xbee/xbee.c @@ -673,7 +673,7 @@ static int xbee_send(netdev_t *dev, const iolist_t *iolist) } /* send the actual data packet */ - DEBUG("[xbee] send: now sending out %i byte\n", (int)size); + DEBUG("[xbee] send: now sending out %" PRIuSIZE " byte\n", size); mutex_lock(&(xbee->tx_lock)); for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) { if (iol->iol_len > 0) { @@ -705,16 +705,16 @@ static int xbee_recv(netdev_t *dev, void *buf, size_t len, void *info) size = (size_t)(xbee->rx_limit - 1); if (buf == NULL) { if (len > 0) { - DEBUG("[xbee] recv: reading size and dropping: %u\n", (unsigned)size); + DEBUG("[xbee] recv: reading size and dropping: %" PRIuSIZE "\n", size); xbee->rx_count = 0; } else { - DEBUG("[xbee] recv: reading size without dropping: %u\n", (unsigned)size); + DEBUG("[xbee] recv: reading size without dropping: %" PRIuSIZE "\n", size); } } else { size = (size > len) ? len : size; - DEBUG("[xbee] recv: consuming packet: reading %u byte\n", (unsigned)size); + DEBUG("[xbee] recv: consuming packet: reading %" PRIuSIZE " byte\n", size); memcpy(buf, xbee->rx_buf, size); xbee->rx_count = 0; }