From 996d16efa8be4631888abdac022ef9ac82d68581 Mon Sep 17 00:00:00 2001
From: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date: Mon, 27 Aug 2018 16:05:22 +0200
Subject: [PATCH 34/34] Issue 2 + 3 from Comment #5, task #13508 solved

Removed C++ comments and // ----... marks as requested.
---
 src/core/ipv4/acd.c    | 18 +++++++-----------
 src/core/ipv4/autoip.c |  2 +-
 src/core/ipv4/etharp.c |  2 +-
 src/include/lwip/acd.h |  8 ++------
 4 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/src/core/ipv4/acd.c b/src/core/ipv4/acd.c
index b43fdbd47..555d2c37e 100644
--- a/src/core/ipv4/acd.c
+++ b/src/core/ipv4/acd.c
@@ -70,8 +70,7 @@
 #include "lwip/acd.h"
 #include "lwip/prot/acd.h"
 
-// ----------------------------------------------------------------------------
-// Define good random function (LWIP_RAND) in lwipopts.h
+/* Define good random function (LWIP_RAND) in lwipopts.h */
 #define ACD_RANDOM_PROBE_WAIT     (LWIP_RAND() % \
                                   (PROBE_WAIT * ACD_TICKS_PER_SECOND))
 
@@ -79,15 +78,12 @@
                                    * ACD_TICKS_PER_SECOND)) + \
                                    (PROBE_MIN * ACD_TICKS_PER_SECOND ))
 
-// ----------------------------------------------------------------------------
-// Function definitions
+/* Function definitions */
 static err_t acd_arp_probe(struct netif *netif);
 static err_t acd_arp_announce(struct netif *netif);
 static void acd_restart(struct netif *netif);
 static void acd_handle_arp_conflict(struct netif *netif);
 
-// ----------------------------------------------------------------------------
-
 /**
  * @ingroup acd
  * Set a statically allocated struct acd to work with.
@@ -148,7 +144,7 @@ acd_start(struct netif *netif, ip4_addr_t ipaddr,
     LWIP_DEBUGF(ACD_DEBUG | LWIP_DBG_TRACE, ("acd_start(): allocated acd"));
   }
 
-  // init probing state
+  /* init probing state */
   acd->sent_num = 0;
   acd->lastconflict = 0;
   ip4_addr_copy(acd->ipaddr, ipaddr);
@@ -241,7 +237,7 @@ acd_tmr(void)
             if (acd->sent_num == 0) {
               acd->state = ACD_STATE_ANNOUNCING;
 
-              // let acd user know that the address is good and can be used
+              /* let acd user know that the address is good and can be used */
               acd->acd_conflict_callback(netif, 0);
 
               LWIP_DEBUGF(ACD_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
@@ -310,9 +306,9 @@ acd_restart(struct netif *netif)
 {
   struct acd *acd = netif_acd_data(netif);
 
-  // increase conflict counter.
+  /* increase conflict counter. */
   acd->num_conflicts++;
-  // let acd user know their is a conflict detected.
+  /* let acd user know their is a conflict detected. */
   acd->acd_conflict_callback(netif,1);
 }
 
@@ -393,7 +389,7 @@ acd_handle_arp_conflict(struct netif *netif)
      enough to help network performance */
 
   if (acd->lastconflict > 0) {
-    // retreat, there was a conflicting ARP in the last DEFEND_INTERVAL seconds
+    /* retreat, there was a conflicting ARP in the last DEFEND_INTERVAL seconds */
     LWIP_DEBUGF(ACD_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
       ("acd_handle_arp_conflict(): conflict within DEFEND_INTERVAL -> retreating\n"));
 
diff --git a/src/core/ipv4/autoip.c b/src/core/ipv4/autoip.c
index d4d2cc9e1..44fd4da04 100644
--- a/src/core/ipv4/autoip.c
+++ b/src/core/ipv4/autoip.c
@@ -276,7 +276,7 @@ autoip_network_changed(struct netif *netif)
      */
     netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
     autoip->state = AUTOIP_STATE_CHECKING;
-    // Start acd check again for the last used address
+    /* Start acd check again for the last used address */
     acd_start(netif, autoip->llipaddr, autoip_conflict_callback);
   }
 }
diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c
index bf2403857..3065255da 100644
--- a/src/core/ipv4/etharp.c
+++ b/src/core/ipv4/etharp.c
@@ -690,7 +690,7 @@ etharp_input(struct pbuf *p, struct netif *netif)
   } else {
     /* ARP packet directed to us? */
     for_us = (u8_t)ip4_addr_cmp(&dipaddr, netif_ip4_addr(netif));
-    // ARP packet from us?
+    /* ARP packet from us? */
     from_us = (u8_t)ip4_addr_cmp(&sipaddr, netif_ip4_addr(netif));
   }
 
diff --git a/src/include/lwip/acd.h b/src/include/lwip/acd.h
index b4e1a2999..28ecd401d 100644
--- a/src/include/lwip/acd.h
+++ b/src/include/lwip/acd.h
@@ -51,12 +51,10 @@
 extern "C" {
 #endif
 
-// ----------------------------------------------------------------------------
-
 /** ACD Timing
  *  ACD_TMR_INTERVAL msecs, I recommend a value of 100.
  *  The value must divide 1000 with a remainder almost 0. Possible values are
- *  1000, 500, 333, 250, 200, 166, 142, 125, 111, 100 .... 
+ *  1000, 500, 333, 250, 200, 166, 142, 125, 111, 100 ....
  */
 #define ACD_TMR_INTERVAL      100
 #define ACD_TICKS_PER_SECOND  (1000 / ACD_TMR_INTERVAL)
@@ -92,8 +90,7 @@ struct acd
   acd_conflict_callback_t acd_conflict_callback;
 };
 
-// ----------------------------------------------------------------------------
-// struct manipulation functions
+/* struct manipulation functions */
 void acd_set_struct(struct netif *netif, struct acd *acd);
 /** Remove a struct acd previously set to the netif using acd_set_struct() */
 #define acd_remove_struct(netif) do { (netif)->acd = NULL; } while (0)
@@ -101,7 +98,6 @@ void acd_set_struct(struct netif *netif, struct acd *acd);
 #define netif_acd_data(netif) ((struct acd*)netif_get_client_data(netif, \
                               LWIP_NETIF_CLIENT_DATA_INDEX_ACD))
 
-// ----------------------------------------------------------------------------
 
 err_t acd_start(struct netif *netif, ip4_addr_t ipaddr,
                 acd_conflict_callback_t acd_conflict_callback);
-- 
2.18.0

