You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/01/13 20:26:10 UTC

[incubator-nuttx] branch pr92 updated: net/: Fix some new problems found by the current nxstyle with .c files in the net/ directory. (#92)

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

aguettouche pushed a commit to branch pr92
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/pr92 by this push:
     new 3a3539f  net/:  Fix some new problems found by the current nxstyle with .c files in the net/ directory. (#92)
3a3539f is described below

commit 3a3539f2bee86f821ed59368cc954ad74ab89b95
Author: patacongo <sp...@yahoo.com>
AuthorDate: Mon Jan 13 14:26:04 2020 -0600

    net/:  Fix some new problems found by the current nxstyle with .c files in the net/ directory. (#92)
---
 net/igmp/igmp_poll.c          |  2 +-
 net/local/local_fifo.c        |  2 +-
 net/pkt/pkt_conn.c            | 16 ++++++++++------
 net/route/net_cacheroute.c    |  4 ++--
 net/route/net_del_fileroute.c |  2 +-
 net/route/net_del_ramroute.c  |  2 +-
 net/route/net_fileroute.c     |  2 +-
 net/route/net_router.c        |  4 ++--
 net/route/netdev_router.c     |  4 ++--
 net/usrsock/usrsock_dev.c     |  2 +-
 10 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/net/igmp/igmp_poll.c b/net/igmp/igmp_poll.c
index c1752ab..ae6b383 100644
--- a/net/igmp/igmp_poll.c
+++ b/net/igmp/igmp_poll.c
@@ -58,7 +58,7 @@
 #ifdef CONFIG_NET_IGMP
 
 /****************************************************************************
- * Private Functions
+ * Pre-processor Definitions
  ****************************************************************************/
 
 /* Buffer layout */
diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c
index 4165fd7..a8822e9 100644
--- a/net/local/local_fifo.c
+++ b/net/local/local_fifo.c
@@ -54,7 +54,7 @@
 #include "local/local.h"
 
 /****************************************************************************
- * Private Functions
+ * Pre-processor Definitions
  ****************************************************************************/
 
 #define LOCAL_CS_SUFFIX    "CS"  /* Name of the client-to-server FIFO */
diff --git a/net/pkt/pkt_conn.c b/net/pkt/pkt_conn.c
index 8e6f949..fad97ac 100644
--- a/net/pkt/pkt_conn.c
+++ b/net/pkt/pkt_conn.c
@@ -1,7 +1,7 @@
 /****************************************************************************
  * net/pkt/pkt_conn.c
  *
- *   Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved.
+ *   Copyright (C) 2014, 2016-2017, 2020 Gregory Nutt. All rights reserved.
  *   Author: Gregory Nutt <gn...@nuttx.org>
  *
  * Large parts of this file were leveraged from uIP logic:
@@ -59,6 +59,15 @@
 #include "pkt/pkt.h"
 
 /****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define eth_addr_cmp(addr1, addr2) \
+  ((addr1[0] == addr2[0]) && (addr1[1] == addr2[1]) && \
+   (addr1[2] == addr2[2]) && (addr1[3] == addr2[3]) && \
+   (addr1[4] == addr2[4]) && (addr1[5] == addr2[5]))
+
+/****************************************************************************
  * Private Data
  ****************************************************************************/
 
@@ -199,11 +208,6 @@ void pkt_free(FAR struct pkt_conn_s *conn)
 
 FAR struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf)
 {
-  #define eth_addr_cmp(addr1, addr2) \
-  ((addr1[0] == addr2[0]) && (addr1[1] == addr2[1]) && \
-   (addr1[2] == addr2[2]) && (addr1[3] == addr2[3]) && \
-   (addr1[4] == addr2[4]) && (addr1[5] == addr2[5]))
-
   FAR struct pkt_conn_s *conn =
     (FAR struct pkt_conn_s *)g_active_pkt_connections.head;
 
diff --git a/net/route/net_cacheroute.c b/net/route/net_cacheroute.c
index 7796629..96d5ad4 100644
--- a/net/route/net_cacheroute.c
+++ b/net/route/net_cacheroute.c
@@ -77,7 +77,7 @@
   while (0)
 
 /****************************************************************************
- * Public Types
+ * Private Types
  ****************************************************************************/
 
 #ifdef CONFIG_ROUTE_IPv4_CACHEROUTE
@@ -470,7 +470,7 @@ static void net_reset_ipv6_cache(void)
 #endif
 
 /****************************************************************************
- * Public Function Prototypes
+ * Public Functions
  ****************************************************************************/
 
 /****************************************************************************
diff --git a/net/route/net_del_fileroute.c b/net/route/net_del_fileroute.c
index 12b5a2f..750244e 100644
--- a/net/route/net_del_fileroute.c
+++ b/net/route/net_del_fileroute.c
@@ -58,7 +58,7 @@
 #if defined(CONFIG_ROUTE_IPv4_FILEROUTE) || defined(CONFIG_ROUTE_IPv6_FILEROUTE)
 
 /****************************************************************************
- * Public Types
+ * Private Types
  ****************************************************************************/
 
 #ifdef CONFIG_ROUTE_IPv4_FILEROUTE
diff --git a/net/route/net_del_ramroute.c b/net/route/net_del_ramroute.c
index 1a6d303..38ce547 100644
--- a/net/route/net_del_ramroute.c
+++ b/net/route/net_del_ramroute.c
@@ -53,7 +53,7 @@
 #if defined(CONFIG_ROUTE_IPv4_RAMROUTE) || defined(CONFIG_ROUTE_IPv6_RAMROUTE)
 
 /****************************************************************************
- * Public Types
+ * Private Types
  ****************************************************************************/
 
 #ifdef CONFIG_ROUTE_IPv4_RAMROUTE
diff --git a/net/route/net_fileroute.c b/net/route/net_fileroute.c
index 2ce41d3..13ce42a 100644
--- a/net/route/net_fileroute.c
+++ b/net/route/net_fileroute.c
@@ -56,7 +56,7 @@
 #if defined(CONFIG_ROUTE_IPv4_FILEROUTE) || defined(CONFIG_ROUTE_IPv6_FILEROUTE)
 
 /****************************************************************************
- * Pre-processor Defintions
+ * Pre-processor Definitions
  ****************************************************************************/
 
 /* Special "impossible" PID value used to indicate that there is no holder
diff --git a/net/route/net_router.c b/net/route/net_router.c
index 090d1c4..fe1dc6b 100644
--- a/net/route/net_router.c
+++ b/net/route/net_router.c
@@ -54,7 +54,7 @@
 #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
 
 /****************************************************************************
- * Pre-processor defintions
+ * Pre-processor Definitions
  ****************************************************************************/
 
 #ifdef CONFIG_ROUTE_IPv6_CACHEROUTE
@@ -70,7 +70,7 @@
 #endif
 
 /****************************************************************************
- * Public Types
+ * Private Types
  ****************************************************************************/
 
 #ifdef CONFIG_NET_IPv4
diff --git a/net/route/netdev_router.c b/net/route/netdev_router.c
index c735b0e..0c7697b 100644
--- a/net/route/netdev_router.c
+++ b/net/route/netdev_router.c
@@ -53,7 +53,7 @@
 #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
 
 /****************************************************************************
- * Pre-processor defintions
+ * Pre-processor Definitions
  ****************************************************************************/
 
 #ifdef CONFIG_ROUTE_IPv6_CACHEROUTE
@@ -69,7 +69,7 @@
 #endif
 
 /****************************************************************************
- * Public Types
+ * Private Types
  ****************************************************************************/
 
 #ifdef CONFIG_NET_IPv4
diff --git a/net/usrsock/usrsock_dev.c b/net/usrsock/usrsock_dev.c
index a6f31ba..9f1f21b 100644
--- a/net/usrsock/usrsock_dev.c
+++ b/net/usrsock/usrsock_dev.c
@@ -62,7 +62,7 @@
 #include "usrsock/usrsock.h"
 
 /****************************************************************************
- * Definitions
+ * Pre-processor Definitions
  ****************************************************************************/
 
 #ifndef CONFIG_NET_USRSOCKDEV_NPOLLWAITERS