Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Pass WARNS=3



details:   https://anonhg.NetBSD.org/src/rev/05953aaed4b3
branches:  trunk
changeset: 549475:05953aaed4b3
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 14 18:19:11 2003 +0000

description:
Pass WARNS=3

diffstat:

 usr.bin/make/Makefile  |    4 +-
 usr.bin/make/arch.c    |   11 +-
 usr.bin/make/compat.c  |   18 +-
 usr.bin/make/cond.c    |   16 +-
 usr.bin/make/dir.c     |   74 ++++++-----
 usr.bin/make/dir.h     |    8 +-
 usr.bin/make/for.c     |    8 +-
 usr.bin/make/hash.c    |   14 +-
 usr.bin/make/hash.h    |    6 +-
 usr.bin/make/job.c     |   33 ++--
 usr.bin/make/job.h     |   20 +-
 usr.bin/make/main.c    |   46 +++---
 usr.bin/make/make.h    |   22 ++-
 usr.bin/make/nonints.h |   46 +++---
 usr.bin/make/parse.c   |   28 ++--
 usr.bin/make/str.c     |   42 +++---
 usr.bin/make/suff.c    |   12 +-
 usr.bin/make/targ.c    |   12 +-
 usr.bin/make/var.c     |  299 +++++++++++++++++++++++++-----------------------
 19 files changed, 372 insertions(+), 347 deletions(-)

diffs (truncated from 2351 to 300 lines):

diff -r 9810533b4a82 -r 05953aaed4b3 usr.bin/make/Makefile
--- a/usr.bin/make/Makefile     Mon Jul 14 18:11:06 2003 +0000
+++ b/usr.bin/make/Makefile     Mon Jul 14 18:19:11 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.26 2002/01/27 01:50:54 reinoud Exp $
+#      $NetBSD: Makefile,v 1.27 2003/07/14 18:19:11 christos Exp $
 #      @(#)Makefile    5.2 (Berkeley) 12/28/90
 
 CPPFLAGS+= -I${.CURDIR}
@@ -11,7 +11,7 @@
        lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
        lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
 .PATH: ${.CURDIR}/lst.lib
-WARNS=2
+WARNS=3
 WFORMAT= 1
 .if make(install)
 SUBDIR=        PSD.doc
diff -r 9810533b4a82 -r 05953aaed4b3 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Mon Jul 14 18:11:06 2003 +0000
+++ b/usr.bin/make/arch.c       Mon Jul 14 18:19:11 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.36 2003/06/02 21:49:00 matt Exp $   */
+/*     $NetBSD: arch.c,v 1.37 2003/07/14 18:19:11 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: arch.c,v 1.36 2003/06/02 21:49:00 matt Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.37 2003/07/14 18:19:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.36 2003/06/02 21:49:00 matt Exp $");
+__RCSID("$NetBSD: arch.c,v 1.37 2003/07/14 18:19:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -140,7 +140,7 @@
 static void ArchFree(ClientData);
 #endif
 static struct ar_hdr *ArchStatMember(char *, char *, Boolean);
-static FILE *ArchFindMember(char *, char *, struct ar_hdr *, char *);
+static FILE *ArchFindMember(char *, char *, struct ar_hdr *, const char *);
 #if defined(__svr4__) || defined(__SVR4) || defined(__ELF__)
 #define SVR4ARCHIVES
 static int ArchSVR4Entry(Arch *, char *, size_t, FILE *);
@@ -817,7 +817,8 @@
  *-----------------------------------------------------------------------
  */
 static FILE *
-ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr, char *mode)
+ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr,
+    const char *mode)
 {
     FILE *       arch;       /* Stream to archive */
     int                  size;       /* Size of archive member */
diff -r 9810533b4a82 -r 05953aaed4b3 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Mon Jul 14 18:11:06 2003 +0000
+++ b/usr.bin/make/compat.c     Mon Jul 14 18:19:11 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.44 2002/06/15 18:24:56 wiz Exp $  */
+/*     $NetBSD: compat.c,v 1.45 2003/07/14 18:19:11 christos Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: compat.c,v 1.44 2002/06/15 18:24:56 wiz Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.45 2003/07/14 18:19:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c   8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.44 2002/06/15 18:24:56 wiz Exp $");
+__RCSID("$NetBSD: compat.c,v 1.45 2003/07/14 18:19:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -168,7 +168,7 @@
     int                  cpid;         /* Child actually found */
     ReturnStatus  retstat;     /* Status of fork */
     LstNode      cmdNode;      /* Node where current command is located */
-    char         **av;         /* Argument vector for thing to exec */
+    const char  **av;          /* Argument vector for thing to exec */
     int                  argc;         /* Number of arguments in av or 0 if not
                                 * dynamically allocated */
     Boolean      local;        /* TRUE if command should be executed
@@ -259,7 +259,7 @@
         * -e flag as well as -c if it's supposed to exit when it hits an
         * error.
         */
-       static char     *shargv[4] = { _PATH_BSHELL };
+       static const char *shargv[4] = { _PATH_BSHELL };
 
        if (DEBUG(SHELL))
                shargv[1] = (errCheck ? "-exc" : "-xc");
@@ -275,7 +275,7 @@
         * No meta-characters, so no need to exec a shell. Break the command
         * into words to form an argument vector we can execute.
         */
-       av = brk_string(cmd, &argc, TRUE, &bp);
+       av = (const char **)brk_string(cmd, &argc, TRUE, &bp);
     }
 
     local = TRUE;
@@ -290,9 +290,9 @@
     if (cpid == 0) {
        Check_Cwd(av);
        if (local)
-           (void)execvp(av[0], av);
+           (void)execvp(av[0], (char *const *)UNCONST(av));
        else
-           (void)execv(av[0], av);
+           (void)execv(av[0], (char *const *)UNCONST(av));
        execError("exec", av[0]);
        _exit(1);
     }
