]> arthur.barton.de Git - netatalk.git/commitdiff
Warning fixes.
authorsrittau <srittau>
Sun, 10 Jun 2001 20:10:55 +0000 (20:10 +0000)
committersrittau <srittau>
Sun, 10 Jun 2001 20:10:55 +0000 (20:10 +0000)
24 files changed:
bin/megatron/Makefile.am
bin/megatron/asingle.c
bin/megatron/asingle.h [new file with mode: 0644]
bin/megatron/hqx.c
bin/megatron/hqx.h [new file with mode: 0644]
bin/megatron/macbin.c
bin/megatron/macbin.h [new file with mode: 0644]
bin/megatron/megatron.c
bin/megatron/nad.c
bin/megatron/nad.h [new file with mode: 0644]
bin/pap/pap.c
etc/afpd/parse_mtab.c
etc/afpd/test_parse_mtab.c
etc/atalkd/main.c
etc/atalkd/main.h
etc/atalkd/multicast.c
etc/atalkd/rtmp.c
etc/atalkd/zip.c
etc/papd/file.c
etc/papd/file.h
etc/papd/headers.c
etc/papd/session.c
etc/psf/psa.c
etc/psf/psf.c

index ef35afb2bef53ae2acf303381ef0b095ff63ded4..275b42374632a426a62799b329e437785c6b59d2 100644 (file)
@@ -5,7 +5,7 @@ bin_PROGRAMS = megatron
 megatron_SOURCES = asingle.c hqx.c macbin.c megatron.c nad.c updcrc.c
 megatron_LDADD = $(top_builddir)/libatalk/libatalk.la
 
-noinst_HEADERS = megatron.h
+noinst_HEADERS = asingle.h megatron.h hqx.h macbin.h nad.h
 
 LINKS = unbin unhex unsingle hqx2bin single2bin macbinary binheader nadheader
 
index 147ce698100e82d497925503ff1a4afe062d059f..b74ce05b4ddcd82fb0079bf4828222ecc868f34e 100644 (file)
 #include <unistd.h>
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
+#include "asingle.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
  */
diff --git a/bin/megatron/asingle.h b/bin/megatron/asingle.h
new file mode 100644 (file)
index 0000000..278f058
--- /dev/null
@@ -0,0 +1,8 @@
+/* Forward Declarations */
+struct FHeader;
+
+int single_open(char *singlefile, int flags, struct FHeader *fh, int options);
+int single_close(int readflag);
+int single_header_read(struct FHeader *fh, int version);
+int single_header_test(void);
+int single_read(int fork, char *buffer, int length);
index 2b4e3952d16062d77b461e6ce5521d19af4d60dc..b84f6661b6508078c0b7456158b3813cbcfa9304 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: hqx.c,v 1.6 2001-05-01 13:58:43 srittau Exp $
+ * $Id: hqx.c,v 1.7 2001-06-10 20:12:29 srittau Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -27,6 +27,7 @@
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
 #include "megatron.h"
+#include "hqx.h"
 
 #define HEXOUTPUT      0
 
diff --git a/bin/megatron/hqx.h b/bin/megatron/hqx.h
new file mode 100644 (file)
index 0000000..3c22449
--- /dev/null
@@ -0,0 +1,11 @@
+/* Forward Declarations */
+struct FHeader;
+
+int skip_junk(int line);
+int hqx_open(char *hqxfile, int flags, struct FHeader *fh, int options);
+int hqx_close(int keepflag);
+int hqx_read(int fork, char *buffer, int length);
+int hqx_header_read(struct FHeader *fh);
+int hqx_header_write(struct FHeader *fh);
+int hqx_7tobin(char *outbuf, int datalen);
+int hqx7_fill(u_char *hqx7_ptr);
index d8d9b34ccb6ba34ccb7e8c7baa8dcd13f9fcff18..fe7b6bbc4099b2d40fd8ee11cd57e6a2fbdecc4b 100644 (file)
@@ -18,6 +18,7 @@
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
 #include "megatron.h"
+#include "macbin.h"
 
 /* This allows megatron to generate .bin files that won't choke other
    well-known converter apps. It also makes sure that checksums
  */
 #define HEADBUFSIZ     128
 
