From e017f8a5f19e8a88279ef78ae2e2abcd5749bd49 Mon Sep 17 00:00:00 2001 From: smlng Date: Mon, 15 Jan 2018 16:34:29 +0100 Subject: [PATCH 1/5] core: fix format errors in debug output --- core/sched.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/sched.c b/core/sched.c index b132a1a7e7..84151433d0 100644 --- a/core/sched.c +++ b/core/sched.c @@ -92,7 +92,7 @@ int __attribute__((used)) sched_run(void) thread_t *next_thread = container_of(sched_runqueues[nextrq].next->next, thread_t, rq_entry); DEBUG("sched_run: active thread: %" PRIkernel_pid ", next thread: %" PRIkernel_pid "\n", - (active_thread == NULL) ? KERNEL_PID_UNDEF : active_thread->pid, + (kernel_pid_t)((active_thread == NULL) ? KERNEL_PID_UNDEF : active_thread->pid), next_thread->pid); if (active_thread == next_thread) { @@ -162,7 +162,7 @@ void sched_set_status(thread_t *process, unsigned int status) { if (status >= STATUS_ON_RUNQUEUE) { if (!(process->status >= STATUS_ON_RUNQUEUE)) { - DEBUG("sched_set_status: adding thread %" PRIkernel_pid " to runqueue %" PRIu16 ".\n", + DEBUG("sched_set_status: adding thread %" PRIkernel_pid " to runqueue %" PRIu8 ".\n", process->pid, process->priority); clist_rpush(&sched_runqueues[process->priority], &(process->rq_entry)); runqueue_bitcache |= 1 << process->priority; @@ -170,7 +170,7 @@ void sched_set_status(thread_t *process, unsigned int status) } else { if (process->status >= STATUS_ON_RUNQUEUE) { - DEBUG("sched_set_status: removing thread %" PRIkernel_pid " to runqueue %" PRIu16 ".\n", + DEBUG("sched_set_status: removing thread %" PRIkernel_pid " to runqueue %" PRIu8 ".\n", process->pid, process->priority); clist_lpop(&sched_runqueues[process->priority]); From 026bc281aee4195e21fd1c5cc4ac572219ccdc2e Mon Sep 17 00:00:00 2001 From: smlng Date: Mon, 15 Jan 2018 16:36:17 +0100 Subject: [PATCH 2/5] gnrc/netif: fix format error in debug output --- sys/net/gnrc/netif/gnrc_netif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index 6170dd5037..8eba204745 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -879,7 +879,7 @@ static unsigned _match(const gnrc_netif_t *netif, const ipv6_addr_t *addr, ipv6_addr_to_str(addr_str, &netif->ipv6.addrs[*idx], sizeof(addr_str)), netif->pid); - DEBUG("%s by %" PRIu8 " bits (used as source address = %s)\n", + DEBUG("%s by %u bits (used as source address = %s)\n", ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)), best_match, (filter != NULL) ? "true" : "false"); From 65b99c994d948c9354d2389875782d46e7c13b02 Mon Sep 17 00:00:00 2001 From: smlng Date: Mon, 15 Jan 2018 16:41:02 +0100 Subject: [PATCH 3/5] gnrc/sixlowpan: fix format error in debug output --- sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c b/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c index e68506fe45..a1f361b953 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c +++ b/sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c @@ -254,7 +254,7 @@ static void _send(gnrc_pktsnip_t *pkt) return; } #endif - DEBUG("6lo: iface->sixlo.max_frag_size = %" PRIu16 " for interface %" + DEBUG("6lo: iface->sixlo.max_frag_size = %" PRIu8 " for interface %" PRIkernel_pid "\n", iface->sixlo.max_frag_size, hdr->if_pid); /* IP should not send anything here if it is not a 6LoWPAN interface, @@ -278,7 +278,7 @@ static void _send(gnrc_pktsnip_t *pkt) return; } else if (datagram_size <= SIXLOWPAN_FRAG_MAX_LEN) { - DEBUG("6lo: Send fragmented (%u > %" PRIu16 ")\n", + DEBUG("6lo: Send fragmented (%u > %" PRIu8 ")\n", (unsigned int)datagram_size, iface->sixlo.max_frag_size); msg_t msg; @@ -301,7 +301,7 @@ static void _send(gnrc_pktsnip_t *pkt) } #else (void) datagram_size; - DEBUG("6lo: packet too big (%u > %" PRIu16 ")\n", + DEBUG("6lo: packet too big (%u > %" PRIu8 ")\n", (unsigned int)datagram_size, iface->sixlo.max_frag_size); gnrc_pktbuf_release(pkt2); #endif From eb3bfdf1d217d1647e3f40333be906670bf1a940 Mon Sep 17 00:00:00 2001 From: smlng Date: Mon, 15 Jan 2018 16:46:50 +0100 Subject: [PATCH 4/5] sys/vfs: fix format error in debug output --- sys/vfs/vfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/vfs/vfs.c b/sys/vfs/vfs.c index 9b16753310..1414472278 100644 --- a/sys/vfs/vfs.c +++ b/sys/vfs/vfs.c @@ -413,7 +413,8 @@ int vfs_mount(vfs_mount_t *mountp) if ((mountp == NULL) || (mountp->fs == NULL) || (mountp->mount_point == NULL)) { return -EINVAL; } - DEBUG("vfs_mount: -> \"%s\" (%p), %p\n", mountp->mount_point, (void *)mountp->mount_point, mountp->private_data); + DEBUG("vfs_mount: -> \"%s\" (%p), %p\n", + mountp->mount_point, (void *)mountp->mount_point, mountp->private_data); if (mountp->mount_point[0] != '/') { DEBUG("vfs_mount: not absolute mount_point path\n"); return -EINVAL; @@ -727,7 +728,8 @@ int vfs_bind(int fd, int flags, const vfs_file_ops_t *f_op, void *private_data) int vfs_normalize_path(char *buf, const char *path, size_t buflen) { - DEBUG("vfs_normalize_path: %p, \"%s\" (%p), %lu\n", buf, path, path, (unsigned long)buflen); + DEBUG("vfs_normalize_path: %p, \"%s\" (%p), %lu\n", + (void *)buf, path, (void *)path, (unsigned long)buflen); size_t len = 0; int npathcomp = 0; const char *path_end = path + strlen(path); /* Find the terminating null byte */ @@ -736,7 +738,8 @@ int vfs_normalize_path(char *buf, const char *path, size_t buflen) } while(path <= path_end) { - DEBUG("vfs_normalize_path: + %d \"%.*s\" <- \"%s\" (%p)\n", npathcomp, (int)len, buf, path, path); + DEBUG("vfs_normalize_path: + %d \"%.*s\" <- \"%s\" (%p)\n", + npathcomp, (int)len, buf, path, (void *)path); if (path[0] == '\0') { break; } From 928292f4648de0b6fefaeeaceb95a827e13a785f Mon Sep 17 00:00:00 2001 From: smlng Date: Mon, 15 Jan 2018 17:08:38 +0100 Subject: [PATCH 5/5] sys/shell: fix format error in debug output --- sys/shell/commands/sc_sntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/shell/commands/sc_sntp.c b/sys/shell/commands/sc_sntp.c index d9c3f905bd..9b70de140d 100644 --- a/sys/shell/commands/sc_sntp.c +++ b/sys/shell/commands/sc_sntp.c @@ -46,7 +46,7 @@ int _ntpdate(int argc, char **argv) sock_udp_ep_t server = { .port = NTP_PORT, .family = AF_INET6 }; ipv6_addr_t *addr = (ipv6_addr_t *)&server.addr; - int src_iface = ipv6_addr_split_iface(argv[1]); + kernel_pid_t src_iface = ipv6_addr_split_iface(argv[1]); if (src_iface == -1) { src_iface = KERNEL_PID_UNDEF; }