From 5ef5088ac4e038d0a147a08377ef087fd6edf527 Mon Sep 17 00:00:00 2001 From: imp Date: Sat, 2 Feb 2002 06:50:57 +0000 Subject: 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) { ... --- bin/sh/redir.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'bin/sh/redir.c') diff --git a/bin/sh/redir.c b/bin/sh/redir.c index b51fa2b..b596463 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -84,8 +84,8 @@ MKINIT struct redirtab *redirlist; */ int fd0_redirected = 0; -STATIC void openredirect __P((union node *, char[10 ])); -STATIC int openhere __P((union node *)); +STATIC void openredirect(union node *, char[10 ]); +STATIC int openhere(union node *); /* @@ -97,10 +97,8 @@ STATIC int openhere __P((union node *)); */ void -redirect(redir, flags) - union node *redir; - int flags; - { +redirect(union node *redir, int flags) +{ union node *n; struct redirtab *sv = NULL; int i; @@ -161,10 +159,8 @@ again: STATIC void -openredirect(redir, memory) - union node *redir; - char memory[10]; - { +openredirect(union node *redir, char memory[10]) +{ int fd = redir->nfile.fd; char *fname; int f; @@ -260,9 +256,8 @@ movefd: */ STATIC int -openhere(redir) - union node *redir; - { +openhere(union node *redir) +{ int pip[2]; int len = 0; @@ -302,7 +297,8 @@ out: */ void -popredir() { +popredir(void) +{ struct redirtab *rp = redirlist; int i; @@ -344,7 +340,8 @@ SHELLPROC { /* Return true if fd 0 has already been redirected at least once. */ int -fd0_redirected_p () { +fd0_redirected_p(void) +{ return fd0_redirected != 0; } @@ -353,7 +350,8 @@ fd0_redirected_p () { */ void -clearredir() { +clearredir(void) +{ struct redirtab *rp; int i; @@ -376,9 +374,7 @@ clearredir() { */ int -copyfd(from, to) - int from; - int to; +copyfd(int from, int to) { int newfd; -- cgit v1.1