[rtems commit] pppd: Fix warnings

Sebastian Huber sebh at rtems.org
Tue Sep 30 11:58:24 UTC 2014


Module:    rtems
Branch:    master
Commit:    805360b8e50e69573ec446674f640c9b7704cb34
Changeset: http://git.rtems.org/rtems/commit/?id=805360b8e50e69573ec446674f640c9b7704cb34

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Sep 23 14:20:35 2014 +0200

pppd: Fix warnings

---

 cpukit/libnetworking/net/if_ppp.c   |   12 +++++++++++-
 cpukit/pppd/rtemspppd.h             |   13 +++++++++++--
 testsuites/samples/pppd/netconfig.h |    4 +---
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/cpukit/libnetworking/net/if_ppp.c b/cpukit/libnetworking/net/if_ppp.c
index 3f9c16f..a1d7a62 100644
--- a/cpukit/libnetworking/net/if_ppp.c
+++ b/cpukit/libnetworking/net/if_ppp.c
@@ -89,6 +89,7 @@
 #include <termios.h>
 #include <rtems/termiostypes.h>
 #include <rtems/rtems_bsdnet.h>
+#include <rtems/rtemspppd.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
@@ -257,7 +258,9 @@ static rtems_task ppp_txdaemon(rtems_task_argument arg)
   rtems_event_set             events;
   int                         iprocess = (int               )0;
   struct ppp_softc           *sc       = (struct ppp_softc *)arg;
+#ifdef LALL_X
   struct mbuf                *mp;
+#endif
   struct mbuf                *mf;
   struct mbuf                *m;
   struct rtems_termios_tty   *tp;
@@ -322,7 +325,9 @@ static rtems_task ppp_txdaemon(rtems_task_argument arg)
 
       /* loop over all mbufs in chain */
       mf     = NULL;
+#ifdef LALL_X
       mp     = NULL;
+#endif
       m      = sc->sc_outm;
 
       sc->sc_outmc  = m;
@@ -1421,7 +1426,10 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
     struct ifnet *ifp = &sc->sc_if;
     struct ifqueue *inq;
     int s, ilen, proto, rv; 
-    u_char *cp, adrs, ctrl;
+    u_char *cp;
+#ifdef VJC
+    u_char adrs, ctrl;
+#endif
     struct mbuf *mp;
 #ifdef PPP_COMPRESS
     struct mbuf *dmp = NULL;
@@ -1443,8 +1451,10 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
     }
 
     cp = mtod(m, u_char *);
+#ifdef VJC
     adrs = PPP_ADDRESS(cp);
     ctrl = PPP_CONTROL(cp);
+#endif
     proto = PPP_PROTOCOL(cp);
 
     if (m->m_flags & M_ERRMARK) {
diff --git a/cpukit/pppd/rtemspppd.h b/cpukit/pppd/rtemspppd.h
index d927650..a6c8d0b 100644
--- a/cpukit/pppd/rtemspppd.h
+++ b/cpukit/pppd/rtemspppd.h
@@ -6,13 +6,14 @@
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
  * http://www.rtems.org/license/LICENSE.
- *
- *  $Id$
  */
 
 #ifndef RTEMSPPPD_H
 #define RTEMSPPPD_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
 
 /* define hook function identifiers */
 #define RTEMS_PPPD_LINKUP_HOOK      1
@@ -37,4 +38,12 @@ int rtems_pppd_set_option(const char *pOption, const char *pValue);
 int rtems_pppd_connect(void);
 int rtems_pppd_disconnect(void);
 
+struct rtems_bsdnet_ifconfig;
+
+int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif
diff --git a/testsuites/samples/pppd/netconfig.h b/testsuites/samples/pppd/netconfig.h
index f7f5682..f1d6494 100644
--- a/testsuites/samples/pppd/netconfig.h
+++ b/testsuites/samples/pppd/netconfig.h
@@ -2,9 +2,7 @@
 #define NETCONFIG_H_
 
 #include <bsp.h>
-
-/* external function prototypes */
-extern int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
+#include <rtems/rtemspppd.h>
 
 /* Default network interface */
 static struct rtems_bsdnet_ifconfig netdriver_config = {



More information about the vc mailing list