-/*      Forward Declarations
- */
-int bin_open(char *binfile, int flags, struct FHeader *fh, int options);
-int bin_close(int keepflag);
-int bin_read(int fork, char *buffer, int length);
-int bin_write(int fork, char *buffer, int length);
-int bin_header_read(struct FHeader *fh, int revision);
-int bin_header_write(struct FHeader *fh);
-int test_header(void);
-u_short updcrc();
-
 /*     Both input and output routines use this struct and the
        following globals; therefore this module can only be used
        for one of the two functions at a time.
diff --git a/bin/megatron/macbin.h b/bin/megatron/macbin.h
new file mode 100644 (file)
index 0000000..35031c4
--- /dev/null
@@ -0,0 +1,11 @@
+/* Forward Declarations */
+struct FHeader;
+
+int bin_open(char *binfile, int flags, struct FHeader *fh, int options);
+int bin_close(int keepflag);
+int bin_read(int fork, char *buffer, int length);
+int bin_write(int fork, char *buffer, int length);
+int bin_header_read(struct FHeader *fh, int revision);
+int bin_header_write(struct FHeader *fh);
+int test_header(void);
+u_short updcrc();
index eb3f919b0820835d98c5d4ded3a1721fc9cd79c3..bb6bda2d33a7650a67b854a3f4bd1730ce81568a 100644 (file)
 #include <string.h>
 #include <syslog.h>
 #include <netatalk/endian.h>
+#include "asingle.h"
 #include "megatron.h"
+#include "hqx.h"
+#include "macbin.h"
+#include "nad.h"
 
 char           forkbuf[8192];
 char           *forkname[] = { "data", "resource" };
index feed7c5e2fc04a501a163f87e43f162bdf3c788f..dff7804e1a0c5811766d38e53b26c5a66e273c9d 100644 (file)
 #include <atalk/adouble.h>
 #include <netatalk/endian.h>
 #include "megatron.h"
+#include "nad.h"
 
 static char            hexdig[] = "0123456789abcdef";
 
