Fix compiler warnings.

This commit is contained in:
christos 1997-07-04 21:01:48 +00:00
parent 28f5c57bd5
commit cd799663e4
31 changed files with 231 additions and 155 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: alias.c,v 1.8 1997/01/11 02:04:27 tls Exp $ */
/* $NetBSD: alias.c,v 1.9 1997/07/04 21:01:48 christos Exp $ */
/*-
* Copyright (c) 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: alias.c,v 1.8 1997/01/11 02:04:27 tls Exp $";
__RCSID("$NetBSD: alias.c,v 1.9 1997/07/04 21:01:48 christos Exp $");
#endif
#endif /* not lint */
@ -151,7 +152,7 @@ unalias(name)
}
#ifdef mkinit
MKINIT void rmaliases();
MKINIT void rmaliases __P((void));
SHELLPROC {
rmaliases();

View File

@ -1,4 +1,4 @@
/* $NetBSD: arith.h,v 1.1 1995/05/11 21:28:44 christos Exp $ */
/* $NetBSD: arith.h,v 1.2 1997/07/04 21:01:49 christos Exp $ */
/*-
* Copyright (c) 1995
@ -37,3 +37,5 @@
int arith __P((char *));
int expcmd __P((int , char **));
void arith_lex_reset __P((void));
int yylex __P((void));

View File

@ -1,59 +1,5 @@
%token ARITH_NUM ARITH_LPAREN ARITH_RPAREN
%left ARITH_OR
%left ARITH_AND
%left ARITH_BOR
%left ARITH_BXOR
%left ARITH_BAND
%left ARITH_EQ ARITH_NE
%left ARITH_LT ARITH_GT ARITH_GE ARITH_LE
%left ARITH_LSHIFT ARITH_RSHIFT
%left ARITH_ADD ARITH_SUB
%left ARITH_MUL ARITH_DIV ARITH_REM
%left ARITH_UNARYMINUS ARITH_UNARYPLUS ARITH_NOT ARITH_BNOT
%%
exp: expr = {
return ($1);
}
;
expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
| expr ARITH_OR expr = { $$ = $1 ? $1 : $3 ? $3 : 0; }
| expr ARITH_AND expr = { $$ = $1 ? ( $3 ? $3 : 0 ) : 0; }
| expr ARITH_BOR expr = { $$ = $1 | $3; }
| expr ARITH_BXOR expr = { $$ = $1 ^ $3; }
| expr ARITH_BAND expr = { $$ = $1 & $3; }
| expr ARITH_EQ expr = { $$ = $1 == $3; }
| expr ARITH_GT expr = { $$ = $1 > $3; }
| expr ARITH_GE expr = { $$ = $1 >= $3; }
| expr ARITH_LT expr = { $$ = $1 < $3; }
| expr ARITH_LE expr = { $$ = $1 <= $3; }
| expr ARITH_NE expr = { $$ = $1 != $3; }
| expr ARITH_LSHIFT expr = { $$ = $1 << $3; }
| expr ARITH_RSHIFT expr = { $$ = $1 >> $3; }
| expr ARITH_ADD expr = { $$ = $1 + $3; }
| expr ARITH_SUB expr = { $$ = $1 - $3; }
| expr ARITH_MUL expr = { $$ = $1 * $3; }
| expr ARITH_DIV expr = {
if ($3 == 0)
yyerror("division by zero");
$$ = $1 / $3;
}
| expr ARITH_REM expr = {
if ($3 == 0)
yyerror("division by zero");
$$ = $1 % $3;
}
| ARITH_NOT expr = { $$ = !($2); }
| ARITH_BNOT expr = { $$ = ~($2); }
| ARITH_SUB expr %prec ARITH_UNARYMINUS = { $$ = -($2); }
| ARITH_ADD expr %prec ARITH_UNARYPLUS = { $$ = $2; }
| ARITH_NUM
;
%%
/* $NetBSD: arith.y,v 1.7 1996/10/16 15:45:05 christos Exp $ */
%{
/* $NetBSD: arith.y,v 1.8 1997/07/04 21:01:50 christos Exp $ */
/*-
* Copyright (c) 1993
@ -91,14 +37,16 @@ expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
#else
static char sccsid[] = "$NetBSD: arith.y,v 1.7 1996/10/16 15:45:05 christos Exp $";
__RCSID("$NetBSD: arith.y,v 1.8 1997/07/04 21:01:50 christos Exp $");
#endif
#endif /* not lint */
#include "arith.h"
#include "shell.h"
#include "error.h"
#include "output.h"
@ -106,6 +54,13 @@ static char sccsid[] = "$NetBSD: arith.y,v 1.7 1996/10/16 15:45:05 christos Exp
char *arith_buf, *arith_startbuf;
void yyerror __P((char *));
int yyparse __P((void));
#ifdef TESTARITH
int main __P((int , char *[]));
int error __P((char *));
#endif
int
arith(s)
char *s;
@ -122,16 +77,6 @@ arith(s)
return (result);
}
void
yyerror(s)
char *s;
{
yyerrok;
yyclearin;
arith_lex_reset(); /* reprime lex */
error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
}
/*
* The exp(1) builtin.
@ -188,3 +133,69 @@ error(s)
exit(1);
}
#endif
%}
%token ARITH_NUM ARITH_LPAREN ARITH_RPAREN
%left ARITH_OR
%left ARITH_AND
%left ARITH_BOR
%left ARITH_BXOR
%left ARITH_BAND
%left ARITH_EQ ARITH_NE
%left ARITH_LT ARITH_GT ARITH_GE ARITH_LE
%left ARITH_LSHIFT ARITH_RSHIFT
%left ARITH_ADD ARITH_SUB
%left ARITH_MUL ARITH_DIV ARITH_REM
%left ARITH_UNARYMINUS ARITH_UNARYPLUS ARITH_NOT ARITH_BNOT
%%
exp: expr = {
return ($1);
}
;
expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
| expr ARITH_OR expr = { $$ = $1 ? $1 : $3 ? $3 : 0; }
| expr ARITH_AND expr = { $$ = $1 ? ( $3 ? $3 : 0 ) : 0; }
| expr ARITH_BOR expr = { $$ = $1 | $3; }
| expr ARITH_BXOR expr = { $$ = $1 ^ $3; }
| expr ARITH_BAND expr = { $$ = $1 & $3; }
| expr ARITH_EQ expr = { $$ = $1 == $3; }
| expr ARITH_GT expr = { $$ = $1 > $3; }
| expr ARITH_GE expr = { $$ = $1 >= $3; }
| expr ARITH_LT expr = { $$ = $1 < $3; }
| expr ARITH_LE expr = { $$ = $1 <= $3; }
| expr ARITH_NE expr = { $$ = $1 != $3; }
| expr ARITH_LSHIFT expr = { $$ = $1 << $3; }
| expr ARITH_RSHIFT expr = { $$ = $1 >> $3; }
| expr ARITH_ADD expr = { $$ = $1 + $3; }
| expr ARITH_SUB expr = { $$ = $1 - $3; }
| expr ARITH_MUL expr = { $$ = $1 * $3; }
| expr ARITH_DIV expr = {
if ($3 == 0)
yyerror("division by zero");
$$ = $1 / $3;
}
| expr ARITH_REM expr = {
if ($3 == 0)
yyerror("division by zero");
$$ = $1 % $3;
}
| ARITH_NOT expr = { $$ = !($2); }
| ARITH_BNOT expr = { $$ = ~($2); }
| ARITH_SUB expr %prec ARITH_UNARYMINUS = { $$ = -($2); }
| ARITH_ADD expr %prec ARITH_UNARYPLUS = { $$ = $2; }
| ARITH_NUM
;
%%
void
yyerror(s)
char *s;
{
yyerrok;
yyclearin;
arith_lex_reset(); /* reprime lex */
error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
}

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: arith_lex.l,v 1.6 1996/10/16 15:45:06 christos Exp $ */
/* $NetBSD: arith_lex.l,v 1.7 1997/07/04 21:01:51 christos Exp $ */
/*-
* Copyright (c) 1993
@ -37,23 +37,26 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
#else
static char sccsid[] = "$NetBSD: arith_lex.l,v 1.6 1996/10/16 15:45:06 christos Exp $";
__RCSID("$NetBSD: arith_lex.l,v 1.7 1997/07/04 21:01:51 christos Exp $");
#endif
#endif /* not lint */
#include <unistd.h>
#include "y.tab.h"
#include "error.h"
#include "arith.h"
extern yylval;
extern char *arith_buf, *arith_startbuf;
#undef YY_INPUT
#define YY_INPUT(buf,result,max) \
result = (*buf = *arith_buf++) ? 1 : YY_NULL;
#define YY_NO_UNPUT
%}
%%

