Source-Changes-HG archive

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

[src/trunk]: src/bin/sh remove redundant declarations and nexted externs.



details:   https://anonhg.NetBSD.org/src/rev/6626e14f3c91
branches:  trunk
changeset: 503307:6626e14f3c91
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 04 19:52:06 2001 +0000

description:
remove redundant declarations and nexted externs.

diffstat:

 bin/sh/error.h     |   3 +--
 bin/sh/eval.c      |   6 +++---
 bin/sh/exec.c      |   6 +++---
 bin/sh/expand.c    |   7 ++++---
 bin/sh/histedit.c  |   6 +++---
 bin/sh/input.c     |  11 +++++------
 bin/sh/main.c      |   7 +++----
 bin/sh/miscbltin.c |   7 +++----
 bin/sh/options.c   |   8 ++++----
 bin/sh/options.h   |   4 ++--
 bin/sh/parser.c    |   5 +++--
 bin/sh/trap.c      |   6 ++----
 bin/sh/var.c       |   8 ++++----
 13 files changed, 40 insertions(+), 44 deletions(-)

diffs (truncated from 401 to 300 lines):

diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/error.h
--- a/bin/sh/error.h    Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/error.h    Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: error.h,v 1.13 1999/07/09 03:05:49 christos Exp $      */
+/*     $NetBSD: error.h,v 1.14 2001/02/04 19:52:06 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -82,7 +82,6 @@
 
 extern volatile int suppressint;
 extern volatile int intpending;
-extern char *commandname;      /* name of command--printed on error */
 
 #define INTOFF suppressint++
 #define INTON { if (--suppressint == 0 && intpending) onint(); }
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/eval.c
--- a/bin/sh/eval.c     Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/eval.c     Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.56 2000/05/22 10:18:46 elric Exp $  */
+/*     $NetBSD: eval.c,v 1.57 2001/02/04 19:52:06 christos Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.56 2000/05/22 10:18:46 elric Exp $");
+__RCSID("$NetBSD: eval.c,v 1.57 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -81,7 +81,7 @@
 #define EV_TESTED 02           /* exit status is checked; ignore -e flag */
 #define EV_BACKCMD 04          /* command executing within back quotes */
 
-MKINIT int evalskip;           /* set if we are skipping commands */
+int evalskip;                  /* set if we are skipping commands */
 STATIC int skipcount;          /* number of levels to skip */
 MKINIT int loopnest;           /* current loop nesting level */
 int funcnest;                  /* depth of function calls */
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/exec.c
--- a/bin/sh/exec.c     Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/exec.c     Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.c,v 1.31 2000/11/01 19:21:41 christos Exp $       */
+/*     $NetBSD: exec.c,v 1.32 2001/02/04 19:52:06 christos Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)exec.c     8.4 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: exec.c,v 1.31 2000/11/01 19:21:41 christos Exp $");
+__RCSID("$NetBSD: exec.c,v 1.32 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -110,6 +110,7 @@
 STATIC void delete_cmd_entry __P((void));
 
 
+extern char *const parsekwd[];
 
 /*
  * Exec a program.  Never returns.  If you change this routine, you may
@@ -879,7 +880,6 @@
        struct alias *ap;
        int i;
        int err = 0;
-       extern char *const parsekwd[];
 
        for (i = 1; i < argc; i++) {
                out1str(argv[i]);
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/expand.c
--- a/bin/sh/expand.c   Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/expand.c   Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expand.c,v 1.49 2000/03/13 22:47:19 soren Exp $        */
+/*     $NetBSD: expand.c,v 1.50 2001/02/04 19:52:06 christos Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c   8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.49 2000/03/13 22:47:19 soren Exp $");
+__RCSID("$NetBSD: expand.c,v 1.50 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -115,6 +115,8 @@
 STATIC int pmatch __P((char *, char *, int));
 STATIC char *cvtnum __P((int, char *));
 
+extern int oexitstatus;
+
 /*
  * Expand shell variables and backquotes inside a here document.
  */
@@ -831,7 +833,6 @@
        int num;
        char *p;
        int i;
-       extern int oexitstatus;
        char sep;
        char **ap;
        char const *syntax;
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/histedit.c
--- a/bin/sh/histedit.c Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/histedit.c Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: histedit.c,v 1.24 2000/11/06 04:21:14 mycroft Exp $    */
+/*     $NetBSD: histedit.c,v 1.25 2001/02/04 19:52:06 christos Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.24 2000/11/06 04:21:14 mycroft Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.25 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -224,7 +224,7 @@
              (ch = getopt(argc, argv, ":e:lnrs")) != -1)
                switch ((char)ch) {
                case 'e':
-                       editor = optarg;
+                       editor = optionarg;
                        break;
                case 'l':
                        lflg = 1;
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/input.c
--- a/bin/sh/input.c    Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/input.c    Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: input.c,v 1.34 2000/05/22 10:18:47 elric Exp $ */
+/*     $NetBSD: input.c,v 1.35 2001/02/04 19:52:06 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)input.c    8.3 (Berkeley) 6/9/95";
 #else
-__RCSID("$NetBSD: input.c,v 1.34 2000/05/22 10:18:47 elric Exp $");
+__RCSID("$NetBSD: input.c,v 1.35 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -99,11 +99,11 @@
 
 
 int plinno = 1;                        /* input line number */
