Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mkdep * Make usage string reflect reality,



details:   https://anonhg.NetBSD.org/src/rev/3a3470a3a6b9
branches:  trunk
changeset: 467937:3a3470a3a6b9
user:      kleink <kleink%NetBSD.org@localhost>
date:      Wed Mar 31 11:26:45 1999 +0000

description:
* Make usage string reflect reality,
* declare internal utility functions static,
* remove unneeded workarounds for bogus -Wuninitialized reports,
* delint.

diffstat:

 usr.bin/mkdep/mkdep.c |  28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diffs (87 lines):

diff -r bf9e36e0603d -r 3a3470a3a6b9 usr.bin/mkdep/mkdep.c
--- a/usr.bin/mkdep/mkdep.c     Wed Mar 31 11:18:31 1999 +0000
+++ b/usr.bin/mkdep/mkdep.c     Wed Mar 31 11:26:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkdep.c,v 1.2 1999/03/18 22:01:48 sommerfe Exp $       */
+/*     $NetBSD: mkdep.c,v 1.3 1999/03/31 11:26:45 kleink Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #endif /* not lint */
 
 #ifndef lint
-__RCSID("$NetBSD: mkdep.c,v 1.2 1999/03/18 22:01:48 sommerfe Exp $");
+__RCSID("$NetBSD: mkdep.c,v 1.3 1999/03/31 11:26:45 kleink Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -62,19 +62,19 @@
 #define DEFAULT_PATH           _PATH_DEFPATH
 #define DEFAULT_FILENAME       ".depend"
 
-void   usage __P((void));
-char   *findcc __P((const char *));
-int    main __P((int, char **));
+static void    usage __P((void));
+static char    *findcc __P((const char *));
+int            main __P((int, char **));
 
-void
+static void
 usage()
 {
        (void)fprintf(stderr,
-           "usage: mkdep [-a] [-p] [-f file ...] flags file ...\n");
+           "usage: mkdep [-a] [-p] [-f file] flags file ...\n");
        exit(EXIT_FAILURE);
 }
 
-char *
+static char *
 findcc(progname)
        const char      *progname;
 {
@@ -116,9 +116,11 @@
        int     argc;
        char  **argv;
 {
+       /* LINTED local definition of index */
        int     aflag, pflag, index, tmpfd, status;
        pid_t   cpid, pid;
        char   *filename, *CC, *pathname, tmpfilename[MAXPATHLEN], **args;
+       /* LINTED local definition of tmpfile */
        FILE   *tmpfile, *dependfile;
        char    buffer[32768];
 
@@ -170,13 +172,6 @@
                return EXIT_FAILURE;
        }
 
-#ifdef __GNUC__                        /* to shut up gcc warnings */
-       (void)&aflag;
-       (void)&pflag;
-       (void)&filename;
-       (void)&pathname;
-#endif
-
        switch (cpid = vfork()) {
        case 0:
            (void)dup2(tmpfd, STDOUT_FILENO);
@@ -184,6 +179,7 @@
 
            (void)execv(pathname, args);
            _exit(EXIT_FAILURE);
+           /* NOTREACHED */
 
        case -1:
            (void)fputs("mkdep: unable to fork.\n", stderr);
@@ -201,7 +197,7 @@
            return EXIT_FAILURE;
        }
 
-       (void)lseek(tmpfd, 0, SEEK_SET);
+       (void)lseek(tmpfd, (off_t)0, SEEK_SET);
        if ((tmpfile = fdopen(tmpfd, "r")) == NULL) {
            (void)fprintf(stderr,
                          "mkdep: unable to read temporary file %s\n",



Home | Main Index | Thread Index | Old Index