@@ -546,7 +546,7 @@
 void
 Compat_Run(Lst targs)
 {
-    char         *cp;      /* Pointer to string of shell meta-characters */
+    const char    *cp;     /* Pointer to string of shell meta-characters */
     GNode        *gn = NULL;/* Current root target */
     int                  errors;   /* Number of targets not remade due to errors */
 
diff -r 9810533b4a82 -r 05953aaed4b3 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Mon Jul 14 18:11:06 2003 +0000
+++ b/usr.bin/make/cond.c       Mon Jul 14 18:19:11 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.15 2003/04/17 15:57:52 sjg Exp $    */
+/*     $NetBSD: cond.c,v 1.16 2003/07/14 18:19:11 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: cond.c,v 1.15 2003/04/17 15:57:52 sjg Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.16 2003/07/14 18:19:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.15 2003/04/17 15:57:52 sjg Exp $");
+__RCSID("$NetBSD: cond.c,v 1.16 2003/07/14 18:19:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -107,7 +107,7 @@
  * last two fields are stored in condInvert and condDefProc, respectively.
  */
 static void CondPushBack(Token);
-static int CondGetArg(char **, char **, char *, Boolean);
+static int CondGetArg(char **, char **, const char *, Boolean);
 static Boolean CondDoDefined(int, char *);
 static int CondStrMatch(ClientData, ClientData);
 static Boolean CondDoMake(int, char *);
@@ -121,7 +121,7 @@
 static Token CondE(Boolean);
 
 static struct If {
-    char       *form;        /* Form of if */
+    const char *form;        /* Form of if */
     int                formlen;      /* Length of form */
     Boolean    doNot;        /* TRUE if default function should be negated */
     Boolean    (*defProc)(int, char *); /* Default function to apply */
@@ -189,7 +189,7 @@
  *-----------------------------------------------------------------------
  */
 static int
-CondGetArg(char **linePtr, char **argPtr, char *func, Boolean parens)
+CondGetArg(char **linePtr, char **argPtr, const char *func, Boolean parens)
 {
     char         *cp;
     int                  argLen;
@@ -618,8 +618,8 @@
                        }
                        break;
                    default:
-                       op = "!=";
-                       rhs = "0";
+                       op = UNCONST("!=");
+                       rhs = UNCONST("0");
 
                        goto do_compare;
                }
diff -r 9810533b4a82 -r 05953aaed4b3 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Mon Jul 14 18:11:06 2003 +0000
+++ b/usr.bin/make/dir.c        Mon Jul 14 18:19:11 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.35 2002/11/26 06:12:59 sjg Exp $     */
+/*     $NetBSD: dir.c,v 1.36 2003/07/14 18:19:11 christos Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: dir.c,v 1.35 2002/11/26 06:12:59 sjg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.36 2003/07/14 18:19:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c      8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.35 2002/11/26 06:12:59 sjg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.36 2003/07/14 18:19:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -210,15 +210,15 @@
 
 
 static int DirFindName(ClientData, ClientData);
-static int DirMatchFiles(char *, Path *, Lst);
-static void DirExpandCurly(char *, char *, Lst, Lst);
-static void DirExpandInt(char *, Lst, Lst);
+static int DirMatchFiles(const char *, Path *, Lst);
+static void DirExpandCurly(const char *, const char *, Lst, Lst);
+static void DirExpandInt(const char *, Lst, Lst);
 static int DirPrintWord(ClientData, ClientData);
 static int DirPrintDir(ClientData, ClientData);
-static char *DirLookup(Path *, char *, char *, Boolean);
-static char *DirLookupSubdir(Path *, char *);
-static char *DirFindDot(Boolean, char *, char *);
-static char *DirLookupAbs(Path *, char *, char *);
+static char *DirLookup(Path *, const char *, const char *, Boolean);
+static char *DirLookupSubdir(Path *, const char *);
+static char *DirFindDot(Boolean, const char *, const char *);
+static char *DirLookupAbs(Path *, const char *, const char *);
 
 /*-
  *-----------------------------------------------------------------------
@@ -494,7 +494,7 @@
  *-----------------------------------------------------------------------
  */
 static int
-DirMatchFiles(char *pattern, Path *p, Lst expansions)
+DirMatchFiles(const char *pattern, Path *p, Lst expansions)
 {
     Hash_Search          search;       /* Index into the directory's table */
     Hash_Entry   *entry;       /* Current entry in the table */
@@ -548,19 +548,19 @@
  *-----------------------------------------------------------------------
  */
 static void
-DirExpandCurly(char *word, char *brace, Lst path, Lst expansions)
+DirExpandCurly(const char *word, const char *brace, Lst path, Lst expansions)
 {
-    char         *end;         /* Character after the closing brace */
-    char         *cp;          /* Current position in brace clause */
-    char         *start;       /* Start of current piece of brace clause */
+    const char   *end;         /* Character after the closing brace */
+    const char   *cp;          /* Current position in brace clause */
+    const char   *start;       /* Start of current piece of brace clause */
     int                  bracelevel;   /* Number of braces we've seen. If we see a
                                 * right brace when this is 0, we've hit the
                                 * end of the clause. */
-    char         *file;        /* Current expansion */
+    char        *file;         /* Current expansion */
     int                  otherLen;     /* The length of the other pieces of the
                                 * expansion (chars before and after the
                                 * clause in 'word') */
-    char         *cp2;         /* Pointer for checking for wildcards in
+    char        *cp2;          /* Pointer for checking for wildcards in
                                 * expansion before calling Dir_Expand */
 
     start = brace+1;
@@ -660,7 +660,7 @@
  *-----------------------------------------------------------------------
  */
 static void
-DirExpandInt(char *word, Lst path, Lst expansions)
+DirExpandInt(const char *word, Lst path, Lst expansions)
 {
     LstNode      ln;           /* Current node */
     Path         *p;           /* Directory in the node */
@@ -717,9 +717,9 @@
  *-----------------------------------------------------------------------
  */
 void
-Dir_Expand(char *word, Lst path, Lst expansions)
+Dir_Expand(const char *word, Lst path, Lst expansions)



Home | Main Index | Thread Index | Old Index