]> arthur.barton.de Git - netatalk.git/commitdiff
remove most sparse warning 'Using plain integer as NULL pointer'
authordidg <didg>
Wed, 14 Oct 2009 02:24:04 +0000 (02:24 +0000)
committerdidg <didg>
Wed, 14 Oct 2009 02:24:04 +0000 (02:24 +0000)
32 files changed:
bin/megatron/hqx.c
bin/megatron/megatron.c
bin/nbp/nbplkup.c
bin/nbp/nbprgstr.c
bin/nbp/nbpunrgstr.c
bin/pap/pap.c
bin/psorder/pa.c
bin/psorder/psorder.c
etc/afpd/afp_asp.c
etc/afpd/afp_dsi.c
etc/afpd/hash.c
etc/afpd/main.c
etc/afpd/quota.c
etc/afpd/volume.c
etc/atalkd/config.c
etc/atalkd/main.c
etc/atalkd/nbp.c
etc/atalkd/rtmp.c
etc/atalkd/zip.c
etc/papd/file.c
etc/papd/main.c
etc/papd/ppd.c
etc/papd/printcap.c
etc/papd/session.c
etc/psf/psf.c
libatalk/nbp/nbp_rgstr.c
libatalk/nbp/nbp_unrgstr.c
libatalk/unicode/charsets/mac_chinese_simp.h
libatalk/unicode/charsets/mac_chinese_trad.h
libatalk/unicode/charsets/mac_japanese.h
libatalk/unicode/charsets/mac_korean.h
libatalk/util/server_child.c

