fix gcc warnings
authorChris Torek <torek@ucbvax.Berkeley.EDU>
Sun, 24 Feb 1991 08:15:29 +0000 (00:15 -0800)
committerChris Torek <torek@ucbvax.Berkeley.EDU>
Sun, 24 Feb 1991 08:15:29 +0000 (00:15 -0800)
SCCS-vsn: sbin/dump/unctime.c 5.2
SCCS-vsn: sbin/dump/dumprmt.c 5.9

usr/src/sbin/dump/dumprmt.c
usr/src/sbin/dump/unctime.c

index d3c06a6..c0ff5a3 100644 (file)
@@ -5,8 +5,8 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dumprmt.c  5.8 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)dumprmt.c  5.9 (Berkeley) %G%";
+#endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/mtio.h>
 
 #include <sys/param.h>
 #include <sys/mtio.h>
@@ -20,6 +20,8 @@ static char sccsid[] = "@(#)dumprmt.c 5.8 (Berkeley) %G%";
 #include <protocols/dumprestore.h>
 #include <pwd.h>
 #include <stdio.h>
 #include <protocols/dumprestore.h>
 #include <pwd.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include "pathnames.h"
 
 #define        TS_CLOSED       0
 #include "pathnames.h"
 
 #define        TS_CLOSED       0
@@ -27,11 +29,18 @@ static char sccsid[] = "@(#)dumprmt.c       5.8 (Berkeley) %G%";
 
 static int rmtstate = TS_CLOSED;
 int    rmtape;
 
 static int rmtstate = TS_CLOSED;
 int    rmtape;
-int    rmtconnaborted();
+void   rmtgetconn();
+void   rmtconnaborted();
+int    rmtreply();
+int    rmtgetb();
+void   rmtgets();
+int    rmtcall();
 char   *rmtpeer;
 
 extern int ntrec;              /* blocking factor on tape */
 char   *rmtpeer;
 
 extern int ntrec;              /* blocking factor on tape */
+extern void msg();
 
 
+int
 rmthost(host)
        char *host;
 {
 rmthost(host)
        char *host;
 {
@@ -44,6 +53,7 @@ rmthost(host)
        return (1);
 }
 
        return (1);
 }
 
+void
 rmtconnaborted()
 {
 
 rmtconnaborted()
 {
 
@@ -51,6 +61,7 @@ rmtconnaborted()
        exit(1);
 }
 
        exit(1);
 }
 
+void
 rmtgetconn()
 {
        static struct servent *sp = 0;
 rmtgetconn()
 {
        static struct servent *sp = 0;
@@ -75,6 +86,7 @@ rmtgetconn()
                size -= TP_BSIZE;
 }
 
                size -= TP_BSIZE;
 }
 
+int
 rmtopen(tape, mode)
        char *tape;
        int mode;
 rmtopen(tape, mode)
        char *tape;
        int mode;
@@ -86,6 +98,7 @@ rmtopen(tape, mode)
        return (rmtcall(tape, buf));
 }
 
        return (rmtcall(tape, buf));
 }
 
+void
 rmtclose()
 {
 
 rmtclose()
 {
 
@@ -95,6 +108,7 @@ rmtclose()
        rmtstate = TS_CLOSED;
 }
 
        rmtstate = TS_CLOSED;
 }
 
+int
 rmtread(buf, count)
        char *buf;
        int count;
 rmtread(buf, count)
        char *buf;
        int count;
@@ -118,6 +132,7 @@ rmtread(buf, count)
        return (n);
 }
 
        return (n);
 }
 
+int
 rmtwrite(buf, count)
        char *buf;
        int count;
 rmtwrite(buf, count)
        char *buf;
        int count;
@@ -130,6 +145,7 @@ rmtwrite(buf, count)
        return (rmtreply("write"));
 }
 
        return (rmtreply("write"));
 }
 
+void
 rmtwrite0(count)
        int count;
 {
 rmtwrite0(count)
        int count;
 {
@@ -139,6 +155,7 @@ rmtwrite0(count)
        write(rmtape, line, strlen(line));
 }
 
        write(rmtape, line, strlen(line));
 }
 
+void
 rmtwrite1(buf, count)
        char *buf;
        int count;
 rmtwrite1(buf, count)
        char *buf;
        int count;
@@ -147,13 +164,14 @@ rmtwrite1(buf, count)
        write(rmtape, buf, count);
 }
 
        write(rmtape, buf, count);
 }
 
+int
 rmtwrite2()
 {
 rmtwrite2()
 {
-       int i;
 
        return (rmtreply("write"));
 }
 
 
        return (rmtreply("write"));
 }
 
