summaryrefslogtreecommitdiffstats
path: root/bin/sh/arith.y
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-02 06:50:57 +0000
committerimp <imp@FreeBSD.org>2002-02-02 06:50:57 +0000
commit5ef5088ac4e038d0a147a08377ef087fd6edf527 (patch)
tree01a827446e9ba4f34cf1e754fcac691f6c9eb1cf /bin/sh/arith.y
parent50014e35418ca00d25ea852fc4f94acf80be4df3 (diff)
downloadFreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.zip
FreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.tar.gz
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o Change int foo() { ... to int foo(void) { ...
Diffstat (limited to 'bin/sh/arith.y')
-rw-r--r--bin/sh/arith.y21
1 files changed, 8 insertions, 13 deletions
diff --git a/bin/sh/arith.y b/bin/sh/arith.y
index c565e51..8438e09 100644
--- a/bin/sh/arith.y
+++ b/bin/sh/arith.y
@@ -105,12 +105,11 @@ static const char rcsid[] =
char *arith_buf, *arith_startbuf;
extern void arith_lex_reset();
-int yylex __P((void));
-int yyparse __P((void));
+int yylex(void);
+int yyparse(void);
int
-arith(s)
- char *s;
+arith(char *s)
{
long result;
@@ -125,8 +124,7 @@ arith(s)
}
void
-yyerror(s)
- char *s;
+yyerror(char *s)
{
yyerrok;
@@ -139,9 +137,7 @@ yyerror(s)
* The exp(1) builtin.
*/
int
-expcmd(argc, argv)
- int argc;
- char **argv;
+expcmd(int argc, char **argv)
{
char *p;
char *concat;
@@ -178,13 +174,12 @@ expcmd(argc, argv)
/*************************/
#ifdef TEST_ARITH
#include <stdio.h>
-main(argc, argv)
- char *argv[];
+main(int argc, char *argv[])
{
printf("%d\n", exp(argv[1]));
}
-error(s)
- char *s;
+
+error(char *s)
{
fprintf(stderr, "exp: %s\n", s);
exit(1);
OpenPOWER on IntegriCloud