index 8f303b0c5e7c7c2b2cfce150268eb044c54e2614..43db208df0e98ff0dfc450baf5c52b97ff7f5d7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: hqx.c,v 1.16 2009-10-14 01:38:28 didg Exp $
+ * $Id: hqx.c,v 1.17 2009-10-14 02:24:04 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -278,7 +278,7 @@ int hqx_header_read(struct FHeader *fh)
 #endif /* HEXOUTPUT */
 
     if (( headerbuf = 
-           (char *)malloc( (unsigned int)( namelen + BHH_HEADSIZ ))) == 0 ) {
+           (char *)malloc( (unsigned int)( namelen + BHH_HEADSIZ ))) == NULL ) {
        return( -1 );
     }
     if ( hqx_7tobin( headerbuf, ( namelen + BHH_HEADSIZ )) == 0 ) {
index 6bf52dd43f635ccdfed82e454387f89e40a19589..583465a9beec09eeaf3fb7bdbaa9c40d57fbcc80 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: megatron.c,v 1.12 2009-10-14 01:38:28 didg Exp $
+ * $Id: megatron.c,v 1.13 2009-10-14 02:24:04 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
     char       *progname, newname[ADEDLEN_NAME + 1];
 
     progname = strrchr( argv[ 0 ], '/' );
-    if (( progname == NULL ) || ( progname == '\0' )) {
+    if (( progname == NULL ) || ( *progname == '\0' )) {
        progname = argv[ 0 ];
     } else progname++;
 
index 2e3850f29f82068e9397b2fd6870d1d77ab61051..5f1e600340a4d3d09ecbd7a775b83e0d7cf6b78a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbplkup.c,v 1.7 2009-10-14 01:38:28 didg Exp $
+ * $Id: nbplkup.c,v 1.8 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -49,7 +49,7 @@ static void Usage(char *av0)
 {
     char       *p;
 
-    if (( p = strrchr( av0, '/' )) == 0 ) {
+    if (( p = strrchr( av0, '/' )) == NULL ) {
        p = av0;
     } else {
        p++;
index ab041ba8458ec2d5c47093594bd932c752479359..4bcf429839a189756a60bf30b271a60e8b21a18e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbprgstr.c,v 1.7 2009-10-14 01:38:28 didg Exp $
+ * $Id: nbprgstr.c,v 1.8 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -26,7 +26,7 @@ static void Usage(char *av0)
 {
     char       *p;
 
-    if (( p = strrchr( av0, '/' )) == 0 ) {
+    if (( p = strrchr( av0, '/' )) == NULL ) {
        p = av0;
     } else {
        p++;
@@ -40,8 +40,8 @@ int main(int ac, char **av)
 {
     struct sockaddr_at addr;
     struct at_addr      ataddr;
-    char               *Obj = 0, *Type = 0, *Zone = 0;
-    char               *convname = 0;
+    char               *Obj = NULL, *Type = NULL, *Zone = NULL;
+    char               *convname = NULL;
     int                        s, c, port = 0;
     charset_t          chMac = CH_MAC;
     
index d24251a0a78fe01aadf1be79d015be9ccebc575c..b3820466719e3c00085c700436efac6cb4a71017 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbpunrgstr.c,v 1.8 2009-10-14 01:38:28 didg Exp $
+ * $Id: nbpunrgstr.c,v 1.9 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -45,7 +45,7 @@ static void Usage(char *av0)
 {
     char       *p;
 
-    if (( p = strrchr( av0, '/' )) == 0 ) {
+    if (( p = strrchr( av0, '/' )) == NULL ) {
        p = av0;
     } else {
        p++;
@@ -57,8 +57,8 @@ static void Usage(char *av0)
 
 int main(int ac, char **av)
 {
-    char               *Obj = 0, *Type = 0, *Zone = 0;
-    char               *convname = 0;
+    char               *Obj = NULL, *Type = NULL, *Zone = NULL;
+    char               *convname = NULL;
     struct at_addr      addr;
     int                 c;
     charset_t          chMac = CH_MAC;
index de707217a2f8ac78eeb2fe85fd46f64be3d9a250..82f87c10c0d31c3e9a49fd817b61bdf5b03976be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: pap.c,v 1.12 2009-10-14 01:38:28 didg Exp $
+ * $Id: pap.c,v 1.13 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -321,7 +321,7 @@ int main( int ac, char      **av)
     cbuf[ 2 ] = cbuf[ 3 ] = 0;
     cbuf[ 4 ] = atp_sockaddr( atp )->sat_port;
     cbuf[ 5 ] = oquantum;      /* flow quantum */
-    if ( gettimeofday( &stv, 0 ) < 0 ) {
+    if ( gettimeofday( &stv, NULL ) < 0 ) {
        perror( "gettimeofday" );
        exit( 2 );
     }
@@ -329,7 +329,7 @@ int main( int ac, char      **av)
        if ( cuts ) {
            waiting = 0xffff;
        } else {
-           if ( gettimeofday( &tv, 0 ) < 0 ) {
+           if ( gettimeofday( &tv, NULL ) < 0 ) {
                perror( "gettimeofday" );
                exit( 2 );
            }
@@ -477,7 +477,7 @@ static int send_file( int fd, ATP atp, int lastfile)
     int                        cc, i;
     unsigned short     netseq;
 
-    if ( gettimeofday( &stv, 0 ) < 0 ) {
+    if ( gettimeofday( &stv, NULL ) < 0 ) {
        perror( "gettimeofday" );
        exit( 2 );
     }
@@ -503,7 +503,7 @@ static int send_file( int fd, ATP atp, int lastfile)
        if(debug){ printf( "READ %d >\n", seq ), fflush( stdout );}
 
     for (;;) {
-       if ( gettimeofday( &tv, 0 ) < 0 ) {
+       if ( gettimeofday( &tv, NULL ) < 0 ) {
            perror( "gettimeofday" );
            exit( 2 );
        }
@@ -539,7 +539,7 @@ static int send_file( int fd, ATP atp, int lastfile)
        }
        FD_SET( atp_fileno( atp ), &fds );
 
-       if (( cc = select( FD_SETSIZE, &fds, 0, 0, &tv )) < 0 ) {
+       if (( cc = select( FD_SETSIZE, &fds, NULL, NULL, &tv )) < 0 ) {
            perror( "select" );
            exit( 2 );
        }
index ef72fd5dd2b36be3bef3d764cb20e67fb045b20f..8728065ccb5ae3e9fafadd840ab6cef1fc23685d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: pa.c,v 1.5 2009-10-13 22:55:36 didg Exp $
+ * $Id: pa.c,v 1.6 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -47,7 +47,7 @@ pa_buf_t *pa_init(int fd)
        h->bufsz = PA_BUFBLK * 2;
 
        if (( rc = read( fd, h->buf, PA_BUFBLK )) < 0 ) {
-               return( 0 );
+               return( NULL );
        }
 
        h->cur = h->buf - 1;
index d2de6c87627fe3687ee604b1565b3d0c5aabb7c4..8d39b2840d11a11f48217577f3246bdd73621d6e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: psorder.c,v 1.8 2009-10-14 01:38:28 didg Exp $
+ * $Id: psorder.c,v 1.9 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -241,7 +241,7 @@ readps(int inputfd, int tempfd, char *tempfile)
 {
     off_t              ccread = 0;
     off_t              ccmatch;
-    char               *curtok = 0;
+    char               *curtok = NULL;
     FILE               *tempstream;
     pa_buf_t           *pb;
     int                        n;
index 94a0cd2d942e2640cba7edb22925a923c36dd2d9..23669c642a9444284db5802f1956aac8d26c5f08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_asp.c,v 1.25 2009-10-14 01:38:28 didg Exp $
+ * $Id: afp_asp.c,v 1.26 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -156,7 +156,7 @@ static void afp_asp_timedown(int sig _U_)
     it.it_interval.tv_usec = 0;
     it.it_value.tv_sec = 300;
     it.it_value.tv_usec = 0;
-    if ( setitimer( ITIMER_REAL, &it, 0 ) < 0 ) {
+    if ( setitimer( ITIMER_REAL, &it, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_timedown: setitimer: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
@@ -167,7 +167,7 @@ static void afp_asp_timedown(int sig _U_)
     sigaddset(&sv.sa_mask, SIGHUP);
     sigaddset(&sv.sa_mask, SIGTERM);
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGALRM, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGALRM, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_timedown: sigaction: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
@@ -176,7 +176,7 @@ static void afp_asp_timedown(int sig _U_)
     sv.sa_handler = SIG_IGN;
     sigemptyset( &sv.sa_mask );
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR1, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_timedown: sigaction SIGUSR1: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
@@ -231,7 +231,7 @@ void afp_over_asp(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR2);
 #endif    
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGHUP, &action, 0 ) < 0 ) {
+    if ( sigaction( SIGHUP, &action, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
@@ -245,7 +245,7 @@ void afp_over_asp(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR2);
 #endif    
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGTERM, &action, 0 ) < 0 ) {
+    if ( sigaction( SIGTERM, &action, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
@@ -258,7 +258,7 @@ void afp_over_asp(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR1);
     sigaddset(&action.sa_mask, SIGHUP);
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR2, &action, 0) < 0 ) {
+    if ( sigaction( SIGUSR2, &action, NULL) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
@@ -273,7 +273,7 @@ void afp_over_asp(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR2);
 #endif    
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR1, &action, 0 ) < 0 ) {
+    if ( sigaction( SIGUSR1, &action, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_asp: sigaction: %s", strerror(errno) );
         afp_asp_die(EXITERR_SYS);
     }
index 2803236379b1c4113d28ab878860b455df0ec7f5..8fdd42505501eb35fbc63d5b305cecf5c5f2577a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.39 2009-10-14 01:38:28 didg Exp $
+ * $Id: afp_dsi.c,v 1.40 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -122,7 +122,7 @@ static void afp_dsi_timedown(int sig _U_)
     it.it_value.tv_sec = 300;
     it.it_value.tv_usec = 0;
 
-    if ( setitimer( ITIMER_REAL, &it, 0 ) < 0 ) {
+    if ( setitimer( ITIMER_REAL, &it, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_timedown: setitimer: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
@@ -132,7 +132,7 @@ static void afp_dsi_timedown(int sig _U_)
     sigaddset(&sv.sa_mask, SIGHUP);
     sigaddset(&sv.sa_mask, SIGTERM);
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGALRM, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGALRM, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_timedown: sigaction: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
@@ -141,7 +141,7 @@ static void afp_dsi_timedown(int sig _U_)
     sv.sa_handler = SIG_IGN;
     sigemptyset( &sv.sa_mask );
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR1, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_timedown: sigaction SIGHUP: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
@@ -237,7 +237,7 @@ void afp_over_dsi(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR2);
 #endif    
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGHUP, &action, 0 ) < 0 ) {
+    if ( sigaction( SIGHUP, &action, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
@@ -252,7 +252,7 @@ void afp_over_dsi(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR2);
 #endif    
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGTERM, &action, 0 ) < 0 ) {
+    if ( sigaction( SIGTERM, &action, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
@@ -266,7 +266,7 @@ void afp_over_dsi(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR1);
     sigaddset(&action.sa_mask, SIGHUP);
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR2, &action, 0) < 0 ) {
+    if ( sigaction( SIGUSR2, &action, NULL) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
@@ -282,7 +282,7 @@ void afp_over_dsi(AFPObj *obj)
     sigaddset(&action.sa_mask, SIGUSR2);
 #endif    
     action.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR1, &action, 0) < 0 ) {
+    if ( sigaction( SIGUSR1, &action, NULL) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
         afp_dsi_die(EXITERR_SYS);
     }
index 454e12571159851fd26c7f2b21ee5671e8fbf3bc..50f4dc58ec08ed5808fd747260e08cedcd0e18e0 100644 (file)
@@ -14,7 +14,7 @@
  * into proprietary software; there is no requirement for such software to
  * contain a copyright notice related to this source.
  *
- * $Id: hash.c,v 1.1 2005-04-30 21:33:41 didg Exp $
+ * $Id: hash.c,v 1.2 2009-10-14 02:24:05 didg Exp $
  * $Name:  $
  */
 #define NDEBUG
@@ -26,7 +26,7 @@
 #include "hash.h"
 
 #ifdef KAZLIB_RCSID
-static const char rcsid[] = "$Id: hash.c,v 1.1 2005-04-30 21:33:41 didg Exp $";
+static const char rcsid[] = "$Id: hash.c,v 1.2 2009-10-14 02:24:05 didg Exp $";
 #endif
 
 #define INIT_BITS      6
@@ -170,9 +170,9 @@ static void grow_table(hash_t *hash)
        assert (mask != hash->mask);
 
        for (chain = 0; chain < hash->nchains; chain++) { /* 7 */
-           hnode_t *low_chain = 0, *high_chain = 0, *hptr, *next;
+           hnode_t *low_chain = NULL, *high_chain = NULL, *hptr, *next;
 
-           for (hptr = newtable[chain]; hptr != 0; hptr = next) {
+           for (hptr = newtable[chain]; hptr != NULL; hptr = next) {
                next = hptr->next;
 
                if (hptr->hkey & exposed_bit) {
@@ -240,9 +240,9 @@ static void shrink_table(hash_t *hash)
        high_chain = hash->table[chain + nchains];
        for (low_tail = low_chain; low_tail && low_tail->next; low_tail = low_tail->next)
            ;   /* 3 */
-       if (low_chain != 0)                             /* 4 */
+       if (low_chain != NULL)                          /* 4 */
            low_tail->next = high_chain;
-       else if (high_chain != 0)                       /* 5 */
+       else if (high_chain != NULL)                    /* 5 */
            hash->table[chain] = high_chain;
        else
            assert (hash->table[chain] == NULL);        /* 6 */
@@ -439,7 +439,7 @@ void hash_scan_begin(hscan_t *scan, hash_t *hash)
 
     /* 1 */
 
-    for (chain = 0; chain < nchains && hash->table[chain] == 0; chain++)
+    for (chain = 0; chain < nchains && hash->table[chain] == NULL; chain++)
        ;
 
     if (chain < nchains) {     /* 2 */
@@ -489,7 +489,7 @@ hnode_t *hash_scan_next(hscan_t *scan)
        if (next->next) {       /* 4 */
            scan->next = next->next;
        } else {
-           while (chain < nchains && hash->table[chain] == 0)  /* 5 */
+           while (chain < nchains && hash->table[chain] == NULL)       /* 5 */
                chain++;
            if (chain < nchains) {      /* 6 */
                scan->chain = chain;
@@ -704,7 +704,7 @@ int hash_verify(hash_t *hash)
     }
 
     for (chain = 0; chain < hash->nchains; chain++) {  /* 2 */
-       for (hptr = hash->table[chain]; hptr != 0; hptr = hptr->next) {
+       for (hptr = hash->table[chain]; hptr != NULL; hptr = hptr->next) {
            if ((hptr->hkey & hash->mask) != chain)
                return 0;
            count++;
index 5fa895c5b2ab229911ac9aa466213322971f569f..ffe409e08e05b608fb55b23e5328e7cb47496161 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.25 2009-10-13 22:55:37 didg Exp $
+ * $Id: main.c,v 1.26 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -219,7 +219,7 @@ int main(int ac, char **av)
     sigaddset(&sv.sa_mask, SIGUSR1);
     
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGCHLD, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGCHLD, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
         afp_exit(EXITERR_SYS);
     }
@@ -231,7 +231,7 @@ int main(int ac, char **av)
     sigaddset(&sv.sa_mask, SIGHUP);
     sigaddset(&sv.sa_mask, SIGCHLD);
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGUSR1, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGUSR1, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
         afp_exit(EXITERR_SYS);
     }
@@ -242,7 +242,7 @@ int main(int ac, char **av)
     sigaddset(&sv.sa_mask, SIGUSR1);
     sigaddset(&sv.sa_mask, SIGCHLD);
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGHUP, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGHUP, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
         afp_exit(EXITERR_SYS);
     }
@@ -254,7 +254,7 @@ int main(int ac, char **av)
     sigaddset(&sv.sa_mask, SIGUSR1);
     sigaddset(&sv.sa_mask, SIGCHLD);
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGTERM, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGTERM, &sv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
         afp_exit(EXITERR_SYS);
     }
index b5d52375c5c2f1e936c0f648185094cb05402d1e..2a12ca5e73e9932a6167e78cd3257f2a99616f06 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.31 2009-10-13 22:55:37 didg Exp $
+ * $Id: quota.c,v 1.32 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -642,7 +642,7 @@ static int overquota( struct dqblk *dqblk)
         return( 0 );
     }
 #else /* ultrix */
-    if ( gettimeofday( &tv, 0 ) < 0 ) {
+    if ( gettimeofday( &tv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "overquota: gettimeofday: %s", strerror(errno) );
         return( AFPERR_PARAM );
     }
index 1a6390c654dfd11fe52689aea9aba8762afe1973..026b0e0a0aaa72b162b557662dd8276ff1d1ecfa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.92 2009-10-13 22:55:37 didg Exp $
+ * $Id: volume.c,v 1.93 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1734,7 +1734,7 @@ int afp_getsrvrparms(AFPObj *obj, char *ibuf _U_, int ibuflen _U_, char *rbuf, i
 
     *rbuflen = data - rbuf;
     data = rbuf;
-    if ( gettimeofday( &tv, 0 ) < 0 ) {
+    if ( gettimeofday( &tv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "afp_getsrvrparms(%s): gettimeofday: %s", volume->v_path, strerror(errno) );
         *rbuflen = 0;
         return AFPERR_PARAM;
@@ -2145,7 +2145,7 @@ int  pollvoltime(AFPObj *obj)
     if (!(afp_version > 21 && obj->options.server_notif)) 
          return 0;
 
-    if ( gettimeofday( &tv, 0 ) < 0 ) 
+    if ( gettimeofday( &tv, NULL ) < 0 ) 
          return 0;
 
     for ( vol = Volumes; vol; vol = vol->v_next ) {
@@ -2172,7 +2172,7 @@ void setvoltime(AFPObj *obj, struct vol *vol)
      * the afpd processes would come closer)
      * [RS] */
 
-    if ( gettimeofday( &tv, 0 ) < 0 ) {
+    if ( gettimeofday( &tv, NULL ) < 0 ) {
         LOG(log_error, logtype_afpd, "setvoltime(%s): gettimeofday: %s", vol->v_path, strerror(errno) );
         return;
     }
index fb19303d684db79f4918c63d77f5890449bc487c..09ee47eb9c0aa35ba3c4263667b3bbd159feddac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.c,v 1.18 2009-10-14 01:38:28 didg Exp $
+ * $Id: config.c,v 1.19 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -576,7 +576,7 @@ int net(struct interface *iface, char **av)
        return -1;
     }
 
-    if (( stop = strchr( nrange, '-' )) != 0 ) {
+    if (( stop = strchr( nrange, '-' )) != NULL ) {
        stop++;
     }
     net = atoi( nrange );
@@ -591,7 +591,7 @@ int net(struct interface *iface, char **av)
     }
 
     if ( iface->i_flags & IFACE_PHASE1 ) {
-       if ( stop != 0 ) {
+       if ( stop != NULL ) {
            fprintf( stderr, "Phase 1 doesn't use an address range.\n" );
            return -1;
        }
@@ -604,7 +604,7 @@ int net(struct interface *iface, char **av)
        iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = htons( net );
     } else if ( iface->i_flags & IFACE_PHASE2 ) {
        iface->i_rt->rt_firstnet = htons( net );
-       if ( stop != 0 ) {
+       if ( stop != NULL ) {
            net = atoi( stop );
            if ( net < 0 || net >= 0xffff ) {
                fprintf( stderr, "Bad network: %d\n", net );
index 01eb92a02a0c6e4b96f4d1f016c9abda0d617e70..b8080c29150a56646de93a5f2b167911a9e1578e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.21 2009-10-14 01:38:28 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.
@@ -331,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;
@@ -345,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 */
@@ -366,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;
@@ -424,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 ) {
@@ -576,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;
@@ -1230,7 +1230,7 @@ int main( int ac, char **av)
  */
 void bootaddr(struct interface *iface)
 {
-    if ( iface == 0 ) {
+    if ( iface == NULL ) {
        return;
     }
 
index 771943817dcc0c4078e754549b435f929efef4df..1e4ea4fbfcc652eaf7e019b094d72f47a9adef68 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbp.c,v 1.12 2009-10-13 22:55:37 didg Exp $
+ * $Id: nbp.c,v 1.13 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -165,7 +165,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
            if ( interfaces->i_next->i_rt->rt_zt ) {
                zt = (struct ziptab *)interfaces->i_next->i_rt->rt_zt->l_data;
            } else {
-               zt = 0;
+               zt = NULL;
            }
        } else {
            for ( zt = ziptab; zt; zt = zt->zt_next ) {
@@ -174,7 +174,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
                    break;
                }
            }
-           if ( zt == 0 ) {
+           if ( zt == NULL ) {
                nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from );
                return 0;
            }
@@ -184,7 +184,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
         * Observe that we don't have to do any local-zone verification
         * if the zone aleady has a multicast address set.
         */
-       if ( zt != 0 && zt->zt_bcast == 0 ) {
+       if ( zt != NULL && zt->zt_bcast == NULL ) {
            /*
             * Check if zone is associated with any of our local interfaces.
             */
@@ -194,11 +194,11 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
                        break;
                    }
                }
-               if ( l != 0 ) {
+               if ( l != NULL ) {
                    break;
                }
            }
-           if ( iface == 0 ) {
+           if ( iface == NULL ) {
                nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from );
                return 0;
            }
@@ -227,14 +227,14 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
        }
 
        if (( ntab = (struct nbptab *)malloc( sizeof( struct nbptab )))
-               == 0 ) {
+               == NULL ) {
            LOG(log_error, logtype_atalkd, "nbp_packet: malloc: %s", strerror(errno) );
            return -1;
        }
        memcpy( &ntab->nt_nve, &nn, sizeof( struct nbpnve ));
        ntab->nt_iface = ap->ap_iface;
        ntab->nt_next = nbptab;
-       ntab->nt_prev = 0;
+       ntab->nt_prev = NULL;
        if ( nbptab ) {
            nbptab->nt_prev = ntab;
        }
@@ -297,15 +297,15 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
                break;
            }
        }
-       if ( ntab == 0 ) {
+       if ( ntab == NULL ) {
            nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from );
            return 0;
        }
 
-       if ( ntab->nt_next != 0 ) {
+       if ( ntab->nt_next != NULL ) {
            ntab->nt_next->nt_prev = ntab->nt_prev;
        }
-       if ( ntab->nt_prev != 0 ) {
+       if ( ntab->nt_prev != NULL ) {
            ntab->nt_prev->nt_next = ntab->nt_next;
        }
        if ( ntab == nbptab ) {
@@ -362,7 +362,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
                    break;
                }
            }
-           if ( zt == 0 ) {
+           if ( zt == NULL ) {
                nbp_ack( ap->ap_fd, NBPOP_ERROR, (int)nh.nh_id, from );
                return 0;
            }
@@ -372,7 +372,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
         * If we've got no zones, send out LKUP on the local net.
         * Otherwise, look through the zone table.
         */
-       if ( zt == 0 ) {
+       if ( zt == NULL ) {
 #ifdef BSD4_4
            sat.sat_len = sizeof( struct sockaddr_at );
 #endif /* BSD4_4 */
@@ -392,7 +392,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
                    break;
                }
            }
-           if ( iface == 0 ) {
+           if ( iface == NULL ) {
                return 0;
            }
            for ( ap = iface->i_ports; ap; ap = ap->ap_next ) {
@@ -416,7 +416,7 @@ int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len)
            for ( l = zt->zt_rt; l; l = l->l_next ) {
                rtmp = (struct rtmptab *)l->l_data;
 
-               if ( rtmp->rt_gate == 0 ) {
+               if ( rtmp->rt_gate == NULL ) {
                    for ( iface = interfaces; iface;
                            iface = iface->i_next ) {
                        if ( iface->i_rt == rtmp ) {
@@ -444,7 +444,7 @@ Can't find route's interface!" );
 
                if ( transition &&
                        ( rtmp->rt_flags & RTMPTAB_EXTENDED ) == 0 ) {
-                   if ( rtmp->rt_gate == 0 ) {
+                   if ( rtmp->rt_gate == NULL ) {
                        locallkup = 1;
                    }
                    nh.nh_op = NBPOP_LKUP;
@@ -452,7 +452,7 @@ Can't find route's interface!" );
                    sat.sat_addr.s_net = rtmp->rt_firstnet;
                    sat.sat_addr.s_node = ATADDR_BCAST;
                } else {
-                   if ( rtmp->rt_gate == 0 ) {
+                   if ( rtmp->rt_gate == NULL ) {
                        nh.nh_op = NBPOP_LKUP;
                        memcpy( nbpop, &nh, SZ_NBPHDR );
                        sat.sat_addr.s_net = 0;
index dc61575485d7eca1d4990a2c0bc5c95c10fe3f06..13a8f25f02a83c04d4bc84b5a4162abc81043e2b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rtmp.c,v 1.15 2009-10-13 22:55:37 didg Exp $
+ * $Id: rtmp.c,v 1.16 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -551,13 +551,13 @@ int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len
            }
        }
        if ( !gate ) {  /* new gateway */
-           if (( gate = (struct gate *)malloc( sizeof( struct gate ))) == 0 ) {
+           if (( gate = (struct gate *)malloc( sizeof( struct gate ))) == NULL ) {
                LOG(log_error, logtype_atalkd, "rtmp_packet: malloc: %s", strerror(errno) );
                return -1;
            }
            gate->g_next = iface->i_gate;
-           gate->g_prev = 0;
-           gate->g_rt = 0;
+           gate->g_prev = NULL;
+           gate->g_rt = NULL;
            gate->g_iface = iface;      /* need this? */
            gate->g_sat = *from;
            if ( iface->i_gate ) {
@@ -680,10 +680,10 @@ int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len
                 * we're not likely to be asked for the same tuple twice
                 * in a row.
                 */
-               if ( rtmp->rt_next != 0 ) {
+               if ( rtmp->rt_next != NULL ) {
                    gate->g_rt->rt_prev->rt_next = gate->g_rt;
                    gate->g_rt = rtmp->rt_next;
-                   rtmp->rt_next = 0;
+                   rtmp->rt_next = NULL;
                }
            } else if (( rt.rt_dist & 0x7f ) + 1 > RTMPHOPS_MAX ) {
                LOG(log_info, logtype_atalkd, "rtmp_packet bad hop count from %u.%u for %u",
@@ -708,7 +708,7 @@ int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len
                /*
                 * Add rtmptab entry to end of list (leave head alone).
                 */
-               if ( gate->g_rt == 0 ) {
+               if ( gate->g_rt == NULL ) {
                    rtmp->rt_prev = rtmp;
                    gate->g_rt = rtmp;
                } else {
@@ -751,7 +751,7 @@ int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len
         * Request and RDR.
         */
         if (((iface->i_flags & IFACE_ISROUTER) == 0) ||
-           iface->i_rt->rt_zt == 0 ||
+           iface->i_rt->rt_zt == NULL ||
            ( iface->i_flags & IFACE_CONFIG ) == 0 ) {
            return 0;
        }
@@ -814,7 +814,7 @@ int rtmp_request( struct interface *iface)
            break;
        }
     }
-    if ( ap == 0 ) {
+    if ( ap == NULL ) {
        LOG(log_error, logtype_atalkd, "rtmp_request can't find rtmp socket!" );
        return -1;
     }
@@ -972,8 +972,8 @@ newrt(const struct interface *iface)
 {
     struct rtmptab     *rtmp;
 
-    if (( rtmp = (struct rtmptab *)calloc(1, sizeof(struct rtmptab))) == 0 ) {
-       return( 0 );
+    if (( rtmp = (struct rtmptab *)calloc(1, sizeof(struct rtmptab))) == NULL ) {
+       return( NULL );
     }
 
     rtmp->rt_iface = iface;
index ea73c99e8df23db95b709d95189a745ece7cefce..0144576d5d37e08242cca60d232d8e1cac07402e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: zip.c,v 1.13 2009-10-13 22:55:37 didg Exp $
+ * $Id: zip.c,v 1.14 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -66,7 +66,7 @@ static int zonecheck(struct rtmptab *rtmp, struct interface *iface)
                break;
            }
        }
-       if ( l == 0 ) {
+       if ( l == NULL ) {
            LOG(log_error, logtype_atalkd, "zonecheck: %.*s not in zone list", czt->zt_len,
                    czt->zt_name );
            return( -1 );       /* configured zone not found in net zones */
@@ -150,7 +150,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                        break;
                    }
                }
-               if ( rtmp == 0 ) {
+               if ( rtmp == NULL ) {
                    continue;
                }
 
@@ -299,10 +299,10 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                    /*
                     * Update head to this rtmp entry.
                     */
-                   if ( rtmp != 0 && gate->g_rt != rtmp ) {
+                   if ( rtmp != NULL && gate->g_rt != rtmp ) {
                        gate->g_rt->rt_prev->rt_next = gate->g_rt;
                        gate->g_rt = rtmp;
-                       rtmp->rt_prev->rt_next = 0;
+                       rtmp->rt_prev->rt_next = NULL;
                    }
                }
 
@@ -322,7 +322,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                 * We won't find any rtmp entry if the gateway is no longer
                 * telling us about the entry.
                 */
-               if ( rtmp == 0 ) {
+               if ( rtmp == NULL ) {
                    LOG(log_info, logtype_atalkd, "zip skip reply %u from %u.%u (no rtmp)",
                            ntohs( firstnet ), ntohs( from->sat_addr.s_net ),
                            from->sat_addr.s_node );
@@ -360,7 +360,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
 
            if ( rtmp && rtmp->rt_flags & RTMPTAB_HASZONES ) {
                /* XXX */
-               if ( rtmp->rt_gate == 0 &&
+               if ( rtmp->rt_gate == NULL &&
                        zonecheck( rtmp, gate->g_iface ) != 0 ) {
                    LOG(log_error, logtype_atalkd, "zip_packet seed zonelist mismatch" );
                    return -1;
@@ -408,7 +408,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                            from->sat_addr.s_node );
                    return 1;
                }
-               if ( rtmp->rt_iprev == 0 ) {
+               if ( rtmp->rt_iprev == NULL ) {
                    LOG(log_info, logtype_atalkd,
                            "zip ereply %u-%u from %u.%u (rtmp not in use)",
                            ntohs( rtmp->rt_firstnet ),
@@ -418,10 +418,10 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                }
 
                /* update head to *next* rtmp entry */
-               if ( rtmp->rt_next != 0 ) {
+               if ( rtmp->rt_next != NULL ) {
                    gate->g_rt->rt_prev->rt_next = gate->g_rt;
                    gate->g_rt = rtmp->rt_next;
-                   rtmp->rt_next = 0;
+                   rtmp->rt_next = NULL;
                }
            }
 
@@ -478,7 +478,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                if ( n == zh.zh_count ) {
                    rtmp->rt_flags |= RTMPTAB_HASZONES;
                    /* XXX */
-                   if ( rtmp->rt_gate == 0 &&
+                   if ( rtmp->rt_gate == NULL &&
                            zonecheck( rtmp, gate->g_iface ) != 0 ) {
                        LOG(log_error, logtype_atalkd, "zip_packet seed zonelist mismatch" );
                        return -1;
@@ -493,7 +493,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
             * Don't answer with bogus information.
             */
            if (((iface->i_flags & IFACE_ISROUTER) == 0) ||
-               iface->i_rt->rt_zt == 0 ||
+               iface->i_rt->rt_zt == NULL ||
                ( iface->i_flags & IFACE_CONFIG ) == 0 ) {
                return 0;
            }
@@ -549,7 +549,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                    break;
                }
            }
-           if ( l == 0 ) {
+           if ( l == NULL ) {
                zt = (struct ziptab *)iface->i_rt->rt_zt->l_data;
                zh.zh_flags |= ZIPGNI_INVALID;
            }
@@ -806,7 +806,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                return 0;
            }
 
-           if ( iface->i_rt->rt_zt == 0 ) {
+           if ( iface->i_rt->rt_zt == NULL ) {
                return 0;
            }
            zt = (struct ziptab *)iface->i_rt->rt_zt->l_data;
@@ -834,7 +834,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                data += zt->zt_len;
            }
 
-           *lastflag = ( zt == 0 );            /* Too clever? */
+           *lastflag = ( zt == NULL );         /* Too clever? */
            break;
 
        case ZIPOP_GETLOCALZONES :
@@ -860,7 +860,7 @@ int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len)
                data += zt->zt_len;
            }
 
-           *lastflag = ( l == 0 );
+           *lastflag = ( l == NULL );
            break;
 
        default :
@@ -907,7 +907,7 @@ int zip_getnetinfo(struct interface *iface)
            break;
        }
     }
-    if ( ap == 0 ) {
+    if ( ap == NULL ) {
        LOG(log_error, logtype_atalkd, "zip_getnetinfo can't find zip socket!" );
        return -1;
     }
index 27a17c4536303c8ff02a4a8e223ca3b229024a8b..068b5d71634418e09f884d0e86e09e2f0df1171b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.11 2009-10-13 22:55:37 didg Exp $
+ * $Id: file.c,v 1.12 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -77,11 +77,11 @@ void morespace(struct papfile *pf, const char *data, int len)
        nsize = (( pf->pf_bufsize + len ) / PF_MORESPACE +
                (( pf->pf_bufsize + len ) % PF_MORESPACE != 0 )) * PF_MORESPACE;
        if ( pf->pf_buf ) {
-           if (( nbuf = (char *)realloc( pf->pf_buf, nsize )) == 0 ) {
+           if (( nbuf = (char *)realloc( pf->pf_buf, nsize )) == NULL ) {
                exit( 1 );
            }
        } else {
-           if (( nbuf = (char *)malloc( nsize )) == 0 ) {
+           if (( nbuf = (char *)malloc( nsize )) == NULL ) {
                exit( 1 );
            }
        }
index 668594837aa58cc19ec8a1721ef39b84f925da85..fb243039f4959ae518b8b3dc927960c7f62c9239 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.28 2009-10-14 01:38:28 didg Exp $
+ * $Id: main.c,v 1.29 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -139,7 +139,7 @@ reap(int sig _U_)
     int                status;
     int                pid;
 
-    while (( pid = wait3( &status, WNOHANG, 0 )) > 0 ) {
+    while (( pid = wait3( &status, WNOHANG, NULL )) > 0 ) {
        if ( WIFEXITED( status )) {
            if ( WEXITSTATUS( status )) {
                LOG(log_error, logtype_papd, "child %d exited with %d", pid,
@@ -181,7 +181,7 @@ int main(int ac, char **av)
        perror( "gethostname" );
        exit( 1 );
     }
-    if (( p = strchr( hostname, '.' )) != 0 ) {
+    if (( p = strchr( hostname, '.' )) != NULL ) {
        *p = '\0';
     }
     if (( defprinter.p_name = (char *)malloc( strlen( hostname ) + 1 ))
@@ -322,7 +322,7 @@ int main(int ac, char **av)
     sv.sa_handler = die;
     sigemptyset( &sv.sa_mask );
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGTERM, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGTERM, &sv, NULL ) < 0 ) {
        LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) );
        papd_exit( 1 );
     }
@@ -330,7 +330,7 @@ int main(int ac, char **av)
     sv.sa_handler = reap;
     sigemptyset( &sv.sa_mask );
     sv.sa_flags = SA_RESTART;
-    if ( sigaction( SIGCHLD, &sv, 0 ) < 0 ) {
+    if ( sigaction( SIGCHLD, &sv, NULL ) < 0 ) {
        LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) );
        papd_exit( 1 );
     }
@@ -348,7 +348,7 @@ int main(int ac, char **av)
        for ( pr = printers; pr; pr = pr->p_next ) {
            FD_SET( atp_fileno( pr->p_atp ), &fdset );
        }
-       if (( c = select( FD_SETSIZE, &fdset, 0, 0, 0 )) < 0 ) {
+       if (( c = select( FD_SETSIZE, &fdset, NULL, NULL, NULL )) < 0 ) {
            if ( errno == EINTR ) {
                continue;
            }
@@ -478,12 +478,12 @@ int main(int ac, char **av)
                        sv.sa_handler = SIG_DFL;
                        sigemptyset( &sv.sa_mask );
                        sv.sa_flags = SA_RESTART;
-                       if ( sigaction( SIGTERM, &sv, 0 ) < 0 ) {
+                       if ( sigaction( SIGTERM, &sv, NULL ) < 0 ) {
                            LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) );
                            exit( 1 );
                        }
                        
-                       if ( sigaction( SIGCHLD, &sv, 0 ) < 0 ) {
+                       if ( sigaction( SIGCHLD, &sv, NULL ) < 0 ) {
                            LOG(log_error, logtype_papd, "sigaction: %s", strerror(errno) );
                            exit( 1 );
                         }
index 63bf91b98de88dd87a932e1c3316cf41a5e0e018..f16469289f9a4af9af93cba62fad839025affefe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ppd.c,v 1.16 2009-10-13 22:55:37 didg Exp $
+ * $Id: ppd.c,v 1.17 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 struct ppd_font                *ppd_fonts = NULL;
 
 struct ppd_feature     ppd_features[] = {
-    { "*LanguageLevel",        0 },
-    { "*PSVersion",    0 },
+    { "*LanguageLevel",        NULL },
+    { "*PSVersion",    NULL },
 #ifdef HAVE_CUPS
     { "*FreeVM",       "33554432" },
 #else
-    { "*FreeVM",       0 },
+    { "*FreeVM",       NULL },
 #endif
-    { "*Product",      0 },
-    { "*PCFileName",   0 },
-    { "*ModelName",    0 },
-    { "*NickName",     0 },
-    { "*ColorDevice",  0 },
-    { "*FaxSupport",   0 },
-    { "*TTRasterizer", 0 },
-    { 0, 0 },
+    { "*Product",      NULL },
+    { "*PCFileName",   NULL },
+    { "*ModelName",    NULL },
+    { "*NickName",     NULL },
+    { "*ColorDevice",  NULL },
+    { "*FaxSupport",   NULL },
+    { "*TTRasterizer", NULL },
+    { NULL, NULL },
 };
 
 struct ppdent {
index 67304d813d3cb2dbea29308ba9ad00eac5c52022..9215a11139794d3765fe90803aaf98d06e106230 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: printcap.c,v 1.11 2009-10-13 22:55:37 didg Exp $
+ * $Id: printcap.c,v 1.12 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -466,11 +466,11 @@ tgetstr(char *id, char **area)
        for (;;) {
                bp = tskip(bp);
                if (!*bp)
-                       return (0);
+                       return (NULL);
                if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1])
                        continue;
                if (*bp == '@')
-                       return(0);
+                       return(NULL);
                if (*bp != '=')
                        continue;
                bp++;
index 4da0b27eda5aa9cfa29f3b2d79ed1c07813d6233..d59680559b35fc527d10487cefa950105fb91517 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: session.c,v 1.18 2009-10-14 01:38:28 didg Exp $
+ * $Id: session.c,v 1.19 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -77,14 +77,14 @@ int session(ATP atp, struct sockaddr_at *sat)
     infile.pf_state = PF_BOT;
     infile.pf_bufsize = 0;
     infile.pf_datalen = 0;
-    infile.pf_buf = 0;
-    infile.pf_data = 0;
+    infile.pf_buf = NULL;
+    infile.pf_data = NULL;
 
     outfile.pf_state = PF_BOT;
     outfile.pf_bufsize = 0;
     outfile.pf_datalen = 0;
-    outfile.pf_buf = 0;
-    outfile.pf_data = 0;
+    outfile.pf_buf = NULL;
+    outfile.pf_data = NULL;
 
     /*
      * Ask for data.
@@ -118,7 +118,7 @@ int session(ATP atp, struct sockaddr_at *sat)
        FD_SET( atp_fileno( atp ), &fds );
 
        do { /* do list until success or an unrecoverable error occurs */
-         if (( cc = select( FD_SETSIZE, &fds, 0, 0, &tv )) < 0 )
+         if (( cc = select( FD_SETSIZE, &fds, NULL, NULL, &tv )) < 0 )
              LOG(log_error, logtype_papd, "select: %s", strerror(errno) ); /* log all errors */
        } while (( cc < 0 ) && (errno == 4));
 
index 7498b93de74bdd1104f5c7ea999142191b2f9974..b0a21b09a7fe27a2cb2e3348dcf72d30df216d6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: psf.c,v 1.11 2009-10-14 01:38:28 didg Exp $
+ * $Id: psf.c,v 1.12 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1995 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -56,7 +56,7 @@ int copyio();
 int textps();
 
 static char            psapath[] = _PATH_PSA;
-static char            *psaargv[] = { "psa", 0, 0, 0, 0 };
+static char            *psaargv[] = { "psa", NULL, NULL, NULL, NULL };
 
 /*
  * If we're not doing accounting, we just call pap as below.
@@ -66,12 +66,12 @@ static char         *psaargv[] = { "psa", 0, 0, 0, 0 };
  * in arg 3, and 0 in arg 4.
  */
 static char            pappath[] = _PATH_PAP;
-static char            *papargv[] = { "pap", "-sstatus", 0, 0, 0, 0, 0, 0 };
+static char            *papargv[] = { "pap", "-sstatus", NULL, NULL, NULL, NULL, NULL, NULL };
 
 static char            revpath[] = _PATH_PSORDER;
-static char            *revargv[] = { "psorder", "-d", 0 };
+static char            *revargv[] = { "psorder", "-d", NULL };
 
-static char            *filtargv[] = { 0, 0, 0 };
+static char            *filtargv[] = { NULL, NULL, NULL };
 
 static char            inbuf[ 1024 * 8 ];
 static int             inlen;
@@ -224,20 +224,20 @@ restart:
                    papargv[ 4 ] = "-E";
                    papargv[ 5 ] = _PATH_PAGECOUNT;
                    papargv[ 6 ] = "-";
-                   papargv[ 7 ] = 0;
+                   papargv[ 7 ] = NULL;
                } else if ( waitidle ) {
                    papargv[ 2 ] = "-w";
                    papargv[ 3 ] = "-c";
                    papargv[ 4 ] = "-E";
                    papargv[ 5 ] = _PATH_PAGECOUNT;
                    papargv[ 6 ] = "-";
-                   papargv[ 7 ] = 0;
+                   papargv[ 7 ] = NULL;
                } else {
                    papargv[ 2 ] = "-c";
                    papargv[ 3 ] = "-E";
                    papargv[ 4 ] = _PATH_PAGECOUNT;
                    papargv[ 5 ] = "-";
-                   papargv[ 6 ] = 0;
+                   papargv[ 6 ] = NULL;
                }
            } else {
                /*
@@ -247,13 +247,13 @@ restart:
                papargv[ 3 ] = _PATH_PAGECOUNT;
                papargv[ 4 ] = "-";
                papargv[ 5 ] = _PATH_PAGECOUNT;
-               papargv[ 6 ] = 0;
+               papargv[ 6 ] = NULL;
            }
 #endif /* FUCKED */
        } else {
            papargv[ 2 ] = "-c";
            papargv[ 3 ] = "-E";
-           papargv[ 4 ] = 0;
+           papargv[ 4 ] = NULL;
        }
 
        if (( c = pexecv( pappath, papargv )) < 0 ) {
@@ -311,14 +311,14 @@ restart:
        if ( waitidle2 ) {
            papargv[ 3 ] = "-W";
            papargv[ 4 ] = _PATH_PAGECOUNT;
-           papargv[ 5 ] = 0;
+           papargv[ 5 ] = NULL;
        } else if ( waitidle ) {
            papargv[ 3 ] = "-w";
            papargv[ 4 ] = _PATH_PAGECOUNT;
-           papargv[ 5 ] = 0;
+           papargv[ 5 ] = NULL;
        } else {
            papargv[ 3 ] = _PATH_PAGECOUNT;
-           papargv[ 4 ] = 0;
+           papargv[ 4 ] = NULL;
        }
 
        if (( c = pexecv( pappath, papargv )) < 0 ) {
@@ -334,7 +334,7 @@ restart:
        close( 1 );
     }
     while ( children ) {
-       if (( c = wait3( &status, 0, 0 )) < 0 ) {
+       if (( c = wait3( &status, 0, NULL )) < 0 ) {
            syslog( LOG_ERR, "wait3: %s", strerror(errno) );
            exit( 1 );
        }
index cf5ee99927c673f93b2523cc429d750b44332565..d09e8669ebdd19fb95d263737bccf5d789c5a829 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbp_rgstr.c,v 1.5 2009-10-13 22:55:37 didg Exp $
+ * $Id: nbp_rgstr.c,v 1.6 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -119,7 +119,7 @@ int nbp_rgstr( struct sockaddr_at *sat, const char *obj, const char *type, const
     FD_SET( s, &readfd );
     timeout.tv_sec = 2;
     timeout.tv_usec = 0;
-    if (( cc = select( s + 1, &readfd, 0, 0, &timeout )) < 0 ) {
+    if (( cc = select( s + 1, &readfd, NULL, NULL, &timeout )) < 0 ) {
         goto register_err;
     }
     if ( cc == 0 ) {
index 9a2169b2041653c6920557338e699abd602452f0..b16497dddcb19d8af761d75d3e52479f6984634c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: nbp_unrgstr.c,v 1.5 2009-10-13 22:55:37 didg Exp $
+ * $Id: nbp_unrgstr.c,v 1.6 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1990,1997 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -115,7 +115,7 @@ int nbp_unrgstr(const char *obj,const char *type,const char  *zone, const struct
     FD_SET( s, &readfd );
     timeout.tv_sec = 2;
     timeout.tv_usec = 0;
-    if (( cc = select( s + 1, &readfd, 0, 0, &timeout )) < 0 ) {
+    if (( cc = select( s + 1, &readfd, NULL, NULL, &timeout )) < 0 ) {
         goto unregister_err;
     }
     if ( cc == 0 ) {
index 105f1506835d4f7b212b165bca0fbe05ad6acb1a..9e7d8cea88a922d48b07f5f5f06a297aa0118b72 100644 (file)
@@ -83,7 +83,7 @@ static const cjk_index_t mac_chinese_simp_uni2_index[] = {
   { { 0xf880, 0xf88f }, mac_chinese_simp_uni2_pagef8 },
   { { 0xfe30, 0xfe4f }, mac_chinese_simp_uni2_pagefe },
   { { 0xff50, 0xffef }, mac_chinese_simp_uni2_pageff },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_chinese_simp_uni2_charset[] = {
@@ -126,7 +126,7 @@ static const cjk_index_t mac_chinese_simp_2uni_index[] = {
   { { 0xa3a0, 0xa3ff }, mac_chinese_simp_2uni_pagea3 },
   { { 0xa6d0, 0xa6ff }, mac_chinese_simp_2uni_pagea6 },
   { { 0xa8b0, 0xa8cf }, mac_chinese_simp_2uni_pagea8 },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_chinese_simp_2uni_charset[] = {
index 2747f358e4120c944b918b5f6e3f5dcfb6326788..a5c94eb1f6fdc434d8bf2429177b1ad6caf6d286 100644 (file)
@@ -72,7 +72,7 @@ static const cjk_index_t mac_chinese_trad_uni2_index[] = {
   { { 0xf880, 0xf88f }, mac_chinese_trad_uni2_pagef8 },
   { { 0xfe40, 0xfe5f }, mac_chinese_trad_uni2_pagefe },
   { { 0xff60, 0xff6f }, mac_chinese_trad_uni2_pageff },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_chinese_trad_uni2_charset[] = {
@@ -103,7 +103,7 @@ static const u_int16_t mac_chinese_trad_2uni_pagea1[][2] = {
 static const cjk_index_t mac_chinese_trad_2uni_index[] = {
   { { 0x0080, 0x00ff }, mac_chinese_trad_2uni_page00 },
   { { 0xa140, 0xa2cf }, mac_chinese_trad_2uni_pagea1 },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_chinese_trad_2uni_charset[] = {
index d032a83483aa8e4991e4b53de535341af2772dcc..b0be8697177e07664a20807321b62a2849ef8a4f 100644 (file)
@@ -92,7 +92,7 @@ static const cjk_index_t mac_japanese_uni2_index[] = {
   { { 0x3220, 0x33df }, mac_japanese_uni2_page32 },
   { { 0xe000, 0xe04f }, mac_japanese_uni2_pagee0 },
   { { 0xfe30, 0xff3f }, mac_japanese_uni2_pagefe },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_japanese_uni2_charset[] = {
@@ -182,7 +182,7 @@ static const cjk_index_t mac_japanese_2uni_index[] = {
   { { 0x8150, 0x815f }, mac_japanese_2uni_page81 },
   { { 0x8540, 0x886f }, mac_japanese_2uni_page85 },
   { { 0xeb40, 0xed9f }, mac_japanese_2uni_pageeb },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_japanese_2uni_charset[] = {
index 578ac5164020d5ac32f8118563080ae49844a79a..4e990533d266f78ed40190a632a5299d716aa6fb 100644 (file)
@@ -138,7 +138,7 @@ static const cjk_index_t mac_korean_uni2_index[] = {
   { { 0xe000, 0xe41f }, mac_korean_uni2_pagee0 },
   { { 0xf800, 0xf84f }, mac_korean_uni2_pagef8 },
   { { 0xfe50, 0xffef }, mac_korean_uni2_pagefe },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_korean_uni2_charset[] = {
@@ -352,7 +352,7 @@ static const u_int16_t mac_korean_2uni_pagea1[][2] = {
 static const cjk_index_t mac_korean_2uni_index[] = {
   { { 0x0080, 0x00ff }, mac_korean_2uni_page00 },
   { { 0xa140, 0xadbf }, mac_korean_2uni_pagea1 },
-  { { 0, 0 }, 0 }
+  { { 0, 0 }, NULL }
 };
 
 static const u_int16_t mac_korean_2uni_charset[] = {
index bb81089f466de81bd3bc9d9f920a9e321480b1a6..c62cca14d796bad6825002264e48817f3ba81e11 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: server_child.c,v 1.10 2008-12-03 18:35:44 didg Exp $
+ * $Id: server_child.c,v 1.11 2009-10-14 02:24:05 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
@@ -416,11 +416,11 @@ void server_reset_signal(void)
     sv.sa_handler =  SIG_DFL;
     sigemptyset( &sv.sa_mask );
     
-    sigaction(SIGALRM, &sv, 0 );
-    sigaction(SIGHUP,  &sv, 0 );
-    sigaction(SIGTERM, &sv, 0 );
-    sigaction(SIGUSR1, &sv, 0 );
-    sigaction(SIGCHLD, &sv, 0 );
+    sigaction(SIGALRM, &sv, NULL );
+    sigaction(SIGHUP,  &sv, NULL );
+    sigaction(SIGTERM, &sv, NULL );
+    sigaction(SIGUSR1, &sv, NULL );
+    sigaction(SIGCHLD, &sv, NULL );
     
     sigemptyset(&sigs);
     sigaddset(&sigs, SIGALRM);