summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1993-08-27 22:30:10 +0000
committerjtc <jtc@NetBSD.org>1993-08-27 22:30:10 +0000
commitf7c6bf575a9439a48efddb59c128ba0588b2bdd2 (patch)
tree9fa4a79baa54c750aa01c4f7a3a8dbd3a9a68635 /usr.bin
parent5e2ed6648a9067a54a68f6a50df75a108fe15d8c (diff)
Minor tweaks: including header files to bring prototypes into scope,
explicitly declaring function return values, etc. to make gcc -Wall shut up.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/basename/basename.c6
-rw-r--r--usr.bin/cut/cut.c7
-rw-r--r--usr.bin/dirname/dirname.c6
-rw-r--r--usr.bin/env/env.c5
-rw-r--r--usr.bin/head/head.c3
-rw-r--r--usr.bin/mkfifo/mkfifo.c5
-rw-r--r--usr.bin/nice/nice.c8
-rw-r--r--usr.bin/pagesize/pagesize.c7
-rw-r--r--usr.bin/printenv/printenv.c6
-rw-r--r--usr.bin/su/su.c6
-rw-r--r--usr.bin/time/time.c5
-rw-r--r--usr.bin/uniq/uniq.14
-rw-r--r--usr.bin/uudecode/uudecode.c9
-rw-r--r--usr.bin/uuencode/uuencode.c14
-rw-r--r--usr.bin/wall/wall.c7
-rw-r--r--usr.bin/wc/wc.c10
-rw-r--r--usr.bin/whois/whois.c9
-rw-r--r--usr.bin/xargs/xargs.c3
18 files changed, 93 insertions, 27 deletions
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c
index 30b9796ec72..1645dee75ef 100644
--- a/usr.bin/basename/basename.c
+++ b/usr.bin/basename/basename.c
@@ -39,13 +39,16 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)basename.c 5.1 (Berkeley) 3/9/91";*/
-static char rcsid[] = "$Id: basename.c,v 1.2 1993/08/01 18:18:23 mycroft Exp $";
+static char rcsid[] = "$Id: basename.c,v 1.3 1993/08/27 22:30:10 jtc Exp $";
#endif /* not lint */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+static void usage();
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -126,6 +129,7 @@ main(argc, argv)
exit(0);
}
+static void
usage()
{
(void)fprintf(stderr, "usage: basename string [suffix]\n");
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index e3263648001..3fec2edc424 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -42,11 +42,13 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)cut.c 5.4 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$Id: cut.c,v 1.4 1993/08/16 22:44:51 jtc Exp $";
+static char rcsid[] = "$Id: cut.c,v 1.5 1993/08/27 22:30:16 jtc Exp $";
#endif /* not lint */
-#include <limits.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
#include <ctype.h>
int cflag;
@@ -55,6 +57,7 @@ int dflag;
int fflag;
int sflag;
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/usr.bin/dirname/dirname.c b/usr.bin/dirname/dirname.c
index 76bc2095447..20f45310a2e 100644
--- a/usr.bin/dirname/dirname.c
+++ b/usr.bin/dirname/dirname.c
@@ -39,12 +39,15 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)dirname.c 5.6 (Berkeley) 3/9/91";*/
-static char rcsid[] = "$Id: dirname.c,v 1.2 1993/08/01 18:16:55 mycroft Exp $";
+static char rcsid[] = "$Id: dirname.c,v 1.3 1993/08/27 22:30:19 jtc Exp $";
#endif /* not lint */
#include <stdio.h>
#include <stdlib.h>
+static void usage ();
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -133,6 +136,7 @@ main(argc, argv)
exit(0);
}
+static void
usage()
{
(void)fprintf(stderr, "usage: dirname path\n");
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index e03f2c920d5..ba987a4f981 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -39,15 +39,18 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)env.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: env.c,v 1.3 1993/08/01 18:16:49 mycroft Exp $";
+static char rcsid[] = "$Id: env.c,v 1.4 1993/08/27 22:30:23 jtc Exp $";
#endif /* not lint */
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <unistd.h>
static void usage();
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c
index 9985dca22a9..aa60ae1b0f6 100644
--- a/usr.bin/head/head.c
+++ b/usr.bin/head/head.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)head.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: head.c,v 1.3 1993/08/01 18:14:54 mycroft Exp $";
+static char rcsid[] = "$Id: head.c,v 1.4 1993/08/27 22:30:27 jtc Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -54,6 +54,7 @@ static void usage ();
* Bill Joy UCB August 24, 1977
*/
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/usr.bin/mkfifo/mkfifo.c b/usr.bin/mkfifo/mkfifo.c
index 4166b09fdaa..249e2781f74 100644
--- a/usr.bin/mkfifo/mkfifo.c
+++ b/usr.bin/mkfifo/mkfifo.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mkfifo.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: mkfifo.c,v 1.3 1993/08/01 18:11:11 mycroft Exp $";
+static char rcsid[] = "$Id: mkfifo.c,v 1.4 1993/08/27 22:30:31 jtc Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -49,9 +49,11 @@ static char rcsid[] = "$Id: mkfifo.c,v 1.3 1993/08/01 18:11:11 mycroft Exp $";
#include <stdlib.h>
#include <string.h>
+static void usage();
extern void *setmode();
extern mode_t getmode();
+int
main(argc, argv)
int argc;
char **argv;
@@ -95,6 +97,7 @@ main(argc, argv)
exit(exitval);
}
+static void
usage()
{
(void)fprintf(stderr, "usage: mkfifo [-m mode] fifoname ...\n");
diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c
index 31bff99418c..2094ef7b24e 100644
--- a/usr.bin/nice/nice.c
+++ b/usr.bin/nice/nice.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)nice.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: nice.c,v 1.4 1993/08/27 20:22:06 jtc Exp $";
+static char rcsid[] = "$Id: nice.c,v 1.5 1993/08/27 22:30:34 jtc Exp $";
#endif /* not lint */
#include <sys/time.h>
@@ -50,10 +50,13 @@ static char rcsid[] = "$Id: nice.c,v 1.4 1993/08/27 20:22:06 jtc Exp $";
#include <ctype.h>
#include <errno.h>
#include <err.h>
+#include <unistd.h>
#define DEFNICE 10
-/* ARGSUSED */
+static void usage();
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -97,6 +100,7 @@ main(argc, argv)
err ((errno == ENOENT) ? 127 : 126, argv[0]);
}
+static void
usage()
{
(void)fprintf(stderr,
diff --git a/usr.bin/pagesize/pagesize.c b/usr.bin/pagesize/pagesize.c
index 24ee8decd9d..8c64227035a 100644
--- a/usr.bin/pagesize/pagesize.c
+++ b/usr.bin/pagesize/pagesize.c
@@ -39,9 +39,14 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)pagesize.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: pagesize.c,v 1.3 1993/08/01 18:10:22 mycroft Exp $";
+static char rcsid[] = "$Id: pagesize.c,v 1.4 1993/08/27 22:30:37 jtc Exp $";
#endif /* not lint */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int
main()
{
printf("%d\n", getpagesize());
diff --git a/usr.bin/printenv/printenv.c b/usr.bin/printenv/printenv.c
index 4affd92510d..af7c4535fb5 100644
--- a/usr.bin/printenv/printenv.c
+++ b/usr.bin/printenv/printenv.c
@@ -39,15 +39,19 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)printenv.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: printenv.c,v 1.2 1993/08/01 18:10:06 mycroft Exp $";
+static char rcsid[] = "$Id: printenv.c,v 1.3 1993/08/27 22:30:40 jtc Exp $";
#endif /* not lint */
+#include <stdio.h>
+#include <string.h>
+
/*
* printenv
*
* Bill Joy, UCB
* February, 1979
*/
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index b18847350bd..392d3f44421 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)su.c 5.26 (Berkeley) 7/6/91";*/
-static char rcsid[] = "$Id: su.c,v 1.6 1993/08/01 18:08:12 mycroft Exp $";
+static char rcsid[] = "$Id: su.c,v 1.7 1993/08/27 22:30:44 jtc Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -47,6 +47,7 @@ static char rcsid[] = "$Id: su.c,v 1.6 1993/08/01 18:08:12 mycroft Exp $";
#include <sys/resource.h>
#include <syslog.h>
#include <stdio.h>
+#include <stdlib.h>
#include <pwd.h>
#include <grp.h>
#include <string.h>
@@ -66,7 +67,9 @@ int use_kerberos = 1;
#endif
extern char *crypt();
+int chshell();
+int
main(argc, argv)
int argc;
char **argv;
@@ -254,6 +257,7 @@ main(argc, argv)
exit(1);
}
+int
chshell(sh)
char *sh;
{
diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c
index 0dea2ce82a8..9884a70e0ff 100644
--- a/usr.bin/time/time.c
+++ b/usr.bin/time/time.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)time.c 4.9 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: time.c,v 1.3 1993/08/27 19:05:31 jtc Exp $";
+static char rcsid[] = "$Id: time.c,v 1.4 1993/08/27 22:30:47 jtc Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -48,11 +48,14 @@ static char rcsid[] = "$Id: time.c,v 1.3 1993/08/27 19:05:31 jtc Exp $";
#include <sys/signal.h>
#include <sys/wait.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <errno.h>
int lflag;
int portableflag;
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/usr.bin/uniq/uniq.1 b/usr.bin/uniq/uniq.1
index 4100aaa2631..cb40a164792 100644
--- a/usr.bin/uniq/uniq.1
+++ b/usr.bin/uniq/uniq.1
@@ -33,10 +33,10 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)uniq.1 6.5 (Berkeley) 1/9/92
-.\" $Id: uniq.1,v 1.3 1993/08/01 07:26:59 mycroft Exp $
+.\" $Id: uniq.1,v 1.4 1993/08/27 22:30:51 jtc Exp $
.\"
.Dd January 9, 1992
-.Dt UNIQ
+.Dt UNIQ 1
.Os
.Sh NAME
.Nm uniq
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index e3762679305..7f05148d01a 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)uudecode.c 5.10 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: uudecode.c,v 1.2 1993/08/01 18:03:42 mycroft Exp $";
+static char rcsid[] = "$Id: uudecode.c,v 1.3 1993/08/27 22:30:54 jtc Exp $";
#endif /* not lint */
/*
@@ -47,15 +47,18 @@ static char rcsid[] = "$Id: uudecode.c,v 1.2 1993/08/01 18:03:42 mycroft Exp $";
#include <pwd.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
+static int decode();
+static void usage();
char *filename;
/* ARGSUSED */
+int
main(argc, argv)
int argc;
char **argv;
{
- extern int errno;
int rval;
if (*++argv) {
@@ -76,6 +79,7 @@ main(argc, argv)
exit(rval);
}
+static int
decode()
{
extern int errno;
@@ -174,6 +178,7 @@ decode()
return(0);
}
+static void
usage()
{
(void)fprintf(stderr, "usage: uudecode [file ...]\n");
diff --git a/usr.bin/uuencode/uuencode.c b/usr.bin/uuencode/uuencode.c
index 2c76d318438..e0a3eedf083 100644
--- a/usr.bin/uuencode/uuencode.c
+++ b/usr.bin/uuencode/uuencode.c
@@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)uuencode.c 5.9 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: uuencode.c,v 1.2 1993/08/01 18:03:38 mycroft Exp $";
+static char rcsid[] = "$Id: uuencode.c,v 1.3 1993/08/27 22:30:57 jtc Exp $";
#endif /* not lint */
/*
@@ -44,16 +44,20 @@ static char rcsid[] = "$Id: uuencode.c,v 1.2 1993/08/01 18:03:38 mycroft Exp $";
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+static void encode();
+static void usage();
+
+int
main(argc, argv)
int argc;
char **argv;
{
- extern int optind;
- extern int errno;
struct stat sb;
int mode;
- char *strerror();
while (getopt(argc, argv, "") != EOF)
usage();
@@ -96,6 +100,7 @@ main(argc, argv)
/*
* copy from in to out, encoding as you go along.
*/
+static void
encode()
{
register int ch, n;
@@ -136,6 +141,7 @@ encode()
(void)putchar('\n');
}
+static void
usage()
{
(void)fprintf(stderr,"usage: uuencode [infile] remotefile\n");
diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c
index d39e99d2b3e..818a761d01a 100644
--- a/usr.bin/wall/wall.c
+++ b/usr.bin/wall/wall.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$Id: wall.c,v 1.4 1993/08/01 18:03:08 mycroft Exp $";
+static char rcsid[] = "$Id: wall.c,v 1.5 1993/08/27 22:31:02 jtc Exp $";
#endif /* not lint */
/*
@@ -55,15 +55,19 @@ static char rcsid[] = "$Id: wall.c,v 1.4 1993/08/01 18:03:08 mycroft Exp $";
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <paths.h>
+#include <unistd.h>
#define IGNOREUSER "sleeper"
+void makemsg();
int nobanner;
int mbufsize;
char *mbuf;
/* ARGSUSED */
+int
main(argc, argv)
int argc;
char **argv;
@@ -113,6 +117,7 @@ usage:
exit(0);
}
+void
makemsg(fname)
char *fname;
{
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
index c9929b4987d..5c437d7ac0d 100644
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)wc.c 5.7 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$Id: wc.c,v 1.4 1993/08/17 00:37:11 jtc Exp $";
+static char rcsid[] = "$Id: wc.c,v 1.5 1993/08/27 22:31:06 jtc Exp $";
#endif /* not lint */
/* wc line, word and char count */
@@ -52,15 +52,18 @@ static char rcsid[] = "$Id: wc.c,v 1.4 1993/08/17 00:37:11 jtc Exp $";
#include <string.h>
#include <ctype.h>
#include <errno.h>
+#include <unistd.h>
#define DEL 0177 /* del char */
#define NL 012 /* newline char */
#define SPACE 040 /* space char */
#define TAB 011 /* tab char */
+static void cnt();
static long tlinect, twordct, tcharct;
static int doline, doword, dochar;
+int
main(argc, argv)
int argc;
char **argv;
@@ -122,6 +125,7 @@ main(argc, argv)
exit(0);
}
+static void
cnt(file)
char *file;
{
@@ -146,7 +150,7 @@ cnt(file)
* the word count requires some logic.
*/
if (doline) {
- while(len = read(fd, buf, MAXBSIZE)) {
+ while((len = read(fd, buf, MAXBSIZE)) != 0) {
if (len == -1) {
fprintf (stderr, "wc: %s: %s\n",
file, strerror(errno));
@@ -196,7 +200,7 @@ cnt(file)
else
fd = 0;
/* do it the hard way... */
- for (gotsp = 1; len = read(fd, buf, MAXBSIZE);) {
+ for (gotsp = 1; (len = read(fd, buf, MAXBSIZE));) {
if (len == -1) {
fprintf (stderr, "wc: %s: %s\n", file, strerror(errno));
exit(1);
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index 6da3516050d..18d4b8c6a34 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)whois.c 5.11 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$Id: whois.c,v 1.3 1993/08/01 18:02:49 mycroft Exp $";
+static char rcsid[] = "$Id: whois.c,v 1.4 1993/08/27 22:31:09 jtc Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -47,9 +47,15 @@ static char rcsid[] = "$Id: whois.c,v 1.3 1993/08/01 18:02:49 mycroft Exp $";
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#define NICHOST "whois.internic.net"
+static void usage();
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -125,6 +131,7 @@ main(argc, argv)
exit(0);
}
+static void
usage()
{
(void)fprintf(stderr, "usage: whois [-h hostname] name ...\n");
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index 38519d5174b..d8d1acc23d3 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -42,7 +42,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)xargs.c 5.11 (Berkeley) 6/19/91";*/
-static char rcsid[] = "$Id: xargs.c,v 1.4 1993/08/01 18:01:02 mycroft Exp $";
+static char rcsid[] = "$Id: xargs.c,v 1.5 1993/08/27 22:31:12 jtc Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -60,6 +60,7 @@ int tflag;
void err __P((const char *, ...));
void run(), usage();
+int
main(argc, argv)
int argc;
char **argv;