]> arthur.barton.de Git - netatalk.git/commitdiff
warnings removal patch (#420300) from Sebastian Rittau (srittau)
authorrufustfirefly <rufustfirefly>
Tue, 1 May 2001 13:21:20 +0000 (13:21 +0000)
committerrufustfirefly <rufustfirefly>
Tue, 1 May 2001 13:21:20 +0000 (13:21 +0000)
bin/aecho/aecho.c
bin/getzones/getzones.c
bin/megatron/asingle.c
bin/megatron/hqx.c
bin/megatron/macbin.c
bin/megatron/megatron.c
bin/megatron/nad.c
bin/megatron/updcrc.c
libatalk/atp/atp_bprint.c
libatalk/util/getiface.c

index 9a5cdbc4e9d4c894a3b72ae813dabcee2971e34f..e12094a9b5982120b1bf7a3a618d0fd14f6ca05a 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <netdb.h>
 
@@ -47,6 +48,7 @@
 #include <atalk/nbp.h>
 #include <atalk/netddp.h>
 #include <atalk/ddp.h>
+#include <atalk/util.h>
 
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */
 #ifndef SOCKLEN_T
@@ -58,10 +60,9 @@ int                  s, nsent = 0, nrecv = 0;
 time_t                 totalms = 0, minms = -1, maxms = -1;
 static unsigned int     pings = 0;
 
-#if !defined( ibm032 ) && !defined( _IBMR2 )
-    void
-#endif ibm032 _IBMR2
-done()
+void usage(char *);
+
+void done()
 {
     if ( nsent > 0 ) {
        printf( "\n----%d.%d AEP Statistics----\n",
@@ -69,17 +70,14 @@ done()
        printf( "%d packets sent, %d packets received, %d%% packet loss\n",
                nsent, nrecv, (( nsent - nrecv ) * 100 ) / nsent );
        if ( nrecv > 0 ) {
-           printf( "round-trip (ms)  min/avg/max = %d/%d/%d\n",
+           printf( "round-trip (ms)  min/avg/max = %ld/%ld/%ld\n",
                    minms, totalms / nrecv, maxms );
        }       
     }
     exit( 0 );
 }
   
-#if !defined( ibm032 ) && !defined( _IBMR2 )
-    void
-#endif ibm032 _IBMR2
-aep_send()
+void aep_send()
 {
     struct timeval     tv;
     char               *p, buf[ 1024 ];
@@ -108,7 +106,7 @@ aep_send()
     if (pings && nsent > pings) done();
 }
 
-main( ac, av )
+int main( ac, av )
     int                ac;
     char       **av;
 {
@@ -247,14 +245,14 @@ main( ac, av )
        if ( ms < minms || minms == -1 ) {
            minms = ms;
        }
-       printf( "%d bytes from %u.%u: aep_seq=%d. time=%d. ms\n",
+       printf( "%d bytes from %u.%u: aep_seq=%d. time=%ld. ms\n",
                cc, ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node,
                seq, ms );
         if (pings && seq + 1 >= pings) done();
     }
 }
 
-usage( av0 )
+void usage( char * av0 )
 {
     fprintf( stderr, "usage:\t%s [-A source address ] [-c count] ( addr | nbpname )\n", av0 );
     exit( 1 );
index db665e326f5270d1e8994c0dcab957872731497a..13384050cbc86c6b1f7ef4893c3d82f6ad9de191 100644 (file)
@@ -7,22 +7,26 @@
 #include <sys/param.h>
 #include <sys/uio.h>
 #include <sys/time.h>
+#include <unistd.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <string.h>
 #include <netatalk/endian.h>
 #include <netatalk/at.h>
 #include <atalk/atp.h>
+#include <atalk/util.h>
 #include <atalk/zip.h>
 
-usage( s )
+void print_zones(short n, char *buf);
+
+void usage( s )
     char *s;
 {
     fprintf( stderr, "usage:\t%s [-m | -l] [address]\n", s );
     exit( 1 );
 }
 
-main( argc, argv )
+int main( argc, argv )
     int                argc;
     char       *argv[];
 {
@@ -132,7 +136,7 @@ main( argc, argv )
 }
 
 
-print_zones( n, buf )
+void print_zones( n, buf )
     short      n;      /* number of zones in this packet */
     char       *buf;   /* zone length/name pairs */
 {
index a27ae34d573b714e0cbdd05c17406813049d70ba..147ce698100e82d497925503ff1a4afe062d059f 100644 (file)
@@ -7,6 +7,7 @@
 #include <sys/time.h>
 #include <sys/param.h>
 #include <fcntl.h>
+#include <time.h>
 #include <string.h>
 #include <syslog.h>
 #include <ctype.h>
 #include <netatalk/endian.h>
 #include "megatron.h"
 
+int single_header_read(struct FHeader *fh, int version);
+int single_close(int readflag);
+int single_header_test(void);
+
 /*     String used to indicate standard input instead of a disk
        file.  Should be a string not normally used for a file
  */
@@ -53,7 +58,7 @@ u_char                header_buf[ AD_HEADER_LEN ];
  * somewhat initialized; single_filed is set.
  */
 
-single_open( singlefile, flags, fh, options )
+int single_open( singlefile, flags, fh, options )
     char               *singlefile;
     int                        flags, options;
     struct FHeader     *fh;
@@ -78,6 +83,7 @@ single_open( singlefile, flags, fh, options )
        single_close( KEEP );
        return( -1 );
     }
+    return( 0 );
 }
 
 /* 
@@ -86,7 +92,7 @@ single_open( singlefile, flags, fh, options )
  * Otherwise, a value of -1 is returned.
  */
 
-single_close( keepflag )
+int single_close( keepflag )
     int                        keepflag;
 {
     if ( keepflag == KEEP ) {
@@ -106,7 +112,7 @@ single_close( keepflag )
  * bytes of the other two forks can be read, as well.
  */
 
-single_header_read( fh, version )
+int single_header_read( fh, version )
     struct FHeader     *fh;
     int                        version;
 {
@@ -338,7 +344,7 @@ single_header_read( fh, version )
 u_char         sixteennulls[] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                    0, 0, 0, 0, 0, 0, 0, 0 };
 
-single_header_test()
+int single_header_test(void)
 {
     int                        cc;
     u_int32_t          templong;
@@ -391,7 +397,7 @@ single_header_test()
  *
  */
 
-single_read( fork, buffer, length )
+int single_read( fork, buffer, length )
     int                        fork;
     char               *buffer;
     int                        length;
index 772c24a3e8f7ff95451d874bf2f04355ec51effc..aae9c7231a6452cf9fd3678e389b7b8fe40bbb3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: hqx.c,v 1.4 2001-03-29 16:40:35 rufustfirefly Exp $
+ * $Id: hqx.c,v 1.5 2001-05-01 13:21:22 rufustfirefly Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -18,6 +18,7 @@
 # include <netinet/in.h>
 #endif
 #endif notdef
+#include <time.h>
 #include <fcntl.h>
 #include <string.h>
 #include <syslog.h>
 /*     These are field sizes in bytes of various pieces of the
        binhex header
  */
-#define        BVERSION        1
-#define        TCSIZ           8
-#define        FLAGSIZ         2
-#define        DATASIZ         4
-#define        RESSIZ          4
-#define CRCSIZ         2
-#define HEADSIZ                21
+#define        BHH_VERSION             1
+#define        BHH_TCSIZ               8
+#define        BHH_FLAGSIZ             2
+#define        BHH_DATASIZ             4
+#define        BHH_RESSIZ              4
+#define BHH_CRCSIZ             2
+#define BHH_HEADSIZ            21
 
 u_short                updcrc();
 
@@ -88,7 +89,7 @@ somewhat initialized; hqx_fd is set.  skip_junk is called from
 here; skip_junk leaves hqx7_first and hqx7_last set.
  */
 
-hqx_open( hqxfile, flags, fh, options )
+int hqx_open( hqxfile, flags, fh, options )
     char               *hqxfile;
     int                        flags, options;
     struct FHeader     *fh;
@@ -152,7 +153,7 @@ hqx_open( hqxfile, flags, fh, options )
  * Otherwise, a value of -1 is returned.
  */
 
-hqx_close( keepflag )
+int hqx_close( keepflag )
     int                        keepflag;
 {
     if ( keepflag == KEEP ) {
@@ -174,7 +175,7 @@ hqx_close( keepflag )
  * return zero and no more than that.
  */
 
-hqx_read( fork, buffer, length )
+int hqx_read( fork, buffer, length )
     int                        fork;
     char               *buffer;
     int                        length;
@@ -244,7 +245,7 @@ hqx_read( fork, buffer, length )
  * to fill the hqx_header fields.
  */
 
-hqx_header_read( fh )
+int hqx_header_read( fh )
     struct FHeader     *fh;
 {
     char               *headerbuf, *headerptr;
@@ -273,20 +274,20 @@ hqx_header_read( fh )
 #endif
 
     if (( headerbuf = 
-           (char *)malloc( (unsigned int)( namelen + HEADSIZ ))) == 0 ) {
+           (char *)malloc( (unsigned int)( namelen + BHH_HEADSIZ ))) == 0 ) {
        return( -1 );
     }
-    if ( hqx_7tobin( headerbuf, ( namelen + HEADSIZ )) == 0 ) {
+    if ( hqx_7tobin( headerbuf, ( namelen + BHH_HEADSIZ )) == 0 ) {
        free( headerbuf );
        fprintf( stderr, "Premature end of file :" );
        return( -2 );
     }
     headerptr = headerbuf;
     hqx.headercrc = updcrc( hqx.headercrc, 
-           (u_char *)headerbuf, ( namelen + HEADSIZ - CRCSIZ ));
+           (u_char *)headerbuf, ( namelen + BHH_HEADSIZ - BHH_CRCSIZ ));
 
 #if HEXOUTPUT
-    write( headerfork, headerbuf, ( namelen + HEADSIZ ));
+    write( headerfork, headerbuf, ( namelen + BHH_HEADSIZ ));
 #endif
 
 /*
@@ -300,15 +301,15 @@ hqx_header_read( fh )
     headerptr += TCSIZ;
     memcpy(&fh->finder_info.fdFlags,  headerptr, FLAGSIZ );
     fh->finder_info.fdFlags = fh->finder_info.fdFlags & mask;
-    headerptr += FLAGSIZ;
-    memcpy(&fh->forklen[ DATA ],  headerptr, DATASIZ );
+    headerptr += BHH_FLAGSIZ;
+    memcpy(&fh->forklen[ DATA ],  headerptr, BHH_DATASIZ );
     hqx.forklen[ DATA ] = ntohl( fh->forklen[ DATA ] );
-    headerptr += DATASIZ;
-    memcpy( &fh->forklen[ RESOURCE ], headerptr, RESSIZ );
+    headerptr += BHH_DATASIZ;
+    memcpy( &fh->forklen[ RESOURCE ], headerptr, BHH_RESSIZ );
     hqx.forklen[ RESOURCE ] = ntohl( fh->forklen[ RESOURCE ] );
-    headerptr += RESSIZ;
-    memcpy(&header_crc,  headerptr, CRCSIZ );
-    headerptr += CRCSIZ;
+    headerptr += BHH_RESSIZ;
+    memcpy(&header_crc,  headerptr, BHH_CRCSIZ );
+    headerptr += BHH_CRCSIZ;
     header_crc = ntohs( header_crc );
 
 /*
@@ -378,7 +379,7 @@ hqx_header_read( fh )
  * hqx_header_write.
  */
 
-hqx_header_write( fh )
+int hqx_header_write( fh )
     struct FHeader     *fh;
 {
     return( -1 );
@@ -391,7 +392,7 @@ hqx_header_write( fh )
  * it sets the pointers to the hqx7 buffer up to point to the valid data.
  */
 
-hqx7_fill( hqx7_ptr )
+int hqx7_fill( hqx7_ptr )
     u_char             *hqx7_ptr;
 {
     int                        cc;
@@ -462,7 +463,7 @@ u_char hqxlookup[] = {
  * OTHER when looking for any subsequent line.
  */
 
-skip_junk( line )
+int skip_junk( line )
 int                    line;
 {
     int                        found = NOWAY;
@@ -564,18 +565,18 @@ int                       line;
  * file is reached.
  */
 
-hqx_7tobin( outbuf, datalen ) 
+int hqx_7tobin( outbuf, datalen ) 
     char               *outbuf;
     int                        datalen;
 {
     static u_char      hqx8[3];
-    static char                hqx8i;
+    static int         hqx8i;
     static u_char      prev_hqx8;
     static u_char      prev_out;
     static u_char      prev_hqx7;
     static int         eofflag;
     u_char             hqx7[4];
-    char               hqx7i = 0;
+    int                        hqx7i = 0;
     char               *out_first;
     char               *out_last;
 
index a83c73e618ba1f081a50b7065dec6b81339006e8..98cca3b2959126881977eaa7febf13f6a4f258e9 100644 (file)
@@ -8,6 +8,7 @@
 #include <sys/param.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <string.h>
 #include <strings.h>
 #include <syslog.h>
 #include <ctype.h>
@@ -62,7 +63,7 @@ u_char                head_buf[HEADBUFSIZ];
  * somewhat initialized; bin_filed is set.
  */
 
-bin_open( binfile, flags, fh, options )
+int bin_open( binfile, flags, fh, options )
     char               *binfile;
     int                        flags, options;
     struct FHeader     *fh;
@@ -80,7 +81,8 @@ bin_open( binfile, flags, fh, options )
     bin.gmtoff = 0;
 #ifndef NO_STRUCT_TM_GMTOFF
     time(&t);
-    if (tp = localtime(&t))
+    tp = localtime(&t);
+    if (tp)
         bin.gmtoff = tp->tm_gmtoff;
 #endif
 
@@ -137,7 +139,7 @@ bin_open( binfile, flags, fh, options )
  * Otherwise, a value of -1 is returned.
  */
 
-bin_close( keepflag )
+int bin_close( keepflag )
     int                        keepflag;
 {
 #if DEBUG
@@ -162,7 +164,7 @@ bin_close( keepflag )
  * return zero and no more than that.
  */
 
-bin_read( fork, buffer, length )
+int bin_read( fork, buffer, length )
     int                        fork;
     char               *buffer;
     int                        length;
@@ -188,7 +190,8 @@ bin_read( fork, buffer, length )
 #if DEBUG
            fprintf( stderr, "current position is %ld\n", pos );
 #endif
-           if (pos = pos % HEADBUFSIZ) {
+           pos %= HEADBUFSIZ;
+           if (pos != 0) {
              pos = lseek( bin.filed, HEADBUFSIZ - pos, SEEK_CUR );
            }
 #if DEBUG
@@ -233,7 +236,7 @@ bin_read( fork, buffer, length )
  * bin_write 
  */
 
-bin_write( fork, buffer, length )
+int bin_write( fork, buffer, length )
     int                        fork;
     char               *buffer;
     int                        length;
@@ -293,7 +296,8 @@ bin_write( fork, buffer, length )
 #if DEBUG
        fprintf( stderr, "current position is %ld\n", pos );
 #endif
-       if (pos = pos % HEADBUFSIZ) { /* pad only if we need to */
+       pos %= HEADBUFSIZ;
+       if (pos != 0) { /* pad only if we need to */
          pos = lseek( bin.filed, HEADBUFSIZ - pos - 1, SEEK_CUR );
          if ( write( bin.filed, &padchar, 1 ) != 1 ) {
            perror( "Couldn't write to macbinary file:" );
@@ -318,7 +322,7 @@ bin_write( fork, buffer, length )
  * of the bytes of the other two forks can be read, as well.
  */
 
-bin_header_read( fh, revision )
+int bin_header_read( fh, revision )
     struct FHeader     *fh;
     int                        revision;
 {
@@ -420,7 +424,7 @@ bin_header_read( fh, revision )
  * bin_header_write and bin_header_read are opposites.
  */
 
-bin_header_write( fh )
+int bin_header_write( fh )
     struct FHeader     *fh;
 {
     char               *write_ptr;
@@ -526,7 +530,7 @@ bin_header_write( fh )
  * so, the check for byte 74 isn't very useful.
  */
 
-test_header()
+int test_header()
 {
     const char          zeros[25] = "";
     u_int32_t          cc;
index 8d9ffe442be360fdea9113fd403a901dc7af6838..eb3f919b0820835d98c5d4ded3a1721fc9cd79c3 100644 (file)
@@ -7,6 +7,7 @@
 #include <sys/stat.h>
 #include <sys/uio.h>
 #include <fcntl.h>
+#include <time.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
@@ -332,7 +333,8 @@ int main( argc, argv )
          continue;
        }
          
-       if ( rc = megatron( argv[ c ], module, newname, flags) != 0 ) {
+       rc = megatron( argv[ c ], module, newname, flags);
+       if ( rc != 0 ) {
            rv = rc;
        }
        *newname = '\0';
index 4d5faaa189f89898f31d299202c28d05a02cfc0f..15370b987ffafd7c10d28ffa22e5b4fa47fd0298 100644 (file)
@@ -99,7 +99,7 @@ struct nad_file_data {
     struct adouble     ad;
 } nad;
 
-nad_open( path, openflags, fh, options )
+int nad_open( path, openflags, fh, options )
     char               *path;
     int                        openflags, options;
     struct FHeader     *fh;
@@ -163,7 +163,7 @@ nad_open( path, openflags, fh, options )
     }
 }
 
-nad_header_read( fh )
+int nad_header_read( fh )
     struct FHeader     *fh;
 {
     u_int32_t          temptime;
@@ -265,7 +265,7 @@ nad_header_read( fh )
 
 }
 
-nad_header_write( fh )
+int nad_header_write( fh )
     struct FHeader     *fh;
 {
     u_int32_t          temptime;
@@ -352,7 +352,7 @@ nad_header_write( fh )
 
 int                    forkeid[] = { ADEID_DFORK, ADEID_RFORK };
 
-nad_read( fork, forkbuf, bufc )
+int nad_read( fork, forkbuf, bufc )
     int                        fork;
     char               *forkbuf;
     int                        bufc;
@@ -377,7 +377,7 @@ nad_read( fork, forkbuf, bufc )
     return( cc );
 }
 
-nad_write( fork, forkbuf, bufc )
+int nad_write( fork, forkbuf, bufc )
     int                        fork;
     char               *forkbuf;
     int                        bufc;
@@ -412,7 +412,7 @@ nad_write( fork, forkbuf, bufc )
     return( bufc );
 }
 
-nad_close( status )
+int nad_close( status )
 int                    status;
 {
     int                        rv;
@@ -434,4 +434,5 @@ int                 status;
        }
        return( 0 );
     } else return( -1 );
+    return( 0 );
 }
index 37ad7aff8b20d92c97c8f4972f15df21849d72e6..a2176b1783acbb8e204bc9ff3710a29cfe1e8ba7 100644 (file)
@@ -37,7 +37,9 @@
     /* Value used by:                  CCITT   XMODEM  ARC     */
 #define        P        0x1021 /* the poly:    0x1021  0x1021  A001    */
 #define INIT_CRC 0L    /* init value:  -1      0       0       */
-/*#define SWAPPED      /* bit order:   undef   defined defined */
+#if 0
+#define SWAPPED        /* bit order:   undef   defined defined */
+#endif
 #define W      16      /* bits in CRC:16       16      16      */
 
     /* data type that holds a W-bit unsigned integer */
index cafacdae095e409b08dbf8e48a19257b6830f18f..b1928f8343de10baed91ca567c2144bdeccb77ff 100644 (file)
@@ -31,7 +31,7 @@
 #include <string.h>
 char   hexdig[] = "0123456789abcdef";
 
-bprint( data, len )
+void bprint( data, len )
     char       *data;
     int                len;
 {
index 80b5b43d131aecf47842c55ecad2024ebba13197..af175d99ace99292d7e5bd862662552e05dc984d 100644 (file)
@@ -151,7 +151,7 @@ void freeifacelist(char **ifacelist)
   if (!ifacelist)
     return;
 
-  while (value = *list++) {
+  while ((value = *list++)) {
     free(value);
   }