From 6f0dceee09f0ed07b1f85b70dae70b828a37418b Mon Sep 17 00:00:00 2001 From: sg Date: Thu, 17 Sep 2015 21:33:25 +0200 Subject: [PATCH] fixed some printf formatters (mainly for window scaling code) --- src/core/tcp.c | 2 +- src/core/tcp_in.c | 6 +++--- src/core/tcp_out.c | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index ee3a3753..52332521 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -701,7 +701,7 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len) tcp_output(pcb); } - LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n", + LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F").\n", len, pcb->rcv_wnd, TCP_WND_MAX(pcb) - pcb->rcv_wnd)); } diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 5e7c8a4d..05fc31e5 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -998,11 +998,11 @@ tcp_receive(struct tcp_pcb *pcb) /* stop persist timer */ pcb->persist_backoff = 0; } - LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"U16_F"\n", pcb->snd_wnd)); + LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"TCPWNDSIZE_F"\n", pcb->snd_wnd)); #if TCP_WND_DEBUG } else { - if (pcb->snd_wnd != SND_WND_SCALE(pcb, tcphdr->wnd)) { - LWIP_DEBUGF(TCP_WND_DEBUG, + if (pcb->snd_wnd != (tcpwnd_size_t)SND_WND_SCALE(pcb, tcphdr->wnd)) { + LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: no window update lastack %"U32_F" ackno %" U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n", pcb->lastack, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2)); diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index e9e77c99..c9ab8ea4 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -322,7 +322,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len) /* fail on too much data */ if (len > pcb->snd_buf) { - LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too much data (len=%"U16_F" > snd_buf=%"U16_F")\n", + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too much data (len=%"U16_F" > snd_buf=%"TCPWNDSIZE_F")\n", len, pcb->snd_buf)); pcb->flags |= TF_NAGLEMEMERR; return ERR_MEM; @@ -334,7 +334,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len) * configured maximum, return an error */ /* check for configured max queuelen and possible overflow */ if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { - LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too long queue %"TCPWNDSIZE_F" (max %"TCPWNDSIZE_F")\n", + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_write: too long queue %"U16_F" (max %"U16_F")\n", pcb->snd_queuelen, TCP_SND_QUEUELEN)); TCP_STATS_INC(tcp.memerr); pcb->flags |= TF_NAGLEMEMERR; @@ -604,7 +604,8 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags) * length of the queue exceeds the configured maximum or * overflows. */ if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { - LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: queue too long %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F")\n", queuelen, TCP_SND_QUEUELEN)); + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_write: queue too long %"U16_F" (%d)\n", + queuelen, (int)TCP_SND_QUEUELEN)); pbuf_free(p); goto memerr; } @@ -1455,7 +1456,7 @@ tcp_rexmit_fast(struct tcp_pcb *pcb) /* The minimum value for ssthresh should be 2 MSS */ if (pcb->ssthresh < (2U * pcb->mss)) { LWIP_DEBUGF(TCP_FR_DEBUG, - ("tcp_receive: The minimum value for ssthresh %"U16_F + ("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F " should be min 2 mss %"U16_F"...\n", pcb->ssthresh, 2*pcb->mss)); pcb->ssthresh = 2*pcb->mss;