-/* Forward Declarations */
-int nad_open(char *path, int openflags, struct FHeader *fh, int options);
-int nad_header_read(struct FHeader *fh);
-int nad_header_write(struct FHeader *fh);
-int nad_read(int fork, char *forkbuf, int bufc);
-int nad_write(int fork, char *forkbuf, int bufc);
-int nad_close(int status);
-
 char *mtoupath( mpath )
     char       *mpath;
 {
diff --git a/bin/megatron/nad.h b/bin/megatron/nad.h
new file mode 100644 (file)
index 0000000..632d7f2
--- /dev/null
@@ -0,0 +1,9 @@
+/* Forward Declarations */
+struct FHeader;
+
+int nad_open(char *path, int openflags, struct FHeader *fh, int options);
+int nad_header_read(struct FHeader *fh);
+int nad_header_write(struct FHeader *fh);
+int nad_read(int fork, char *forkbuf, int bufc);
+int nad_write(int fork, char *forkbuf, int bufc);
+int nad_close(int status);
index 2d647ef1cf218acb6b0e05645619faf50e97c650..3fba619c95a8ed2ced37b71680c02c53111150de 100644 (file)
@@ -296,7 +296,7 @@ DEBUG( printf( "< STATUS\n" ), fflush( stdout ));
 
        memcpy( st_buf, (char *) rniov[ 0 ].iov_base + 9, 
                ((char *)rniov[ 0 ].iov_base)[ 8 ] );
-       st_buf[ ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
+       st_buf[ (int) ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
        if ( strstr( st_buf, "idle" ) != NULL ) {
            waitforidle = 0;
        } else {
@@ -821,7 +821,7 @@ DEBUG( printf( "< STATUS\n" ), fflush( stdout ));
 
                memcpy( st_buf, (char *) rniov[ 0 ].iov_base + 9, 
                        ((char *)rniov[ 0 ].iov_base)[ 8 ] );
-               st_buf[ ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
+               st_buf[ (int) ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
                if ( strstr( st_buf, "waiting" ) != NULL ) {
                    waitforprinter = 0;
                }
index d2b56ef9497542775c4d8f7fe2ae1eee8ad512f9..4cc28aee959c5ae52b8038f2de44d86df9fc7fd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.c,v 1.1 2001-05-25 16:18:09 rufustfirefly Exp $
+ * $Id: parse_mtab.c,v 1.2 2001-06-10 20:15:00 srittau Exp $
  *
  * afpd_mtab_parse & support.  -- rgr, 9-Apr-01.
  */
@@ -9,6 +9,7 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/stat.h>
@@ -145,7 +146,7 @@ afpd_mtab_parse __P((char *file_name))
     }
   } /* next line */
 
-  close(f);
+  fclose(f);
   if (n_errors) {
     fprintf(stderr, "Got %d errors while reading %s; exiting.\n",
            n_errors, file_name);
index 8db58c4c218cb857a4859b796fc0864b5ebfd39a..03ebd37be5f8519cf5e188f803ed37d640829973 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: test_parse_mtab.c,v 1.1 2001-05-25 16:18:09 rufustfirefly Exp $
+ * $Id: test_parse_mtab.c,v 1.2 2001-06-10 20:15:00 srittau Exp $
  * test driver for the afpd_mtab_parse fn.  -- rgr, 9-Apr-01.
  */
 
@@ -72,7 +72,7 @@ main(int argc, char **argv)
                argv[arg], errno);
       }
       else {
-       fprintf(stderr, "File %s, device (%d,%d), inode %d, CNID 0x%08x.\n",
+       fprintf(stderr, "File %s, device (%d,%d), inode %ld, CNID 0x%08x.\n",
                argv[arg], major(st.st_dev), minor(st.st_dev), st.st_ino,
                CNID(&st, S_ISDIR(st.st_mode) ? 1 : 0));
       }
index 45d91a35cec400fc4686c80ef19eb60353f1c469..cf3784b0de86b863a2f10b2c6b3fdcc5e3ef3a3c 100644 (file)
@@ -56,7 +56,7 @@
 #include "main.h"
 
 /* Forward Declarations */
-int ifconfig(char *iname, unsigned long cmd, struct sockaddr_at *sa);
+int ifconfig(const char *iname, unsigned long cmd, struct sockaddr_at *sa);
 
 /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */
 #ifndef SOCKLEN_T
@@ -1367,7 +1367,7 @@ smaller net range.", iface->i_name, ntohs(first), ntohs(last));
 }
 
 int ifconfig( iname, cmd, sa )
-    char               *iname;
+    const char         *iname;
     unsigned long      cmd;
     struct sockaddr_at *sa;
 {
index 913f594db1cff9fef455fb9aee8cb5531c42eaa2..54081a40234c023417f4975923e0659a0053ca4e 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <sys/cdefs.h>
 
-int ifconfig __P(( char *, unsigned long, struct sockaddr_at * ));
+int ifconfig __P(( const char *, unsigned long, struct sockaddr_at * ));
 void setaddr __P(( struct interface *, u_int8_t, u_int16_t,
         u_int8_t, u_int16_t, u_int16_t ));
 void bootaddr __P(( struct interface * ));
index 9b689d5ec90c1430046d00e6010202317dc2787d..f9f53fa6d0e2f0cc49e64679dbbd757773125d2e 100644 (file)
@@ -340,9 +340,9 @@ int addmulti(const char *name, const unsigned char *data)
     sa.sdl_alen = sizeof(ethermulti);
     sa.sdl_len = sizeof(sa);
 #else
-    memcpy(sa.sa_data, data ? data : ethermulti, sizeof( ethermulti ));
+    memcpy(sa.sa_data, data ? data : ethermulti, sizeof(ethermulti));
 #endif
-    if (ifconfig(name, SIOCADDMULTI, &sa))
+    if (ifconfig(name, SIOCADDMULTI, (struct sockaddr_at *)&sa))
       return -1;
 
     return 0;
index b227e3a9e9aaaa6c18c1441d794ae08dc0a07ada..c167e384e87892f47590f8be3e097c22e936f888 100644 (file)
@@ -879,7 +879,10 @@ int looproute( iface, cmd )
     loop.sat_addr.s_net = htons( ATADDR_ANYNET );
     loop.sat_addr.s_node = ATADDR_ANYNODE;
 
-    if ( route( cmd, &dst, &loop, RTF_UP | RTF_HOST )) {
+    if ( route( cmd,
+               (struct sockaddr *) &dst,
+               (struct sockaddr *) &loop,
+               RTF_UP | RTF_HOST ) ) {
        return( 1 );
     }
     if ( cmd == RTMP_ADD ) {
@@ -932,7 +935,10 @@ int gateroute( command, rtmp )
 
     do {
        dst.sat_addr.s_net = htons( net );
-       if ( route( command, &dst, &gate, RTF_UP | RTF_GATEWAY )) {
+       if ( route( command,
+                   (struct sockaddr *) &dst,
+                   (struct sockaddr *) &gate,
+                   RTF_UP | RTF_GATEWAY )) {
            syslog( LOG_ERR, "route: %u -> %u.%u: %m", net,
                    ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
            continue;
index 0cd751caf2d4984f0396860ab7276c795dca01db..1092f51edfa4649f69328c76de1e73b9d6a998ec 100644 (file)
@@ -98,7 +98,7 @@ int zip_packet( ap, from, data, len )
     char               *end, zname[ 32 ], packet[ ATP_BUFSIZ ], *nzones, *lastflag;
     char               *reply, *rend, *ziphdr;
     int                        zlen, n, zipop, rcnt, qcnt, zcnt, zsz;
-    extern int         debug, stabletimer;
+    extern int         stabletimer;
 
     end = data + len;
 
index 76e4961a41b3b1b92692d2781535bd81a1b82fd2..4449e09d9faebcd1650995ee5a746ddce91e11a9 100644 (file)
@@ -57,7 +57,7 @@ int markline( pf, start, linelength, crlflength )
 
 void morespace( pf, data, len )
     struct papfile     *pf;
-    char               *data;
+    const char         *data;
     int                        len;
 {
     char               *nbuf;
index b7f4aeb025eb4a0840be1f634e94dcdbd3f6e694..eaa8b7a1e331c314c5bb48c55c0ff8d65f6a2c8b 100644 (file)
@@ -30,7 +30,7 @@ struct papfile {
 #define PF_MORESPACE   1024
 
 int markline __P(( struct papfile *, char **, int *, int * ));
-void morespace __P(( struct papfile *, char *, int ));
+void morespace __P(( struct papfile *, const char *, int ));
 void append __P(( struct papfile *, const char *, int ));
 void spoolerror __P(( struct papfile *, char * ));
 
index c9a66bf6b01d76dc5fa3a6c8bb11ec785e018a5f..1b436613fc43c081ef2eada085d649fdf1233257 100644 (file)
@@ -22,7 +22,6 @@ int ch_title( in, out )
 {
     char               *start, *stop, *p, *q, c;
     int                        linelength, crlflength;
-    struct papd_comment        *comment = compeek();
 
     switch ( markline( in, &start, &linelength, &crlflength )) {
     case 0 :
index bb1b6178b02d07fd37a004ca640936b7c5d1eca6..8065633688cfb2ad5bb73b29234b5f30dc914b41 100644 (file)
@@ -22,6 +22,8 @@
 #include "lp.h"
 #include "session.h"
 
+int ps(struct papfile *infile, struct papfile *outfile, struct sockaddr_at *sat);
+
 extern unsigned char   connid, quantum, oquantum;
 
 char           buf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ];
index 05923f68cec054afa7c44052c01e4dbac2648605..d73c81db64273d28b34a4cf1aa4e6ee1a848be88 100644 (file)
 #include "config.h"
 #endif
 
+#include <unistd.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-main( ac, av )
+int main( ac, av )
     int                ac;
     char       **av;
 {
@@ -95,7 +98,7 @@ main( ac, av )
            }
        }
        if ( cc != 0 && write( 2, buf, cc ) != cc ) {
-           fprintf( stderr, "write 1: 2 %X %d\n", buf, cc );
+           fprintf( stderr, "write 1: 2 %p %d\n", buf, cc );
            perror( "write" );
            exit( 2 );
        }
index e7dd5d567356601196dbb57cbe8511c85f6b07b1..c0ce07bf764f24ad8bf2e5bfa031981315ef8909 100644 (file)
@@ -23,6 +23,7 @@
 
 #define FUCKED
 
+#include <unistd.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/syslog.h>
 #include <atalk/paths.h>
 #include <stdio.h>
-#include <strings.h>
+#include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include <signal.h>
 
+/* Forward Declarations */
+int pexecv(char *path, char *argv[]);
+int copyio();
+int textps();
+
 char           psapath[] = _PATH_PSA;
 char           *psaargv[] = { "psa", 0, 0, 0, 0 };
 
@@ -70,7 +77,7 @@ struct papersize {
     { 80, 70, 8.27, 11.69 },                   /* A4 */
 };
 
-main( ac, av ) 
+int main( ac, av ) 
     int                ac;
     char       **av;
 {
@@ -347,7 +354,7 @@ restart:
     exit( rc );
 }
 
-copyio()
+int copyio()
 {
     /* implement the FSM needed to do the suspend. Note that
      * the last characters will be \031\001 so don't worry
@@ -357,7 +364,7 @@ copyio()
      */
     struct timeval     tv;
     fd_set             fdset;
-    int                        ctl = 0, i;
+    int                        ctl = 0;
 
 notdone:
     do {
@@ -461,7 +468,7 @@ char                pspro[] = "\
 /EP { SV restore showpage } bind def\n\
 %%EndProlog\n";
 
-textps()
+int textps()
 {
     struct papersize   papersize;
     int                        state = 0, line = 0, col = 0, npages = 0, rc, i;
@@ -655,7 +662,7 @@ out:
  * Manipulates file descriptors 0, 1, and 2, such that the new child
  * is reading from the parent's output.
  */
-pexecv( path, argv )
+int pexecv( path, argv )
     char       *path, *argv[];
 {
     int                fd[ 2 ], c;