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/23 13:01:11 UTC

[incubator-nuttx-apps] branch master updated (85f96e3 -> 5065d47)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from 85f96e3  testing/irtest: test ir by LIRC interface
     new 37aa346  netutils/dhcpc/dhcpc.c: Fix syslog formats
     new cbaf05b  netutils/netlib/netlib_ipmsfilter.c: Appease nxstyle
     new 5065d47  netutils/netlib/netlib_ipmsfilter.c: Fix a syslog format

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 netutils/dhcpc/dhcpc.c              | 39 +++++++++++++++++++------------------
 netutils/netlib/netlib_ipmsfilter.c |  7 ++++++-
 2 files changed, 26 insertions(+), 20 deletions(-)


[incubator-nuttx-apps] 01/03: netutils/dhcpc/dhcpc.c: Fix syslog formats

Posted by xi...@apache.org.
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-apps.git

commit 37aa346da6df5673b3e2c2e32943248bb3032564
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Nov 23 20:25:33 2020 +0900

    netutils/dhcpc/dhcpc.c: Fix syslog formats
---
 netutils/dhcpc/dhcpc.c | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c
index c9c454f..93e92cd 100644
--- a/netutils/dhcpc/dhcpc.c
+++ b/netutils/dhcpc/dhcpc.c
@@ -45,6 +45,7 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 
+#include <inttypes.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
@@ -575,8 +576,8 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
                    * clobbered by a new OFFER.
                    */
 
-                  ninfo("Received OFFER from %08x\n",
-                       ntohl(presult->serverid.s_addr));
+                  ninfo("Received OFFER from %08" PRIx32 "\n",
+                        (uint32_t)ntohl(presult->serverid.s_addr));
                   pdhcpc->ipaddr.s_addr   = presult->ipaddr.s_addr;
                   pdhcpc->serverid.s_addr = presult->serverid.s_addr;
 
@@ -701,25 +702,25 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
   while (state != STATE_HAVE_LEASE);
 
   ninfo("Got IP address %d.%d.%d.%d\n",
-        (presult->ipaddr.s_addr)       & 0xff,
-        (presult->ipaddr.s_addr >> 8)  & 0xff,
-        (presult->ipaddr.s_addr >> 16) & 0xff,
-        (presult->ipaddr.s_addr >> 24) & 0xff);
+        (int)((presult->ipaddr.s_addr)       & 0xff),
+        (int)((presult->ipaddr.s_addr >> 8)  & 0xff),
+        (int)((presult->ipaddr.s_addr >> 16) & 0xff),
+        (int)((presult->ipaddr.s_addr >> 24) & 0xff));
   ninfo("Got netmask %d.%d.%d.%d\n",
-        (presult->netmask.s_addr)       & 0xff,
-        (presult->netmask.s_addr >> 8)  & 0xff,
-        (presult->netmask.s_addr >> 16) & 0xff,
-        (presult->netmask.s_addr >> 24) & 0xff);
+        (int)((presult->netmask.s_addr)       & 0xff),
+        (int)((presult->netmask.s_addr >> 8)  & 0xff),
+        (int)((presult->netmask.s_addr >> 16) & 0xff),
+        (int)((presult->netmask.s_addr >> 24) & 0xff));
   ninfo("Got DNS server %d.%d.%d.%d\n",
-        (presult->dnsaddr.s_addr)       & 0xff,
-        (presult->dnsaddr.s_addr >> 8)  & 0xff,
-        (presult->dnsaddr.s_addr >> 16) & 0xff,
-        (presult->dnsaddr.s_addr >> 24) & 0xff);
+        (int)((presult->dnsaddr.s_addr)       & 0xff),
+        (int)((presult->dnsaddr.s_addr >> 8)  & 0xff),
+        (int)((presult->dnsaddr.s_addr >> 16) & 0xff),
+        (int)((presult->dnsaddr.s_addr >> 24) & 0xff));
   ninfo("Got default router %d.%d.%d.%d\n",
-        (presult->default_router.s_addr)       & 0xff,
-        (presult->default_router.s_addr >> 8)  & 0xff,
-        (presult->default_router.s_addr >> 16) & 0xff,
-        (presult->default_router.s_addr >> 24) & 0xff);
-  ninfo("Lease expires in %d seconds\n", presult->lease_time);
+        (int)((presult->default_router.s_addr)       & 0xff),
+        (int)((presult->default_router.s_addr >> 8)  & 0xff),
+        (int)((presult->default_router.s_addr >> 16) & 0xff),
+        (int)((presult->default_router.s_addr >> 24) & 0xff));
+  ninfo("Lease expires in %" PRId32 " seconds\n", presult->lease_time);
   return OK;
 }


[incubator-nuttx-apps] 02/03: netutils/netlib/netlib_ipmsfilter.c: Appease nxstyle

Posted by xi...@apache.org.
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-apps.git

commit cbaf05bfd053198987a922b24eec8eb9c29a2833
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Nov 23 20:26:52 2020 +0900

    netutils/netlib/netlib_ipmsfilter.c: Appease nxstyle
---
 netutils/netlib/netlib_ipmsfilter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/netutils/netlib/netlib_ipmsfilter.c b/netutils/netlib/netlib_ipmsfilter.c
index ac04f6e..8898b92 100644
--- a/netutils/netlib/netlib_ipmsfilter.c
+++ b/netutils/netlib/netlib_ipmsfilter.c
@@ -86,7 +86,8 @@ int ipmsfilter(FAR const struct in_addr *interface,
 {
   int ret = ERROR;
 
-  ninfo("interface: %08x muliaddr: %08x fmode: %ld\n", interface, *multiaddr, fmode);
+  ninfo("interface: %08x muliaddr: %08x fmode: %ld\n",
+        interface, *multiaddr, fmode);
   if (interface != NULL && multiaddr != NULL)
     {
       /* Get a socket (only so that we get access to the INET subsystem) */


[incubator-nuttx-apps] 03/03: netutils/netlib/netlib_ipmsfilter.c: Fix a syslog format

Posted by xi...@apache.org.
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-apps.git

commit 5065d470cec41c361f5940054461851444045b2b
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Nov 23 20:30:06 2020 +0900

    netutils/netlib/netlib_ipmsfilter.c: Fix a syslog format
---
 netutils/netlib/netlib_ipmsfilter.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/netutils/netlib/netlib_ipmsfilter.c b/netutils/netlib/netlib_ipmsfilter.c
index 8898b92..84e00de 100644
--- a/netutils/netlib/netlib_ipmsfilter.c
+++ b/netutils/netlib/netlib_ipmsfilter.c
@@ -41,6 +41,7 @@
 
 #include <sys/socket.h>
 #include <sys/ioctl.h>
+#include <inttypes.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <string.h>
@@ -86,10 +87,13 @@ int ipmsfilter(FAR const struct in_addr *interface,
 {
   int ret = ERROR;
 
-  ninfo("interface: %08x muliaddr: %08x fmode: %ld\n",
-        interface, *multiaddr, fmode);
   if (interface != NULL && multiaddr != NULL)
     {
+      ninfo("interface: %08" PRIx32 " muliaddr: %08" PRIx32
+            " fmode: %" PRId32 "\n",
+            (uint32_t)interface->s_addr,
+            (uint32_t)multiaddr->s_addr, fmode);
+
       /* Get a socket (only so that we get access to the INET subsystem) */
 
       int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0);