+int
 rmtseek(offset, pos)
        int offset, pos;
 {
 rmtseek(offset, pos)
        int offset, pos;
 {
@@ -179,6 +197,7 @@ rmtstatus()
        return (&mts);
 }
 
        return (&mts);
 }
 
+int
 rmtioctl(cmd, count)
        int cmd, count;
 {
 rmtioctl(cmd, count)
        int cmd, count;
 {
@@ -190,6 +209,7 @@ rmtioctl(cmd, count)
        return (rmtcall("ioctl", buf));
 }
 
        return (rmtcall("ioctl", buf));
 }
 
+int
 rmtcall(cmd, buf)
        char *cmd, *buf;
 {
 rmtcall(cmd, buf)
        char *cmd, *buf;
 {
@@ -199,10 +219,10 @@ rmtcall(cmd, buf)
        return (rmtreply(cmd));
 }
 
        return (rmtreply(cmd));
 }
 
+int
 rmtreply(cmd)
        char *cmd;
 {
 rmtreply(cmd)
        char *cmd;
 {
-       register int c;
        char code[30], emsg[BUFSIZ];
 
        rmtgets(code, sizeof (code));
        char code[30], emsg[BUFSIZ];
 
        rmtgets(code, sizeof (code));
@@ -223,6 +243,7 @@ rmtreply(cmd)
        return (atoi(code + 1));
 }
 
        return (atoi(code + 1));
 }
 
+int
 rmtgetb()
 {
        char c;
 rmtgetb()
 {
        char c;
@@ -232,6 +253,7 @@ rmtgetb()
        return (c);
 }
 
        return (c);
 }
 
+void
 rmtgets(cp, len)
        char *cp;
        int len;
 rmtgets(cp, len)
        char *cp;
        int len;
index 38bc5d9..5d78a9b 100644 (file)
@@ -5,12 +5,15 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)unctime.c  5.1 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)unctime.c  5.2 (Berkeley) %G%";
+#endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/time.h>
 #include <stdio.h>
 
 #include <sys/types.h>
 #include <sys/time.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
 /*
  * Convert a ctime(3) format string into a system format date.
  * Return the date thus calculated.
 /*
  * Convert a ctime(3) format string into a system format date.
  * Return the date thus calculated.
@@ -29,7 +32,10 @@ static char sccsid[] = "@(#)unctime.c        5.1 (Berkeley) %G%";
 #define        E_SECOND        17
 #define        E_YEAR          20
 
 #define        E_SECOND        17
 #define        E_YEAR          20
 
-time_t unctime(str)
+static int lookup();
+
+time_t
+unctime(str)
        char *str;
 {
        struct tm then;
        char *str;
 {
        struct tm then;
@@ -40,9 +46,8 @@ time_t unctime(str)
                str[25] = 0;
        strcpy(dbuf, str);
        dbuf[E_MONTH+3] = 0;
                str[25] = 0;
        strcpy(dbuf, str);
        dbuf[E_MONTH+3] = 0;
-       if ( (then.tm_mon = lookup(&dbuf[E_MONTH])) < 0) {
-               return(-1);;
-       }
+       if ((then.tm_mon = lookup(&dbuf[E_MONTH])) < 0)
+               return (-1);
        then.tm_mday = atoi(&dbuf[E_DAY]);
        then.tm_hour = atoi(&dbuf[E_HOUR]);
        then.tm_min = atoi(&dbuf[E_MINUTE]);
        then.tm_mday = atoi(&dbuf[E_DAY]);
        then.tm_hour = atoi(&dbuf[E_HOUR]);
        then.tm_min = atoi(&dbuf[E_MINUTE]);
@@ -54,7 +59,7 @@ time_t unctime(str)
 static char months[] =
        "JanFebMarAprMayJunJulAugSepOctNovDec";
 
 static char months[] =
        "JanFebMarAprMayJunJulAugSepOctNovDec";
 
-static
+static int
 lookup(str)
        char *str;
 {
 lookup(str)
        char *str;
 {
@@ -73,8 +78,10 @@ lookup(str)
  */
 
 struct tm *localtime();
  */
 
 struct tm *localtime();
+static int dcmp();
 
 
-time_t emitl(dp)
+time_t
+emitl(dp)
        struct tm *dp;
 {
        time_t conv;
        struct tm *dp;
 {
        time_t conv;
@@ -103,7 +110,7 @@ time_t emitl(dp)
        if (dp->a < dp2->a) \
                return(-1)
 
        if (dp->a < dp2->a) \
                return(-1)
 
-static
+static int
 dcmp(dp, dp2)
        register struct tm *dp, *dp2;
 {
 dcmp(dp, dp2)
        register struct tm *dp, *dp2;
 {