View File

@ -1,4 +1,4 @@
/* $NetBSD: bltin.h,v 1.8 1996/10/16 15:28:10 christos Exp $ */
/* $NetBSD: bltin.h,v 1.9 1997/07/04 21:02:29 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -70,13 +70,9 @@
#define INITARGS(argv) if ((commandname = argv[0]) == NULL) {fputs("Argc is zero\n", stderr); exit(2);} else
#endif
#ifdef __STDC__
pointer stalloc(int);
void error(char *, ...);
#else
pointer stalloc();
void error();
#endif
pointer stalloc __P((int));
void error __P((char *, ...));
int echocmd __P((int, char **));
extern char *commandname;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd.h,v 1.1 1995/11/19 23:27:40 christos Exp $ */
/* $NetBSD: cd.h,v 1.2 1997/07/04 21:01:52 christos Exp $ */
/*-
* Copyright (c) 1995
@ -34,4 +34,6 @@
*
*/
void getpwd __P((void));
void getpwd __P((void));
int cdcmd __P((int, char **));
int pwdcmd __P((int, char **));

View File

@ -1,4 +1,4 @@
/* $NetBSD: error.c,v 1.16 1997/04/11 23:06:51 christos Exp $ */
/* $NetBSD: error.c,v 1.17 1997/07/04 21:01:54 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: error.c,v 1.16 1997/04/11 23:06:51 christos Exp $";
__RCSID("$NetBSD: error.c,v 1.17 1997/07/04 21:01:54 christos Exp $");
#endif
#endif /* not lint */
@ -70,7 +71,7 @@ volatile int intpending;
char *commandname;
static void exverror __P((int, char *, va_list));
static void exverror __P((int, char *, va_list)) __attribute__((__noreturn__));
/*
* Called to raise an exception. Since C doesn't include exceptions, we

View File

@ -1,4 +1,4 @@
/* $NetBSD: error.h,v 1.9 1996/10/16 14:35:43 christos Exp $ */
/* $NetBSD: error.h,v 1.10 1997/07/04 21:01:55 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -90,9 +90,9 @@ extern char *commandname; /* name of command--printed on error */
#define CLEAR_PENDING_INT intpending = 0
#define int_pending() intpending
void exraise __P((int));
void exraise __P((int)) __attribute__((__noreturn__));
void onint __P((void));
void error __P((char *, ...));
void error __P((char *, ...)) __attribute__((__noreturn__));
void exerror __P((int, char *, ...));
char *errmsg __P((int, int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: eval.c,v 1.35 1997/03/14 01:42:19 christos Exp $ */
/* $NetBSD: eval.c,v 1.36 1997/07/04 21:01:56 christos Exp $ */
/*-
* Copyright (c) 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#else
static char sccsid[] = "$NetBSD: eval.c,v 1.35 1997/03/14 01:42:19 christos Exp $";
__RCSID("$NetBSD: eval.c,v 1.36 1997/07/04 21:01:56 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.22 1997/02/06 23:24:52 christos Exp $ */
/* $NetBSD: exec.c,v 1.23 1997/07/04 21:01:59 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
#else
static char rcsid[] = "$NetBSD: exec.c,v 1.22 1997/02/06 23:24:52 christos Exp $";
__RCSID("$NetBSD: exec.c,v 1.23 1997/07/04 21:01:59 christos Exp $");
#endif
#endif /* not lint */
@ -672,7 +673,7 @@ clearcmdentry(firstchange)
*/
#ifdef mkinit
MKINIT void deletefuncs();
MKINIT void deletefuncs __P((void));
SHELLPROC {
deletefuncs();

View File

@ -1,4 +1,4 @@
/* $NetBSD: expand.c,v 1.29 1997/03/18 18:54:40 christos Exp $ */
/* $NetBSD: expand.c,v 1.30 1997/07/04 21:02:00 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
#else
static char rcsid[] = "$NetBSD: expand.c,v 1.29 1997/03/18 18:54:40 christos Exp $";
__RCSID("$NetBSD: expand.c,v 1.30 1997/07/04 21:02:00 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: histedit.c,v 1.13 1997/04/11 22:45:41 christos Exp $ */
/* $NetBSD: histedit.c,v 1.14 1997/07/04 21:02:02 christos Exp $ */
/*-
* Copyright (c) 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: histedit.c,v 1.13 1997/04/11 22:45:41 christos Exp $";
__RCSID("$NetBSD: histedit.c,v 1.14 1997/07/04 21:02:02 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: input.c,v 1.26 1997/04/11 23:00:40 christos Exp $ */
/* $NetBSD: input.c,v 1.27 1997/07/04 21:02:03 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
#else
static char rcsid[] = "$NetBSD: input.c,v 1.26 1997/04/11 23:00:40 christos Exp $";
__RCSID("$NetBSD: input.c,v 1.27 1997/07/04 21:02:03 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: jobs.c,v 1.21 1997/01/11 02:04:36 tls Exp $ */
/* $NetBSD: jobs.c,v 1.22 1997/07/04 21:02:04 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: jobs.c,v 1.21 1997/01/11 02:04:36 tls Exp $";
__RCSID("$NetBSD: jobs.c,v 1.22 1997/07/04 21:02:04 christos Exp $");
#endif
#endif /* not lint */
@ -931,7 +932,6 @@ stoppedjobs()
STATIC char *cmdnextc;
STATIC int cmdnleft;
STATIC void cmdtxt(), cmdputs();
#define MAXCMDTEXT 200
char *

View File

@ -1,4 +1,4 @@
/* $NetBSD: mail.c,v 1.10 1997/01/11 02:04:37 tls Exp $ */
/* $NetBSD: mail.c,v 1.11 1997/07/04 21:02:06 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)mail.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: mail.c,v 1.10 1997/01/11 02:04:37 tls Exp $";
__RCSID("$NetBSD: mail.c,v 1.11 1997/07/04 21:02:06 christos Exp $");
#endif
#endif /* not lint */
@ -54,6 +55,7 @@ static char rcsid[] = "$NetBSD: mail.c,v 1.10 1997/01/11 02:04:37 tls Exp $";
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "mail.h"
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.25 1997/04/11 23:01:44 christos Exp $ */
/* $NetBSD: main.c,v 1.26 1997/07/04 21:02:07 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,17 +36,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95";
#else
static char rcsid[] = "$NetBSD: main.c,v 1.25 1997/04/11 23:01:44 christos Exp $";
__RCSID("$NetBSD: main.c,v 1.26 1997/07/04 21:02:07 christos Exp $");
#endif
#endif /* not lint */
@ -92,6 +92,7 @@ extern int etext();
STATIC void read_profile __P((char *));
STATIC char *find_dot_file __P((char *));
int main __P((int, char **));
/*
* Main routine. We initialize things, parse the arguments, execute

View File

@ -1,4 +1,4 @@
/* $NetBSD: memalloc.c,v 1.19 1997/01/11 02:04:38 tls Exp $ */
/* $NetBSD: memalloc.c,v 1.20 1997/07/04 21:02:08 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: memalloc.c,v 1.19 1997/01/11 02:04:38 tls Exp $";
__RCSID("$NetBSD: memalloc.c,v 1.20 1997/07/04 21:02:08 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: miscbltin.c,v 1.18 1997/04/11 23:08:15 christos Exp $ */
/* $NetBSD: miscbltin.c,v 1.19 1997/07/04 21:02:09 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: miscbltin.c,v 1.18 1997/04/11 23:08:15 christos Exp $";
__RCSID("$NetBSD: miscbltin.c,v 1.19 1997/07/04 21:02:09 christos Exp $");
#endif
#endif /* not lint */
@ -62,6 +63,7 @@ static char rcsid[] = "$NetBSD: miscbltin.c,v 1.18 1997/04/11 23:08:15 christos
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "miscbltin.h"
#include "mystring.h"
#undef eflag
@ -295,7 +297,7 @@ ulimitcmd(argc, argv)
char **argv;
{
int c;
rlim_t val;
rlim_t val = 0;
enum { SOFT = 0x1, HARD = 0x2 }
how = SOFT | HARD;
const struct limits *l;

34
bin/sh/miscbltin.h Normal file
View File

@ -0,0 +1,34 @@
/* $NetBSD: miscbltin.h,v 1.1 1997/07/04 21:02:10 christos Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christos Zoulas.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
int readcmd __P((int, char **));
int umaskcmd __P((int, char **));
int ulimitcmd __P((int, char **));

View File

@ -1,5 +1,5 @@
#!/bin/sh -
# $NetBSD: mkbuiltins,v 1.12 1995/05/11 21:29:33 christos Exp $
# $NetBSD: mkbuiltins,v 1.13 1997/07/04 21:02:10 christos Exp $
#
# Copyright (c) 1991, 1993
# The Regents of the University of California. All rights reserved.
@ -60,9 +60,9 @@ cat <<\!
!
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
print $0}' builtins.def | sed 's/-j//' > $temp
awk '{ printf "int %s();\n", $1}' $temp
awk '{ printf "int %s __P((int, char **));\n", $1}' $temp
echo '
int (*const builtinfunc[])() = {'
int (*const builtinfunc[]) __P((int, char **)) = {'
awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp
echo '};
@ -89,6 +89,6 @@ struct builtincmd {
int code;
};
extern int (*const builtinfunc[])();
extern int (*const builtinfunc[]) __P((int, char **));
extern const struct builtincmd builtincmd[];'
rm -f $temp

View File

@ -1,4 +1,4 @@
/* $NetBSD: mkinit.c,v 1.16 1997/01/11 02:04:39 tls Exp $ */
/* $NetBSD: mkinit.c,v 1.17 1997/07/04 21:02:11 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,17 +36,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: mkinit.c,v 1.16 1997/01/11 02:04:39 tls Exp $";
__RCSID("$NetBSD: mkinit.c,v 1.17 1997/07/04 21:02:11 christos Exp $");
#endif
#endif /* not lint */
@ -167,6 +167,7 @@ FILE *ckfopen __P((char *, char *));
void *ckmalloc __P((int));
char *savestr __P((char *));
void error __P((char *));
int main __P((int, char **));
#define equal(s1, s2) (strcmp(s1, s2) == 0)
@ -179,6 +180,7 @@ main(argc, argv)
header_files[0] = "\"shell.h\"";
header_files[1] = "\"mystring.h\"";
header_files[2] = "\"init.h\"";
for (ap = argv + 1 ; *ap ; ap++)
readfile(*ap);
output();

View File

@ -1,4 +1,4 @@
/* $NetBSD: mknodes.c,v 1.14 1997/04/11 23:03:08 christos Exp $ */
/* $NetBSD: mknodes.c,v 1.15 1997/07/04 21:02:12 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,17 +36,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: mknodes.c,v 1.14 1997/04/11 23:03:08 christos Exp $";
__RCSID("$NetBSD: mknodes.c,v 1.15 1997/07/04 21:02:12 christos Exp $");
#endif
#endif /* not lint */
@ -115,6 +115,7 @@ static void skipbl __P((void));
static int readline __P((void));
static void error __P((const char *, ...));
static char *savestr __P((const char *));
int main __P((int, char **));
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: mksyntax.c,v 1.12 1996/10/16 14:46:35 christos Exp $ */
/* $NetBSD: mksyntax.c,v 1.13 1997/07/04 21:02:14 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,17 +36,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: mksyntax.c,v 1.12 1996/10/16 14:46:35 christos Exp $";
__RCSID("$NetBSD: mksyntax.c,v 1.13 1997/07/04 21:02:14 christos Exp $");
#endif
#endif /* not lint */
@ -118,6 +118,7 @@ static void add __P((char *, char *));
static void print __P((char *));
static void output_type_macros __P((void));
static void digit_convert __P((void));
int main __P((int, char **));
int
main(argc, argv)

View File

@ -1,4 +1,4 @@
/* $NetBSD: mystring.c,v 1.12 1997/01/11 02:04:42 tls Exp $ */
/* $NetBSD: mystring.c,v 1.13 1997/07/04 21:02:15 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)mystring.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: mystring.c,v 1.12 1997/01/11 02:04:42 tls Exp $";
__RCSID("$NetBSD: mystring.c,v 1.13 1997/07/04 21:02:15 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.24 1997/03/14 01:42:22 christos Exp $ */
/* $NetBSD: options.c,v 1.25 1997/07/04 21:02:16 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: options.c,v 1.24 1997/03/14 01:42:22 christos Exp $";
__RCSID("$NetBSD: options.c,v 1.25 1997/07/04 21:02:16 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: output.c,v 1.18 1997/04/11 23:05:43 christos Exp $ */
/* $NetBSD: output.c,v 1.19 1997/07/04 21:02:18 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: output.c,v 1.18 1997/04/11 23:05:43 christos Exp $";
__RCSID("$NetBSD: output.c,v 1.19 1997/07/04 21:02:18 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: parser.c,v 1.35 1997/03/14 01:42:23 christos Exp $ */
/* $NetBSD: parser.c,v 1.36 1997/07/04 21:02:19 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#else
static char rcsid[] = "$NetBSD: parser.c,v 1.35 1997/03/14 01:42:23 christos Exp $";
__RCSID("$NetBSD: parser.c,v 1.36 1997/07/04 21:02:19 christos Exp $");
#endif
#endif /* not lint */
@ -696,8 +697,6 @@ peektoken() {
return (t);
}
STATIC int xxreadtoken();
STATIC int
readtoken() {
int t;
@ -1264,6 +1263,9 @@ parsebackq: {
struct jmploc *volatile savehandler;
int savelen;
int saveprompt;
#ifdef __GNUC__
(void) &saveprompt;
#endif
savepbq = parsebackquote;
if (setjmp(jmploc.loc)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: redir.c,v 1.15 1997/04/21 12:38:25 christos Exp $ */
/* $NetBSD: redir.c,v 1.16 1997/07/04 21:02:21 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)redir.c 8.2 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: redir.c,v 1.15 1997/04/21 12:38:25 christos Exp $";
__RCSID("$NetBSD: redir.c,v 1.16 1997/07/04 21:02:21 christos Exp $");
#endif
#endif /* not lint */
@ -104,7 +105,7 @@ redirect(redir, flags)
int flags;
{
union node *n;
struct redirtab *sv;
struct redirtab *sv = NULL;
int i;
int fd;
int try;

View File

@ -1,4 +1,4 @@
/* $NetBSD: show.c,v 1.14 1997/04/11 23:06:52 christos Exp $ */
/* $NetBSD: show.c,v 1.15 1997/07/04 21:02:22 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: show.c,v 1.14 1997/04/11 23:06:52 christos Exp $";
__RCSID("$NetBSD: show.c,v 1.15 1997/07/04 21:02:22 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.16 1996/10/16 15:45:19 christos Exp $ */
/* $NetBSD: trap.c,v 1.17 1997/07/04 21:02:24 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95";
#else
static char rcsid[] = "$NetBSD: trap.c,v 1.16 1996/10/16 15:45:19 christos Exp $";
__RCSID("$NetBSD: trap.c,v 1.17 1997/07/04 21:02:24 christos Exp $");
#endif
#endif /* not lint */
@ -163,7 +164,6 @@ setsignal(signo)
int action;
sig_t sigact = SIG_DFL;
char *t;
extern void onsig();
if ((t = trap[signo]) == NULL)
action = S_DFL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: var.c,v 1.18 1997/04/11 22:45:38 christos Exp $ */
/* $NetBSD: var.c,v 1.19 1997/07/04 21:02:25 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#else
static char rcsid[] = "$NetBSD: var.c,v 1.18 1997/04/11 22:45:38 christos Exp $";
__RCSID("$NetBSD: var.c,v 1.19 1997/07/04 21:02:25 christos Exp $");
#endif
#endif /* not lint */
@ -199,6 +200,9 @@ setvarsafe(name, val, flags)
struct jmploc jmploc;
struct jmploc *volatile savehandler = handler;
int err = 0;
#ifdef __GNUC__
(void) &err;
#endif
if (setjmp(jmploc.loc))
err = 1;
@ -423,7 +427,7 @@ environment() {
*/
#ifdef mkinit
MKINIT void shprocvar();
MKINIT void shprocvar __P((void));
SHELLPROC {
shprocvar();