From: Alan Cox Date: Sun, 10 May 2015 22:37:16 +0000 (+0100) Subject: sh: ansify error.c X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=f2773a02a1050d12981ebd983e2289b9a0b99cbf;p=FUZIX.git sh: ansify error.c --- diff --git a/Applications/V7/cmd/sh/defs.h b/Applications/V7/cmd/sh/defs.h index e131c61e..136bf7be 100644 --- a/Applications/V7/cmd/sh/defs.h +++ b/Applications/V7/cmd/sh/defs.h @@ -308,3 +308,11 @@ extern int builtin(int argn, STRING *cmd); /* cmd.c */ extern TREPTR makefork(int flgs, TREPTR i); extern TREPTR cmd(int sym, int flg); +/* error.c */ +extern void exitset(void); +extern void sigchk(void); +extern void failed(const STRING s1, const STRING s2); +extern void error(const STRING s); +extern void exitsh(int xno); +extern void done(void); +extern void rmtemp(IOPTR base); diff --git a/Applications/V7/cmd/sh/error.c b/Applications/V7/cmd/sh/error.c index 3f6a5281..28b98414 100644 --- a/Applications/V7/cmd/sh/error.c +++ b/Applications/V7/cmd/sh/error.c @@ -14,25 +14,22 @@ /* ======== error handling ======== */ -exitset() +void exitset(void) { assnum(&exitadr, exitval); } -sigchk() +void sigchk(void) { /* Find out if it is time to go away. * `trapnote' is set to SIGSET when fault is seen and * no trap has been set. */ - if (trapnote & SIGSET) { + if (trapnote & SIGSET) exitsh(SIGFAIL); - ; - } } -failed(s1, s2) -STRING s1, s2; +void failed(const STRING s1, const STRING s2) { prp(); prs(s1); @@ -45,14 +42,12 @@ STRING s1, s2; exitsh(ERROR); } -error(s) -STRING s; +void error(const STRING s) { failed(s, NIL); } -exitsh(xno) -int xno; +void exitsh(int xno) { /* Arrive here from `FATAL' errors * a) exit command, @@ -71,7 +66,7 @@ int xno; } } -done() +void done(void) { register STRING t; if (t = trapcom[0] @@ -84,12 +79,10 @@ done() exit(exitval); } -rmtemp(base) -IOPTR base; +void rmtemp(IOPTR base) { while (iotemp > base) { unlink(iotemp->ioname); iotemp = iotemp->iolst; - ; } }