]> arthur.barton.de Git - netatalk.git/blobdiff - etc/atalkd/main.c
remove most sparse warning 'Using plain integer as NULL pointer'
[netatalk.git] / etc / atalkd / main.c
index 7f437e2964d44b4026d7749bdd71c0a0df661ab8..b8080c29150a56646de93a5f2b167911a9e1578e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.20 2009-10-13 22:55:37 didg Exp $
+ * $Id: main.c,v 1.22 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -102,6 +102,8 @@ int ifconfig(const char *iname, unsigned long cmd, struct sockaddr_at *sa);
 extern int aep_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len);
 
 int            rtfd;
+int            transition = 0;
+int            stabletimer, newrtmpdata = 0;
 
 static struct atserv   atserv[] = {
     { "rtmp",          1,      rtmp_packet },          /* 0 */
@@ -113,17 +115,17 @@ static int                atservNATSERV = elements( atserv );
 
 struct interface       *interfaces = NULL, *ciface = NULL;
 
-int            debug = 0, quiet = 0, chatty = 0;
-char           *configfile = NULL;
-int            ziptimeout = 0, transition = 0;
-int            stabletimer, stable = 0, newrtmpdata = 0, noparent = 0;
-static int     ninterfaces;
-int            defphase = IFACE_PHASE2;
-int            nfds = 0;
-fd_set         fds;
-char           Packet[ PKTSZ ];
-char           *version = VERSION;
-static char     *pidfile = _PATH_ATALKDLOCK;
+static int             debug = 0, quiet = 0, chatty = 0;
+static char            *configfile = NULL;
+static int             ziptimeout = 0;
+static int             stable = 0, noparent = 0;
+static int             ninterfaces;
+static int             defphase = IFACE_PHASE2;
+static int             nfds = 0;
+static fd_set          fds;
+static char            Packet[ PKTSZ ];
+static char            *version = VERSION;
+static char            *pidfile = _PATH_ATALKDLOCK;
 
 
 /* from config.c */
@@ -329,7 +331,7 @@ static void as_timer(int sig _U_)
                while ( rtmp ) {
                    frtmp = rtmp->rt_next;
                    if ( rtmp->rt_hops == RTMPHOPS_POISON ||
-                           rtmp->rt_iprev == 0 ) {
+                           rtmp->rt_iprev == NULL ) {
                        rtmp_free( rtmp );
                    } else {
                        rtmp->rt_hops = RTMPHOPS_POISON;
@@ -343,13 +345,13 @@ static void as_timer(int sig _U_)
                    }
                    rtmp = frtmp;
                }
-               if ( gate->g_rt == 0 ) {
-                   if ( gate->g_prev == 0 ) {
+               if ( gate->g_rt == NULL ) {
+                   if ( gate->g_prev == NULL ) {
                        gate->g_iface->i_gate = gate->g_next;
                    } else {
                        gate->g_prev->g_next = gate->g_next;
                    }
-                   if ( gate->g_next != 0 ) {
+                   if ( gate->g_next != NULL ) {
                        gate->g_next->g_prev = gate->g_prev;
                    }
                    fgate = gate;       /* can't free here, just mark it */
@@ -364,7 +366,7 @@ static void as_timer(int sig _U_)
                 * if we're not a seed router.
                 */
 
-               if ( gate->g_iface->i_gate == 0 && 
+               if ( gate->g_iface->i_gate == NULL && 
                     ((iface->i_flags & IFACE_SEED) == 0)) {
                    gate->g_iface->i_flags |= IFACE_NOROUTER;
                    gate->g_iface->i_flags &= ~IFACE_CONFIG;
@@ -422,7 +424,7 @@ static void as_timer(int sig _U_)
                 */
                if ( rtmp->rt_state >= RTMPTAB_BAD ) {
                    frtmp = rtmp->rt_next;
-                   if ( rtmp->rt_iprev == 0 ) {        /* not in use */
+                   if ( rtmp->rt_iprev == NULL ) {     /* not in use */
                        rtmp_free( rtmp );
                    } else {                            /* in use */
                        if ( rtmp->rt_hops == RTMPHOPS_POISON ) {
@@ -574,7 +576,7 @@ static void as_timer(int sig _U_)
                 */
                for ( rtmp = iface2->i_rt; rtmp; rtmp = rtmp->rt_inext ) {
                    /* don't broadcast routes we have no zone for */
-                   if ( rtmp->rt_zt == 0 ||
+                   if ( rtmp->rt_zt == NULL ||
                            ( rtmp->rt_flags & RTMPTAB_ZIPQUERY ) ||
                            ( rtmp->rt_flags & RTMPTAB_HASZONES ) == 0 ) {
                        continue;
@@ -712,7 +714,7 @@ consistency()
 }
 #endif /* DEBUG */
 
-void
+static void
 as_debug(int sig _U_)
 {
     struct interface   *iface;
@@ -814,7 +816,7 @@ as_debug(int sig _U_)
 /*
  * Called when SIGTERM is recieved.  Remove all routes and then exit.
  */
-void
+static void
 as_down(int sig _U_)
 {
     struct interface   *iface;
@@ -1228,7 +1230,7 @@ int main( int ac, char **av)
  */
 void bootaddr(struct interface *iface)
 {
-    if ( iface == 0 ) {
+    if ( iface == NULL ) {
        return;
     }