You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/25 13:12:00 UTC
[incubator-nuttx] 23/35: net/tcp/tcp_send_buffered.c: Fix syslog
formats
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 17654f592e480df70e91b175f89265fb18fb34a8
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Nov 25 19:41:42 2020 +0900
net/tcp/tcp_send_buffered.c: Fix syslog formats
---
net/tcp/tcp_send_buffered.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c
index 040ad56..9e5a6ae 100644
--- a/net/tcp/tcp_send_buffered.c
+++ b/net/tcp/tcp_send_buffered.c
@@ -53,6 +53,7 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <inttypes.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
@@ -400,7 +401,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
/* Get the ACK number from the TCP header */
ackno = tcp_getsequence(tcp->ackno);
- ninfo("ACK: ackno=%u flags=%04x\n", ackno, flags);
+ ninfo("ACK: ackno=%" PRIu32 " flags=%04x\n", ackno, flags);
/* Look at every write buffer in the unacked_q. The unacked_q
* holds write buffers that have been entirely sent, but which
@@ -426,7 +427,8 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
/* Get the sequence number at the end of the data */
lastseq = TCP_WBSEQNO(wrb) + TCP_WBPKTLEN(wrb);
- ninfo("ACK: wrb=%p seqno=%u lastseq=%u pktlen=%u ackno=%u\n",
+ ninfo("ACK: wrb=%p seqno=%" PRIu32
+ " lastseq=%" PRIu32 " pktlen=%u ackno=%" PRIu32 "\n",
wrb, TCP_WBSEQNO(wrb), lastseq, TCP_WBPKTLEN(wrb),
ackno);
@@ -478,8 +480,8 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
/* Set the new sequence number for what remains */
- ninfo("ACK: wrb=%p seqno=%u pktlen=%u\n",
- wrb, TCP_WBSEQNO(wrb), TCP_WBPKTLEN(wrb));
+ ninfo("ACK: wrb=%p seqno=%" PRIu32 " pktlen=%u\n",
+ wrb, TCP_WBSEQNO(wrb), TCP_WBPKTLEN(wrb));
}
}
}
@@ -504,7 +506,8 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
nacked = TCP_WBSENT(wrb);
}
- ninfo("ACK: wrb=%p seqno=%u nacked=%u sent=%u ackno=%u\n",
+ ninfo("ACK: wrb=%p seqno=%" PRIu32
+ " nacked=%" PRIu32 " sent=%u ackno=%" PRIu32 "\n",
wrb, TCP_WBSEQNO(wrb), nacked, TCP_WBSENT(wrb), ackno);
/* Trim the ACKed bytes from the beginning of the write buffer. */
@@ -513,7 +516,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
TCP_WBSEQNO(wrb) = ackno;
TCP_WBSENT(wrb) -= nacked;
- ninfo("ACK: wrb=%p seqno=%u pktlen=%u sent=%u\n",
+ ninfo("ACK: wrb=%p seqno=%" PRIu32 " pktlen=%u sent=%u\n",
wrb, TCP_WBSEQNO(wrb), TCP_WBPKTLEN(wrb), TCP_WBSENT(wrb));
}
}
@@ -563,7 +566,8 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
}
TCP_WBSENT(wrb) = 0;
- ninfo("REXMIT: wrb=%p sent=%u, conn tx_unacked=%d sent=%d\n",
+ ninfo("REXMIT: wrb=%p sent=%u, "
+ "conn tx_unacked=%" PRId32 " sent=%" PRId32 "\n",
wrb, TCP_WBSENT(wrb), conn->tx_unacked, conn->sent);
/* Increment the retransmit count on this write buffer. */
@@ -635,7 +639,8 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
}
TCP_WBSENT(wrb) = 0;
- ninfo("REXMIT: wrb=%p sent=%u, conn tx_unacked=%d sent=%d\n",
+ ninfo("REXMIT: wrb=%p sent=%u, "
+ "conn tx_unacked=%" PRId32 " sent=%" PRId32 "\n",
wrb, TCP_WBSENT(wrb), conn->tx_unacked, conn->sent);
/* Free any write buffers that have exceed the retry count */
@@ -795,7 +800,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev,
conn->sndseq_max = predicted_seqno;
}
- ninfo("SEND: wrb=%p nrtx=%u tx_unacked=%u sent=%u\n",
+ ninfo("SEND: wrb=%p nrtx=%u tx_unacked=%" PRIu32 " sent=%" PRIu32 "\n",
wrb, TCP_WBNRTX(wrb), conn->tx_unacked, conn->sent);
/* Increment the count of bytes sent from this write buffer */