-MKINIT int parsenleft;         /* copy of parsefile->nleft */
+int parsenleft;                        /* copy of parsefile->nleft */
 MKINIT int parselleft;         /* copy of parsefile->lleft */
 char *parsenextc;              /* copy of parsefile->nextc */
 MKINIT struct parsefile basepf;        /* top level input file */
-char basebuf[BUFSIZ];          /* buffer for top level input file */
+MKINIT char basebuf[BUFSIZ];   /* buffer for top level input file */
 struct parsefile *parsefile = &basepf; /* current input file */
 int init_editline = 0;         /* editline library initialized? */
 int whichprompt;               /* 1 == PS1, 2 == PS2 */
@@ -114,12 +114,11 @@
 static int preadfd __P((void));
 
 #ifdef mkinit
+INCLUDE <stdio.h>
 INCLUDE "input.h"
 INCLUDE "error.h"
 
 INIT {
-       extern char basebuf[];
-
        basepf.nextc = basepf.buf = basebuf;
 }
 
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/main.c
--- a/bin/sh/main.c     Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/main.c     Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.39 2000/11/01 19:56:01 christos Exp $       */
+/*     $NetBSD: main.c,v 1.40 2001/02/04 19:52:06 christos Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.7 (Berkeley) 7/19/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.39 2000/11/01 19:56:01 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.40 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -94,6 +94,7 @@
 STATIC char *find_dot_file __P((char *));
 int main __P((int, char **));
 
+extern int oexitstatus;
 /*
  * Main routine.  We initialize things, parse the arguments, execute
  * profiles if we're a login shell, and then call cmdloop to execute
@@ -402,8 +403,6 @@
        int argc;
        char **argv;
 {
-       extern int oexitstatus;
-
        if (stoppedjobs())
                return 0;
        if (argc > 1)
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/miscbltin.c
--- a/bin/sh/miscbltin.c        Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/miscbltin.c        Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: miscbltin.c,v 1.29 2001/01/04 15:39:51 lukem Exp $     */
+/*     $NetBSD: miscbltin.c,v 1.30 2001/02/04 19:52:06 christos Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c        8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.29 2001/01/04 15:39:51 lukem Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.30 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,7 +70,6 @@
 
 #undef rflag
 
-extern char **argptr;          /* argument list for builtin command */
 
 
 /*
@@ -100,7 +99,7 @@
        prompt = NULL;
        while ((i = nextopt("p:r")) != '\0') {
                if (i == 'p')
-                       prompt = optarg;
+                       prompt = optionarg;
                else
                        rflag = 1;
        }
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/options.c
--- a/bin/sh/options.c  Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/options.c  Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: options.c,v 1.29 1999/07/09 03:05:50 christos Exp $    */
+/*     $NetBSD: options.c,v 1.30 2001/02/04 19:52:06 christos Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c  8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: options.c,v 1.29 1999/07/09 03:05:50 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.30 2001/02/04 19:52:06 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,7 +70,7 @@
 char *arg0;                    /* value of $0 */
 struct shparam shellparam;     /* current positional parameters */
 char **argptr;                 /* argument list for builtin commands */
-char *optarg;                  /* set by nextopt (like getopt) */
+char *optionarg;               /* set by nextopt (like getopt) */
 char *optptr;                  /* used by nextopt */
 
 char *minusc;                  /* argument to -c option */
@@ -535,7 +535,7 @@
        if (*++q == ':') {
                if (*p == '\0' && (p = *argptr++) == NULL)
                        error("No arg for -%c option", c);
-               optarg = p;
+               optionarg = p;
                p = NULL;
        }
        optptr = p;
diff -r 4a15e24ba791 -r 6626e14f3c91 bin/sh/options.h
--- a/bin/sh/options.h  Sun Feb 04 19:51:43 2001 +0000
+++ b/bin/sh/options.h  Sun Feb 04 19:52:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: options.h,v 1.13 1999/07/09 03:05:50 christos Exp $    */
+/*     $NetBSD: options.h,v 1.14 2001/02/04 19:52:06 christos Exp $    */
 
 /*-



Home | Main Index | Thread Index | Old Index