diff --git a/pkg/littlefs/fs/littlefs_fs.c b/pkg/littlefs/fs/littlefs_fs.c index 7f6840eb8e..6f23c90676 100644 --- a/pkg/littlefs/fs/littlefs_fs.c +++ b/pkg/littlefs/fs/littlefs_fs.c @@ -349,8 +349,8 @@ static ssize_t _write(vfs_file_t *filp, const void *src, size_t nbytes) mutex_lock(&fs->lock); - DEBUG("littlefs: write: filp=%p, fp=%p, src=%p, nbytes=%u\n", - (void *)filp, (void *)fp, (void *)src, (unsigned)nbytes); + DEBUG("littlefs: write: filp=%p, fp=%p, src=%p, nbytes=%" PRIuSIZE "\n", + (void *)filp, (void *)fp, (void *)src, nbytes); ssize_t ret = lfs_file_write(&fs->fs, fp, src, nbytes); mutex_unlock(&fs->lock); @@ -365,8 +365,8 @@ static ssize_t _read(vfs_file_t *filp, void *dest, size_t nbytes) mutex_lock(&fs->lock); - DEBUG("littlefs: read: filp=%p, fp=%p, dest=%p, nbytes=%u\n", - (void *)filp, (void *)fp, (void *)dest, (unsigned)nbytes); + DEBUG("littlefs: read: filp=%p, fp=%p, dest=%p, nbytes=%" PRIuSIZE "\n", + (void *)filp, (void *)fp, (void *)dest, nbytes); ssize_t ret = lfs_file_read(&fs->fs, fp, dest, nbytes); mutex_unlock(&fs->lock); diff --git a/pkg/littlefs2/fs/littlefs2_fs.c b/pkg/littlefs2/fs/littlefs2_fs.c index 6cd651b68e..d2968aa6f6 100644 --- a/pkg/littlefs2/fs/littlefs2_fs.c +++ b/pkg/littlefs2/fs/littlefs2_fs.c @@ -354,8 +354,8 @@ static ssize_t _write(vfs_file_t *filp, const void *src, size_t nbytes) mutex_lock(&fs->lock); - DEBUG("littlefs: write: filp=%p, fp=%p, src=%p, nbytes=%u\n", - (void *)filp, (void *)fp, (void *)src, (unsigned)nbytes); + DEBUG("littlefs: write: filp=%p, fp=%p, src=%p, nbytes=%" PRIuSIZE "\n", + (void *)filp, (void *)fp, (void *)src, nbytes); ssize_t ret = lfs_file_write(&fs->fs, fp, src, nbytes); mutex_unlock(&fs->lock); @@ -370,8 +370,8 @@ static ssize_t _read(vfs_file_t *filp, void *dest, size_t nbytes) mutex_lock(&fs->lock); - DEBUG("littlefs: read: filp=%p, fp=%p, dest=%p, nbytes=%u\n", - (void *)filp, (void *)fp, (void *)dest, (unsigned)nbytes); + DEBUG("littlefs: read: filp=%p, fp=%p, dest=%p, nbytes=%" PRIuSIZE "\n", + (void *)filp, (void *)fp, (void *)dest, nbytes); ssize_t ret = lfs_file_read(&fs->fs, fp, dest, nbytes); mutex_unlock(&fs->lock); diff --git a/pkg/tinydtls/contrib/sock_dtls.c b/pkg/tinydtls/contrib/sock_dtls.c index f5fdc0d6aa..960c30a430 100644 --- a/pkg/tinydtls/contrib/sock_dtls.c +++ b/pkg/tinydtls/contrib/sock_dtls.c @@ -118,7 +118,7 @@ static int _write(struct dtls_context_t *ctx, session_t *session, uint8_t *buf, ssize_t res = sock_udp_send(sock->udp_sock, buf, len, &remote); if (res < 0) { - DEBUG("sock_dtls: failed to send DTLS record: %d\n", (int)res); + DEBUG("sock_dtls: failed to send DTLS record: %" PRIdSIZE "\n", res); } return res; } @@ -793,7 +793,7 @@ ssize_t sock_dtls_recv_aux(sock_dtls_t *sock, sock_dtls_session_t *remote, res = sock_udp_recv_aux(sock->udp_sock, data, max_len, timeout, &ep, (sock_udp_aux_rx_t *)aux); if (res <= 0) { - DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res); + DEBUG("sock_dtls: error receiving UDP packet: %" PRIdSIZE "\n", res); return res; } @@ -858,7 +858,7 @@ ssize_t sock_dtls_recv_buf_aux(sock_dtls_t *sock, sock_dtls_session_t *remote, continue; } if (res < 0) { - DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res); + DEBUG("sock_dtls: error receiving UDP packet: %" PRIdSIZE "\n", res); return res; } @@ -974,7 +974,7 @@ void _udp_cb(sock_udp_t *udp_sock, sock_async_flags_t flags, void *ctx) ssize_t res = sock_udp_recv_buf(udp_sock, &data, &data_ctx, 0, &remote_ep); if (res <= 0) { - DEBUG("sock_dtls: error receiving UDP packet: %d\n", (int)res); + DEBUG("sock_dtls: error receiving UDP packet: %" PRIdSIZE "\n", res); return; } diff --git a/pkg/tinyvcdiff/contrib/tinyvcdiff_mtd/mtd.c b/pkg/tinyvcdiff/contrib/tinyvcdiff_mtd/mtd.c index 5ad45cdfdb..0623c66fd4 100644 --- a/pkg/tinyvcdiff/contrib/tinyvcdiff_mtd/mtd.c +++ b/pkg/tinyvcdiff/contrib/tinyvcdiff_mtd/mtd.c @@ -6,6 +6,7 @@ * directory for more details. */ +#include "architecture.h" #include "vcdiff_mtd.h" #include "assert.h" #include @@ -71,7 +72,7 @@ static int _align_write (vcdiff_mtd_t *mtd, uint8_t **src, size_t *len) mtd->offset += copy_len; *len -= copy_len; *src += copy_len; - DEBUG("_align_write: buffered %zuB for alignment\n", copy_len); + DEBUG("_align_write: buffered %" PRIuSIZE "B for alignment\n", copy_len); if (alignment_offset < CONFIG_TINYVCDIFF_MTD_WRITE_SIZE) { /* we haven't collected enough bytes, yet */ @@ -99,7 +100,7 @@ static int _write (void *dev, uint8_t *src, size_t offset, size_t len) assert(offset == mtd->offset); - DEBUG("_write: 0x%zx + %zuB\n", mtd->offset, len); + DEBUG("_write: 0x%" PRIxSIZE " + %" PRIuSIZE "B\n", mtd->offset, len); /* align writes */ rc = _align_write(dev, &src, &len); @@ -132,7 +133,7 @@ static int _write (void *dev, uint8_t *src, size_t offset, size_t len) /* copy remaining bytes into write_buffer */ memcpy(mtd->write_buffer, src, len); mtd->offset += len; - DEBUG("_write: buffered %zuB for alignment\n", len); + DEBUG("_write: buffered %" PRIuSIZE "B for alignment\n", len); return rc; } @@ -150,7 +151,7 @@ static int _flush (void *dev) return 0; } - DEBUG("_flush: write last %zuB\n", alignment_offset); + DEBUG("_flush: write last %" PRIuSIZE "B\n", alignment_offset); /* get present bytes from MTD to pad alignment */ rc = mtd_read_page(mtd->dev, buf, 0, mtd->offset - alignment_offset, diff --git a/pkg/tlsf/contrib/tlsf-malloc.c b/pkg/tlsf/contrib/tlsf-malloc.c index 4683065b3d..4bc65a8428 100644 --- a/pkg/tlsf/contrib/tlsf-malloc.c +++ b/pkg/tlsf/contrib/tlsf-malloc.c @@ -46,7 +46,8 @@ tlsf_t _tlsf_get_global_control(void) void tlsf_size_walker(void* ptr, size_t size, int used, void* user) { - printf("\t%p %s size: %u (%p)\n", ptr, used ? "used" : "free", (unsigned int)size, ptr); + printf("\t%p %s size: %" PRIuSIZE " (%p)\n", ptr, used ? "used" : "free", + size, ptr); if (used) { ((tlsf_size_container_t *)user)->used += (unsigned int)size; diff --git a/pkg/wakaama/contrib/lwm2m_client.c b/pkg/wakaama/contrib/lwm2m_client.c index be55aceff6..48a22260b7 100644 --- a/pkg/wakaama/contrib/lwm2m_client.c +++ b/pkg/wakaama/contrib/lwm2m_client.c @@ -182,7 +182,7 @@ static void *_lwm2m_client_run(void *arg) lwm2m_client_connection_t *conn = lwm2m_client_connection_find( _client_data->conn_list, &remote); if (conn) { - DEBUG("lwm2m_connection_handle_packet(%i)\n", (int)rcv_len); + DEBUG("lwm2m_connection_handle_packet(%" PRIiSIZE ")\n", rcv_len); int result = lwm2m_connection_handle_packet(conn, rcv_buf, rcv_len, _client_data); @@ -196,10 +196,10 @@ static void *_lwm2m_client_run(void *arg) } else if ((rcv_len < 0) && ((rcv_len != -EAGAIN) && (rcv_len != -ETIMEDOUT))) { - DEBUG("Unexpected sock_udp_recv error code %i\n", (int)rcv_len); + DEBUG("Unexpected sock_udp_recv error code %" PRIiSIZE "\n", rcv_len); } else { - DEBUG("UDP error code: %i\n", (int)rcv_len); + DEBUG("UDP error code: %" PRIiSIZE "\n", rcv_len); } } return NULL; diff --git a/pkg/wakaama/contrib/lwm2m_client_connection.c b/pkg/wakaama/contrib/lwm2m_client_connection.c index 613cd166c6..4090902f00 100644 --- a/pkg/wakaama/contrib/lwm2m_client_connection.c +++ b/pkg/wakaama/contrib/lwm2m_client_connection.c @@ -214,7 +214,7 @@ static int _connection_send(lwm2m_client_connection_t *conn, uint8_t *buffer, ssize_t sent_bytes = sock_udp_send(&(client_data->sock), buffer, buffer_size, &(conn->remote)); if (sent_bytes <= 0) { - DEBUG("[_connection_send] Could not send UDP packet: %i\n", (int)sent_bytes); + DEBUG("[_connection_send] Could not send UDP packet: %" PRIiSIZE "\n", sent_bytes); return -1; } conn->last_send = lwm2m_gettime(); diff --git a/pkg/wakaama/contrib/lwm2m_platform.c b/pkg/wakaama/contrib/lwm2m_platform.c index 7a48d4eae0..0097398be5 100644 --- a/pkg/wakaama/contrib/lwm2m_platform.c +++ b/pkg/wakaama/contrib/lwm2m_platform.c @@ -50,7 +50,7 @@ typedef struct { static void _tlsf_size_walker(void* ptr, size_t size, int used, void* user) { - printf("\t%p %s size: %u (%p)\n", ptr, used ? "used" : "free", (unsigned int)size, ptr); + printf("\t%p %s size: %" PRIuSIZE " (%p)\n", ptr, used ? "used" : "free", size, ptr); if (used) { ((_tlsf_size_container_t *)user)->used += (unsigned int)size;