1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtksh: remove register keyword

This commit is contained in:
Jon Trulson 2018-06-27 17:18:06 -06:00
parent 556ce45298
commit 97264ba971
296 changed files with 2503 additions and 2503 deletions

View file

@ -200,11 +200,11 @@ DtCompareISOLatin1(
char *first,
char *second )
{
register unsigned char *ap, *bp;
unsigned char *ap, *bp;
for (ap = (unsigned char *) first, bp = (unsigned char *) second;
*ap && *bp; ap++, bp++) {
register unsigned char a, b;
unsigned char a, b;
if ((a = *ap) != (b = *bp)) {
/* try lowercasing and try again */

View file

@ -294,7 +294,7 @@ do_call(
char *p;
char dorun, promptflag;
unsigned char freeval, ret_type;
register int i, j, ret;
int i, j, ret;
char * msg;
char * errbuf;
char * errmsg;

View file

@ -69,7 +69,7 @@
#include "msgs.h"
#include <locale.h>
extern Namval_t *sh_assignok(register Namval_t *np,int add);
extern Namval_t *sh_assignok(Namval_t *np,int add);
static void PendingDestroy(
@ -542,8 +542,8 @@ parse_args(
char ** pargv ,
Boolean postponePixmaps )
{
register int i;
register char *colon, *resource, *val, *p;
int i;
char *colon, *resource, *val, *p;
XtArgVal argval;
int freeflag, len;
char * errmsg;
@ -638,7 +638,7 @@ free_args(
int n,
Arg *args )
{
register int i;
int i;
/*
* Free up argument pointers
@ -700,7 +700,7 @@ _CreateWidget(
wtab_t *w, *pw, *wtab;
char *wname, *wclass, *parentid, *var;
Arg args[MAXARGS];
register int i;
int i;
int n;
char * errmsg;
int pargc;
@ -777,7 +777,7 @@ do_XtCreateApplicationShell(
wtab_t *w, *wtab;
char *wname, *wclass, *var;
Arg args[MAXARGS];
register int i;
int i;
int n;
char * errmsg;
int pargc;
@ -916,7 +916,7 @@ do_single_widget_arg_func(
char **argv )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc < 2) {
@ -950,7 +950,7 @@ do_single_widget_test_func(
char **argv )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc != 2) {
@ -985,7 +985,7 @@ do_XtIsShell(
char *argv[] )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc != 2)
@ -1044,7 +1044,7 @@ do_XtMapWidget(
char *argv[] )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc < 2) {
@ -1068,7 +1068,7 @@ do_XtUnmapWidget(
char **argv )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc < 2) {
@ -1681,7 +1681,7 @@ do_XtGetValues(
int argc,
char **argv )
{
register int i, j;
int i, j;
int n;
char *arg0 = argv[0];
char *val, *p, *str;
@ -2030,7 +2030,7 @@ do_managelist_func(
int (*func)() )
{
wtab_t *w;
register int i;
int i;
Widget widgets[MAXARGS];
Cardinal nwidgets;
char * errmsg;
@ -2059,7 +2059,7 @@ do_XtIsSubclass(
char *argv[] )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc != 3)
@ -2095,7 +2095,7 @@ do_XtClass(
char *argv[] )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
WidgetClass class;
@ -2346,7 +2346,7 @@ do_XtRemoveAllCallbacks(
char *argv[] )
{
wtab_t *w;
register int i;
int i;
char * errmsg;
if (argc != 3) {
@ -2480,7 +2480,7 @@ invokeXDrawFunction(
unsigned int width, height;
char *s;
char *sp;
register int i;
int i;
int mode, parse;
int text = FALSE;
int (*func)();
@ -3307,7 +3307,7 @@ do_XtAddInput(
int argc,
char *argv[] )
{
register int i, j;
int i, j;
int fd;
char *arg0 = argv[0];
char *variable;
@ -3811,7 +3811,7 @@ stdInputCB(
char cmdbuf[LINESIZE];
int cmd;
char *p;
register int i, n, j;
int i, n, j;
char * errmsg;
int len;

View file

@ -450,7 +450,7 @@ DtkshCvtCallbackToString(
{
XtCallbackList cb;
char buf[2048];
register char *p;
char *p;
char * errmsg;
Boolean count = 0;

View file

@ -139,7 +139,7 @@ xk_prin_int(
unsigned long *old_v )
{
register int i, printed = 0;
int i, printed = 0;
struct symlist *sym;
unsigned long v;
@ -226,7 +226,7 @@ xk_par_int(
long *v,
struct envsymbols *env )
{
register int ret, base;
int ret, base;
char *p, *q, *pp;
char nbuf[512];
@ -339,7 +339,7 @@ xk_prin_charstr(
unsigned char *str,
int len )
{
register int i;
int i;
if (str == NULL)
*buf += lsprintf(*buf, "NULL");
@ -390,7 +390,7 @@ xk_prin_hexstr(
char *str,
int len )
{
register int i;
int i;
unsigned char tempc;
if (str == NULL)
@ -443,7 +443,7 @@ xk_par_charstr(
char **str,
int *len )
{
register int i;
int i;
char delim;
int didmalloc = FALSE, getmode;
char cbuf[3]; /* conversion buffer for hex strings */

View file

@ -168,7 +168,7 @@ xk_parse(
memtbl_t *(*tbl_find)() )
{
memtbl_t *ntbl;
register int i = 0;
int i = 0;
int skind, delim_type;
long val = 0; /* used for choice selection */
char *np;
@ -726,7 +726,7 @@ xk_print(
memtbl_t *(*tbl_find)() )
{
memtbl_t *ntbl;
register int i;
int i;
long val; /* used for choice selection */
char *np;
int delim = _Delim;
@ -962,7 +962,7 @@ xk_free(
memtbl_t *(*tbl_find)() )
{
memtbl_t *ntbl;
register int i;
int i;
long val; /* used for choice selection */
char *np;
int delim = _Delim;

View file

@ -113,7 +113,7 @@ env_set_var(
char *var,
char *val )
{
register int len;
int len;
char tmp[512];
char *set = &tmp[0];

View file

@ -129,7 +129,7 @@ error __PARAM__((int level, const char* file, const char* msg), (level, file, ms
*/
static int
shipnewer __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){
shipnewer __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
unsigned long ref;
struct stat st;
@ -146,9 +146,9 @@ static char buf[4096];
static unsigned long
sealfile __PARAM__((char* file, int fd, unsigned long s), (file, fd, s)) __OTORP__(char* file; int fd; unsigned long s;){
register unsigned char* b;
register unsigned char* e;
register int n;
unsigned char* b;
unsigned char* e;
int n;
HASHPART(s, 0);
while ((n = read(fd, buf, sizeof(buf))) > 0)
@ -166,9 +166,9 @@ sealfile __PARAM__((char* file, int fd, unsigned long s), (file, fd, s)) __OTORP
*/
static int
shipseal __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){
register char* f;
register int fd;
shipseal __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
char* f;
int fd;
unsigned long s;
s = 0;
@ -192,9 +192,9 @@ shipseal __PARAM__((register char** argv), (argv)) __OTORP__(register char** arg
*/
static int
shipstate __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){
register char* s;
register int c;
shipstate __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
char* s;
int c;
long ref;
struct stat st;
@ -225,7 +225,7 @@ shipstate __PARAM__((register char** argv), (argv)) __OTORP__(register char** ar
*/
static int
shiptime __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){
shiptime __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
struct stat st;
time_t date;
@ -262,8 +262,8 @@ static struct optab ops[] =
int
main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){
register char* s;
register int i;
char* s;
int i;
if (!(s = *++argv))
exit(0);

View file

@ -2037,12 +2037,12 @@ static char* oct = &hex[14];
void
ppfsm __PARAM__((int op, register char* s), (op, s)) __OTORP__(int op; register char* s;){
register int c;
register int n;
register int i;
register short* rp;
register struct fsminit* fp;
ppfsm __PARAM__((int op, char* s), (op, s)) __OTORP__(int op; char* s;){
int c;
int n;
int i;
short* rp;
struct fsminit* fp;
@ -2556,8 +2556,8 @@ static int errors;
static int
sstrlen __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
register char* b;
sstrlen __PARAM__((char* s), (s)) __OTORP__(char* s;){
char* b;
for (b = s; *s; s++);
return(s - b);
@ -2568,8 +2568,8 @@ sstrlen __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
static int
sstrncmp __PARAM__((register char* s, register char* t, register int n), (s, t, n)) __OTORP__(register char* s; register char* t; register int n;){
register char* e = s + n;
sstrncmp __PARAM__((char* s, char* t, int n), (s, t, n)) __OTORP__(char* s; char* t; int n;){
char* e = s + n;
while (s < e)
{
@ -2585,8 +2585,8 @@ sstrncmp __PARAM__((register char* s, register char* t, register int n), (s, t,
static char*
memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTORP__(register char* s; register char* t; int n;){
register char* e = t + n;
memcopy __PARAM__((char* s, char* t, int n), (s, t, n)) __OTORP__(char* s; char* t; int n;){
char* e = t + n;
while (t < e) *s++ = *t++;
return(s);
@ -2597,7 +2597,7 @@ memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTOR
static char*
strcopy __PARAM__((register char* s, register char* t), (s, t)) __OTORP__(register char* s; register char* t;){
strcopy __PARAM__((char* s, char* t), (s, t)) __OTORP__(char* s; char* t;){
while (*s++ = *t++);
return(s - 1);
}
@ -2612,8 +2612,8 @@ strcopy __PARAM__((register char* s, register char* t), (s, t)) __OTORP__(regist
static char*
comment __PARAM__((register char* p, register char* s, register int n, int u), (p, s, n, u)) __OTORP__(register char* p; register char* s; register int n; int u;){
register char* e;
comment __PARAM__((char* p, char* s, int n, int u), (p, s, n, u)) __OTORP__(char* p; char* s; int n; int u;){
char* e;
char* m;
if (!s)
@ -2675,10 +2675,10 @@ typedef struct
} Notice_t;
static char*
copyright __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(register char* p; register char* s;){
register char* v;
register char* x;
register int c;
copyright __PARAM__((char* p, char* s), (p, s)) __OTORP__(char* p; char* s;){
char* v;
char* x;
int c;
int i;
int n;
unsigned long h;
@ -2909,8 +2909,8 @@ copyright __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(regi
static char*
number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register char* p; register long n;){
register long d;
number __PARAM__((char* p, long n), (p, n)) __OTORP__(char* p; long n;){
long d;
for (d = 1000000; d > 1; d /= 10)
if (n >= d) *p++ = '0' + (n / d) % 10;
@ -2925,13 +2925,13 @@ number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register
static void
proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level, msg, arg)) __OTORP__(char* iob; int level; char* msg; char* arg;){
register char* p;
char* p;
char buf[1024];
p = strcopy(buf, "proto: ");
if (iob)
{
register struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
if (proto->line)
{
@ -2977,7 +2977,7 @@ proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level,
static char*
linesync __PARAM__((register struct proto* proto, register char* p, register long n), (proto, p, n)) __OTORP__(register struct proto* proto; register char* p; register long n;){
linesync __PARAM__((struct proto* proto, char* p, long n), (proto, p, n)) __OTORP__(struct proto* proto; char* p; long n;){
if (proto->flags & (1L<<12))
@ -3077,12 +3077,12 @@ init __PARAM__((char* op, int flags), (op, flags)) __OTORP__(char* op; int flags
static int
lex __PARAM__((register struct proto* proto, register long flags), (proto, flags)) __OTORP__(register struct proto* proto; register long flags;){
register char* ip;
register char* op;
register int c;
register int state;
register short* rp;
lex __PARAM__((struct proto* proto, long flags), (proto, flags)) __OTORP__(struct proto* proto; long flags;){
char* ip;
char* op;
int c;
int state;
short* rp;
char* m;
char* e;
char* t;
@ -4478,7 +4478,7 @@ if !defined(va_start)\n\
void
pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
register struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
if (proto->flags & (1L<<15)) close(proto->fd);
free((char*)proto);
@ -4496,10 +4496,10 @@ pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
char*
pppopen __PARAM__((char* file, int fd, char* notice, int flags), (file, fd, notice, flags)) __OTORP__(char* file; int fd; char* notice; int flags;){
register struct proto* proto;
register char* iob;
register long n;
register char* s;
struct proto* proto;
char* iob;
long n;
char* s;
int pragma;
char* b;
@ -4771,8 +4771,8 @@ pppopen __PARAM__((char* file, int fd, char* notice, int flags), (file, fd, noti
int
pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
register struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
register int n;
struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
int n;
if (proto->flags & (1L<<17))
{
@ -4796,9 +4796,9 @@ pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
if (proto->flags & (1L<<29))
{
register char* ip = proto->ip;
register char* op = proto->ob;
register char* ep = proto->ob + proto->oz - 2;
char* ip = proto->ip;
char* op = proto->ob;
char* ep = proto->ob + proto->oz - 2;
if (!*ip)
{

View file

@ -120,7 +120,7 @@ static void trap_timeout __PROTO__((__V_*));
* insert timeout item on current given list in sorted order
*/
static __V_ *time_add __PARAM__((struct tevent *item, __V_ *list), (item, list)) __OTORP__(struct tevent *item; __V_ *list;){
register struct tevent *tp = (struct tevent*)list;
struct tevent *tp = (struct tevent*)list;
if(!tp || item->milli < tp->milli)
{
item->next = tp;
@ -141,8 +141,8 @@ static __V_ *time_add __PARAM__((struct tevent *item, __V_ *list), (item, list))
/*
* delete timeout item from current given list, delete timer
*/
static __V_ *time_delete __PARAM__((register struct tevent *item, __V_ *list), (item, list)) __OTORP__(register struct tevent *item; __V_ *list;){
register struct tevent *tp = (struct tevent*)list;
static __V_ *time_delete __PARAM__((struct tevent *item, __V_ *list), (item, list)) __OTORP__(struct tevent *item; __V_ *list;){
struct tevent *tp = (struct tevent*)list;
if(item==tp)
list = (__V_*)tp->next;
else
@ -158,12 +158,12 @@ static __V_ *time_delete __PARAM__((register struct tevent *item, __V_ *list),
}
static void print_alarms __PARAM__((__V_ *list), (list)) __OTORP__(__V_ *list;){
register struct tevent *tp = (struct tevent*)list;
struct tevent *tp = (struct tevent*)list;
while(tp)
{
if(tp->timeout)
{
register char *name = nv_name(tp->node);
char *name = nv_name(tp->node);
if(tp->flags&R_FLAG)
{
double d = tp->milli;
@ -177,7 +177,7 @@ static void print_alarms __PARAM__((__V_ *list), (list)) __OTORP__(__V_ *list;){
}
static void trap_timeout __PARAM__((__V_* handle), (handle)) __OTORP__(__V_* handle;){
register struct tevent *tp = (struct tevent*)handle;
struct tevent *tp = (struct tevent*)handle;
sh.trapnote |= SH_SIGTRAP;
if(!(tp->flags&R_FLAG))
tp->timeout = 0;
@ -188,8 +188,8 @@ static void trap_timeout __PARAM__((__V_* handle), (handle)) __OTORP__(__V_* han
}
void sh_timetraps __PARAM__((void), ()){
register struct tevent *tp, *tpnext;
register struct tevent *tptop;
struct tevent *tp, *tpnext;
struct tevent *tptop;
while(1)
{
sh.sigflag[SIGALRM] &= ~SH_SIGTRAP;
@ -222,7 +222,7 @@ void sh_timetraps __PARAM__((void), ()){
static char *setdisc __PARAM__((Namval_t *np, const char *event, Namval_t* action, Namfun_t
*fp), (np, event, action, fp)) __OTORP__(Namval_t *np; const char *event; Namval_t* action; Namfun_t
*fp;){
register struct tevent *tp = (struct tevent*)fp;
struct tevent *tp = (struct tevent*)fp;
if(!event)
return(action?"":(char*)ALARM);
if(strcmp(event,ALARM)!=0)
@ -241,8 +241,8 @@ static char *setdisc __PARAM__((Namval_t *np, const char *event, Namval_t* actio
* catch assignments and set alarm traps
*/
static void putval __PARAM__((Namval_t* np, const char* val, int flag, Namfun_t* fp), (np, val, flag, fp)) __OTORP__(Namval_t* np; const char* val; int flag; Namfun_t* fp;){
register struct tevent *tp;
register double d;
struct tevent *tp;
double d;
if(val)
{
double now;
@ -290,9 +290,9 @@ static const Namdisc_t alarmdisc =
};
int b_alarm __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int n,rflag=0;
register Namval_t *np;
register struct tevent *tp;
int n,rflag=0;
Namval_t *np;
struct tevent *tp;
NOT_USED(extra);
while (n = optget(argv, sh_optalarm)) switch (n)
{

View file

@ -102,8 +102,8 @@
#include <ls.h>
int b_cd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register char *dir, *cdpath="";
register const char *dp;
char *dir, *cdpath="";
const char *dp;
int saverrno=0;
int rval,flag = (sh_isoption(SH_PHYSICAL)!=0);
char *oldpwd;
@ -174,7 +174,7 @@ int b_cd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __
}
if(!flag)
{
register char *cp;
char *cp;
stakseek(PATH_MAX+PATH_OFFSET);
#ifdef SHOPT_FS_3D
if(!(cp = pathcanon(stakptr(PATH_OFFSET),PATH_DOTDOT)))
@ -235,8 +235,8 @@ success:
}
int b_pwd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register int n, flag = (sh_isoption(SH_PHYSICAL)!=0);
register char *cp;
int n, flag = (sh_isoption(SH_PHYSICAL)!=0);
char *cp;
NOT_USED(extra);
NOT_USED(argc);
while((n = optget(argv,sh_optpwd))) switch(n)

View file

@ -102,9 +102,9 @@
/*
* return and exit
*/
int b_ret_exit __PARAM__((register int n, register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n; register char *argv[];__V_ *extra;){
int b_ret_exit __PARAM__((int n, char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[];__V_ *extra;){
struct checkpt *pp = (struct checkpt*)sh.jmplist;
register char *arg;
char *arg;
NOT_USED(extra);
while((n = optget(argv,sh_optcflow))) switch(n)
{
@ -133,9 +133,9 @@ done:
/*
* break and continue
*/
int b_brk_cont __PARAM__((register int n, register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n; register char *argv[];__V_ *extra;){
int b_brk_cont __PARAM__((int n, char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[];__V_ *extra;){
char *arg;
register int cont= **argv=='c';
int cont= **argv=='c';
NOT_USED(extra);
while((n = optget(argv,sh_optcflow))) switch(n)
{

View file

@ -103,10 +103,10 @@
#define next_config(p) ((Shtable_t*)((char*)(p) + sizeof(*shtab_config)))
#define MIN_LEN 20
int b_getconf __PARAM__((register int argc, char *argv[]), (argc, argv)) __OTORP__(register int argc; char *argv[];){
register int m,n;
register long val;
register const char *name, *path="";
int b_getconf __PARAM__((int argc, char *argv[]), (argc, argv)) __OTORP__(int argc; char *argv[];){
int m,n;
long val;
const char *name, *path="";
int offset = staktell();
const Shtable_t *tp = shtab_config;
error_info.id = argv[0];

View file

@ -99,9 +99,9 @@
#include "builtins.h"
int b_getopts __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *options=error_info.context->id;
register Namval_t *np;
register int flag, mode, r=0;
char *options=error_info.context->id;
Namval_t *np;
int flag, mode, r=0;
static char value[2], key[2];
NOT_USED(extra);
while((flag = optget(argv,sh_optgetopts))) switch(flag)

View file

@ -106,9 +106,9 @@
static void hist_subst __PROTO__((const char*, int fd, char*));
int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register History_t *hp;
register char *arg;
register int flag,fdo;
History_t *hp;
char *arg;
int flag,fdo;
struct stat statb;
time_t before;
Sfio_t *outfile;
@ -301,9 +301,9 @@ int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra))
*/
static void hist_subst __PARAM__((const char *command,int fd,char *replace), (command, fd, replace)) __OTORP__(const char *command;int fd;char *replace;){
register char *newp=replace;
register char *sp;
register int c;
char *newp=replace;
char *sp;
int c;
off_t size;
char *string;
while(*++newp != '='); /* skip to '=' */

View file

@ -109,7 +109,7 @@ static void noexport __PROTO__((Namval_t*));
static char *arg0;
int b_exec __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register int n;
int n;
sh.st.ioset = 0;
clear = 0;
NOT_USED(extra);
@ -137,7 +137,7 @@ int b_exec __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra
return(0);
}
static void noexport __PARAM__((register Namval_t* np), (np)) __OTORP__(register Namval_t* np;){
static void noexport __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
nv_offattr(np,NV_EXPORT);
}
@ -149,9 +149,9 @@ int b_login __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra
error(ERROR_exit(1),e_restricted,argv[0]);
else
{
register struct argnod *arg=sh.envlist;
register Namval_t* np;
register char *cp;
struct argnod *arg=sh.envlist;
Namval_t* np;
char *cp;
if(sh.subshell)
sh_subfork();
if(clear)
@ -183,8 +183,8 @@ int b_login __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra
}
int b_let __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int r;
register char *arg;
int r;
char *arg;
NOT_USED(argc);
NOT_USED(extra);
while (r = optget(argv,sh_optlet)) switch (r)
@ -205,7 +205,7 @@ int b_let __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra))
}
int b_eval __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register int r;
int r;
NOT_USED(argc);
NOT_USED(extra);
while (r = optget(argv,sh_opteval)) switch (r)
@ -228,10 +228,10 @@ int b_eval __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra
return(sh.exitval);
}
int b_dot_cmd __PARAM__((register int n,char *argv[],__V_* extra), (n, argv, extra)) __OTORP__(register int n;char *argv[];__V_* extra;){
register char *script;
register Namval_t *np;
register int jmpval;
int b_dot_cmd __PARAM__((int n,char *argv[],__V_* extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_* extra;){
char *script;
Namval_t *np;
int jmpval;
int fd;
struct dolnod *argsave=0, *saveargfor;
char **saveargv;
@ -314,7 +314,7 @@ int b_dot_cmd __PARAM__((register int n,char *argv[],__V_* extra), (n, argv,
/*
* null, true command
*/
int b_true __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){
int b_true __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(argc);
NOT_USED(argv[0]);
NOT_USED(extra);
@ -324,15 +324,15 @@ int b_true __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, arg
/*
* false command
*/
int b_false __PARAM__((int argc,register char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[]; __V_ *extra;){
int b_false __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
NOT_USED(argc);
NOT_USED(argv[0]);
NOT_USED(extra);
return(1);
}
int b_shift __PARAM__((register int n, register char *argv[], __V_ *extra), (n, argv, extra)) __OTORP__(register int n; register char *argv[]; __V_ *extra;){
register char *arg;
int b_shift __PARAM__((int n, char *argv[], __V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[]; __V_ *extra;){
char *arg;
NOT_USED(extra);
while((n = optget(argv,sh_optcflow))) switch(n)
{
@ -357,7 +357,7 @@ int b_shift __PARAM__((register int n, register char *argv[], __V_ *extra), (
return(0);
}
int b_wait __PARAM__((register int n,register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n;register char *argv[];__V_ *extra;){
int b_wait __PARAM__((int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_ *extra;){
NOT_USED(extra);
while((n = optget(argv,sh_optjoblist))) switch(n)
{
@ -376,8 +376,8 @@ int b_wait __PARAM__((register int n,register char *argv[],__V_ *extra), (n,
}
#ifdef JOBS
int b_bg_fg __PARAM__((register int n,register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n;register char *argv[];__V_ *extra;){
register int flag = **argv;
int b_bg_fg __PARAM__((int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_ *extra;){
int flag = **argv;
NOT_USED(extra);
while((n = optget(argv,sh_optjoblist))) switch(n)
{
@ -404,8 +404,8 @@ int b_bg_fg __PARAM__((register int n,register char *argv[],__V_ *extra), (n,
return(sh.exitval);
}
int b_jobs __PARAM__((register int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n;char *argv[];__V_ *extra;){
register int flag = 0;
int b_jobs __PARAM__((int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_ *extra;){
int flag = 0;
NOT_USED(extra);
while((n = optget(argv,sh_optjobs))) switch(n)
{
@ -443,8 +443,8 @@ int b_jobs __PARAM__((register int n,char *argv[],__V_ *extra), (n, argv, ext
* setuniv() calls.
*/
int b_universe __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register char *arg;
register int n;
char *arg;
int n;
NOT_USED(extra);
while((n = optget(argv,sh_optuniverse))) switch(n)
{
@ -476,10 +476,10 @@ int b_universe __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extr
#endif /* cmd_universe */
#ifdef SHOPT_FS_3D
int b_vpath_map __PARAM__((register int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(register int argc;char *argv[]; __V_ *extra;){
register int flag, n;
register const char *optstr;
register char *vend;
int b_vpath_map __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
int flag, n;
const char *optstr;
char *vend;
NOT_USED(extra);
if(argv[0][1]=='p')
{

View file

@ -149,7 +149,7 @@ static int outexceptf __PARAM__((Sfio_t* iop, int mode, Sfdisc_t* dp), (iop, mod
/* This mess is because /bin/echo on BSD is different */
if(!sh.universe)
{
register char *universe;
char *universe;
if(universe=astconf("_AST_UNIVERSE",0,0))
bsd_univ = (strcmp(universe,"ucb")==0);
sh.universe = 1;
@ -177,8 +177,8 @@ int b_printf __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, ext
*/
int b_print __PARAM__((int argc, char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[]; __V_ *extra;){
register Sfio_t *outfile;
register int n, fd = 1;
Sfio_t *outfile;
int n, fd = 1;
const char *msg = e_file+4;
char *format = 0;
int sflag = 0, nflag, rflag;
@ -344,8 +344,8 @@ skip2:
*/
int sh_echolist __PARAM__((Sfio_t *outfile, int raw, char *argv[]), (outfile, raw, argv)) __OTORP__(Sfio_t *outfile; int raw; char *argv[];){
register char *cp;
register int n;
char *cp;
int n;
while(!cescape && (cp= *argv++))
{
if(!raw && (n=fmtvecho(cp))>=0)
@ -364,7 +364,7 @@ int sh_echolist __PARAM__((Sfio_t *outfile, int raw, char *argv[]), (outfile, ra
static char *genformat __PARAM__((char *format), (format)) __OTORP__(char *format;){
register char *fp;
char *fp;
stakseek(0);
stakputs(preformat);
stakputs(format);
@ -374,9 +374,9 @@ static char *genformat __PARAM__((char *format), (format)) __OTORP__(char *forma
}
static int getarg __PARAM__((int format,union types_t *value), (format, value)) __OTORP__(int format;union types_t *value;){
register char *argp = *nextarg;
char *argp = *nextarg;
char *lastchar = "";
register int neg = 0;
int neg = 0;
if(!argp)
{
switch(format)
@ -488,7 +488,7 @@ static int getarg __PARAM__((int format,union types_t *value), (format, value))
* This routine adds new % escape sequences to printf
*/
static int extend __PARAM__((char *invalue,int format,int precis,char **outval), (invalue, format, precis, outval)) __OTORP__(char *invalue;int format;int precis;char **outval;){
register int n;
int n;
NOT_USED(precis);
switch(format)
{
@ -528,9 +528,9 @@ static int extend __PARAM__((char *invalue,int format,int precis,char **outval),
static int fmtvecho __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
static char *nullarg;
register const char *cp = string, *cpmax;
register int c;
register int offset = staktell();
const char *cp = string, *cpmax;
int c;
int offset = staktell();
int chlen;
if (MB_CUR_MAX > 1)
{

View file

@ -111,8 +111,8 @@
#define D_FLAG 6 /* must be number of bits for all flags */
int b_read __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register char *name;
register int r, flags=0, fd=0;
char *name;
int r, flags=0, fd=0;
long timeout = 1000*sh.tmout;
int save_prompt;
NOT_USED(argc);
@ -203,11 +203,11 @@ static void timedout __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;
*/
int sh_readline __PARAM__((char **names, int fd, int flags,long timeout), (names, fd, flags, timeout)) __OTORP__(char **names; int fd; int flags;long timeout;){
register int c;
register unsigned char *cp;
register Namval_t *np;
register char *name, *val;
register Sfio_t *iop;
int c;
unsigned char *cp;
Namval_t *np;
char *name, *val;
Sfio_t *iop;
char *ifs;
unsigned char *cpmax;
char was_escape = 0;
@ -437,8 +437,8 @@ int sh_readline __PARAM__((char **names, int fd, int flags,long timeout), (names
if(!name && *val)
{
/* strip off trailing delimiters */
register char *cp = val + strlen(val);
register int n;
char *cp = val + strlen(val);
int n;
while((n=sh.ifstable[*--cp])==S_DELIM || n==S_SPACE);
cp[1] = 0;
}

View file

@ -105,9 +105,9 @@
# undef _lib_poll
#endif /* _lib_poll_notimer */
int b_sleep __PARAM__((register int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(register int argc;char *argv[];__V_ *extra;){
register char *cp;
register double d;
int b_sleep __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
char *cp;
double d;
time_t tloc = 0;
NOT_USED(extra);
while((argc = optget(argv,sh_optsleep))) switch(argc)
@ -181,7 +181,7 @@ unsigned sleep __PARAM__((unsigned sec), (sec)) __OTORP__(unsigned sec;){
*/
void sh_delay __PARAM__((double t), (t)) __OTORP__(double t;){
register int n = (int)t;
int n = (int)t;
#ifdef _lib_poll
struct pollfd fd;
if(t<=0)

View file

@ -131,8 +131,8 @@ static int ap, ac;
static char **av;
int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register char *cp = argv[0];
register int not;
char *cp = argv[0];
int not;
NOT_USED(extra);
av = argv;
ap = 1;
@ -156,7 +156,7 @@ int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra))
/* fall through */
case 4:
{
register int op = sh_lookup(cp=argv[2],shtab_testops);
int op = sh_lookup(cp=argv[2],shtab_testops);
if(op&TEST_BINOP)
break;
if(!op)
@ -190,9 +190,9 @@ int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra))
* flag is 1 when in parenthesis
* flag is 2 when evaluating -a
*/
static int expr __PARAM__((int register flag), (flag)) __OTORP__(int register flag;){
register int r;
register char *p;
static int expr __PARAM__((int flag), (flag)) __OTORP__(int flag;){
int r;
char *p;
r = e3();
while(ap < ac)
{
@ -243,8 +243,8 @@ static char *nxtarg __PARAM__((int mt), (mt)) __OTORP__(int mt;){
static e3 __PARAM__((void), ()){
register char *arg, *cp;
register int op;
char *arg, *cp;
int op;
char *binop;
arg=nxtarg(0);
if(c_eq(arg, '!'))
@ -298,7 +298,7 @@ skip:
return(test_binop(op,arg,cp));
}
int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) __OTORP__(register int op;register const char *arg;){
int test_unop __PARAM__((int op,const char *arg), (op, arg)) __OTORP__(int op;const char *arg;){
switch(op)
{
case 'r':
@ -310,7 +310,7 @@ int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) _
case 'V':
#ifdef SHOPT_FS_3D
{
register int offset = staktell();
int offset = staktell();
if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode))
return(0);
/* add trailing / */
@ -360,7 +360,7 @@ int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) _
case 'H':
#ifdef S_ISCDF
{
register int offset = staktell();
int offset = staktell();
if(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode))
return(1);
stakputs(arg);
@ -419,8 +419,8 @@ int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) _
}
}
test_binop __PARAM__((register int op,const char *left,const char *right), (op, left, right)) __OTORP__(register int op;const char *left;const char *right;){
register double lnum,rnum;
test_binop __PARAM__((int op,const char *left,const char *right), (op, left, right)) __OTORP__(int op;const char *left;const char *right;){
double lnum,rnum;
if(op&TEST_ARITH)
{
lnum = sh_arith(left);
@ -498,7 +498,7 @@ test_inode __PARAM__((const char *file1,const char *file2), (file1, file2)) __OT
* The static buffer statb is shared with test_mode.
*/
sh_access __PARAM__((register const char *name, register int mode), (name, mode)) __OTORP__(register const char *name; register int mode;){
sh_access __PARAM__((const char *name, int mode), (name, mode)) __OTORP__(const char *name; int mode;){
if(*name==0)
return(-1);
if(strmatch(name,(char*)e_devfdNN))
@ -550,7 +550,7 @@ skip:
{
static int maxgroups = 0;
gid_t *groups;
register int n;
int n;
if(maxgroups==0)
{
/* first time */
@ -584,7 +584,7 @@ skip:
* The mode bits are zero if the file doesn't exist.
*/
static int test_mode __PARAM__((register const char *file), (file)) __OTORP__(register const char *file;){
static int test_mode __PARAM__((const char *file), (file)) __OTORP__(const char *file;){
if(file && (*file==0 || test_stat(file,&statb)<0))
return(0);
return(statb.st_mode);

View file

@ -106,8 +106,8 @@ static int sig_number __PROTO__((const char*));
static void sig_list __PROTO__((int));
int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *arg = argv[1];
register int sig, pflag = 0;
char *arg = argv[1];
int sig, pflag = 0;
NOT_USED(argc);
NOT_USED(extra);
while (sig = optget(argv, sh_opttrap)) switch (sig)
@ -127,7 +127,7 @@ int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) _
error(ERROR_usage(2),optusage((char*)0));
if(arg = *argv)
{
register int clear;
int clear;
char *action = arg;
if(!pflag)
{
@ -210,8 +210,8 @@ int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) _
}
int b_kill __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *signame;
register int sig=SIGTERM, flag=0, n;
char *signame;
int sig=SIGTERM, flag=0, n;
NOT_USED(argc);
NOT_USED(extra);
while((n = optget(argv,sh_optkill))) switch(n)
@ -281,7 +281,7 @@ endopts:
*/
static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register int n;
int n;
char *last;
if(isdigit(*string))
{
@ -291,7 +291,7 @@ static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const
}
else
{
register int c;
int c;
n = staktell();
do
{
@ -316,9 +316,9 @@ static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const
* if <flag> is zero, then print all signal names
* if <flag> is negative, then print all traps
*/
static void sig_list __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){
register const struct shtable2 *tp;
register int sig = sh.sigmax+1;
static void sig_list __PARAM__((int flag), (flag)) __OTORP__(int flag;){
const struct shtable2 *tp;
int sig = sh.sigmax+1;
const char *names[SH_TRAP];
const char *traps[SH_DEBUGTRAP+1];
@ -353,7 +353,7 @@ static void sig_list __PARAM__((register int flag), (flag)) __OTORP__(register i
else if(flag<0)
{
/* print the traps */
register char *trap,*sname,**trapcom;
char *trap,*sname,**trapcom;
sig = sh.st.trapmax;
/* use parent traps if otrapcom is set (for $(trap) */
trapcom = (sh.st.otrapcom?sh.st.otrapcom:sh.st.trapcom);

View file

@ -145,7 +145,7 @@ static const Namdisc_t treedisc =
*/
int b_read_export __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int flag;
int flag;
char *command = argv[0];
NOT_USED(argc);
NOT_USED(extra);
@ -178,10 +178,10 @@ int b_read_export __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv,
}
int b_alias __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){
register unsigned flag = NV_ARRAY|NV_NOSCOPE|NV_ASSIGN;
register Hashtab_t *troot = sh.alias_tree;
register int n;
int b_alias __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
unsigned flag = NV_ARRAY|NV_NOSCOPE|NV_ASSIGN;
Hashtab_t *troot = sh.alias_tree;
int n;
NOT_USED(argc);
NOT_USED(extra);
prefix=0;
@ -230,9 +230,9 @@ int b_alias __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, ar
}
int b_typeset __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){
register int flag = NV_VARNAME|NV_ASSIGN;
register int n;
int b_typeset __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
int flag = NV_VARNAME|NV_ASSIGN;
int n;
Hashtab_t *troot = sh.var_tree;
int isfloat = 0;
NOT_USED(argc);
@ -347,8 +347,8 @@ int b_typeset __PARAM__((int argc,register char *argv[],__V_ *extra), (argc,
return(b_common(argv,flag,troot));
}
static int b_common __PARAM__((char **argv,register int flag,Hashtab_t *troot), (argv, flag, troot)) __OTORP__(char **argv;register int flag;Hashtab_t *troot;){
register char *name;
static int b_common __PARAM__((char **argv,int flag,Hashtab_t *troot), (argv, flag, troot)) __OTORP__(char **argv;int flag;Hashtab_t *troot;){
char *name;
int nvflags=(flag&(NV_ARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_ASSIGN));
int r=0, ref=0;
#ifdef SHOPT_OO
@ -376,8 +376,8 @@ static int b_common __PARAM__((char **argv,register int flag,Hashtab_t *troo
}
while(name = *++argv)
{
register unsigned newflag;
register Namval_t *np;
unsigned newflag;
Namval_t *np;
unsigned curflag;
if(troot == sh.fun_tree)
{
@ -537,9 +537,9 @@ __V_ **sh_getliblist __PARAM__((void), ()){
* adding builtins requires dlopen() interface
*/
int b_builtin __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *arg=0, *name;
register int n, r=0, flag=0;
register Namval_t *np;
char *arg=0, *name;
int n, r=0, flag=0;
Namval_t *np;
int dlete=0;
static int maxlib, nlib;
Fptr_t addr;
@ -659,7 +659,7 @@ int b_builtin __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)
return(r);
}
int b_set __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){
int b_set __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(extra);
prefix=0;
if(argv[1])
@ -682,21 +682,21 @@ int b_set __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv
* Non-existent items being deleted give non-zero exit status
*/
int b_unalias __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){
int b_unalias __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(extra);
return(b_unall(argc,argv,sh.alias_tree));
}
int b_unset __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){
int b_unset __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(extra);
return(b_unall(argc,argv,sh.var_tree));
}
static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot), (argc, argv, troot)) __OTORP__(int argc; char **argv; register Hashtab_t *troot;){
register Namval_t *np;
register struct slnod *slp;
register const char *name;
register int r;
static int b_unall __PARAM__((int argc, char **argv, Hashtab_t *troot), (argc, argv, troot)) __OTORP__(int argc; char **argv; Hashtab_t *troot;){
Namval_t *np;
struct slnod *slp;
const char *name;
int r;
int nflag = 0;
int all=0;
NOT_USED(argc);
@ -751,7 +751,7 @@ static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot),
else if(slp=(struct slnod*)(np->nvenv))
{
/* free function definition */
register char *cp= strrchr(name,'.');
char *cp= strrchr(name,'.');
if(cp)
{
Namval_t *npv;
@ -785,8 +785,8 @@ static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot),
* print out the name and value of a name-value pair <np>
*/
static int print_namval __PARAM__((Sfio_t *file,register Namval_t *np,register int flag), (file, np, flag)) __OTORP__(Sfio_t *file;register Namval_t *np;register int flag;){
register char *cp;
static int print_namval __PARAM__((Sfio_t *file,Namval_t *np,int flag), (file, np, flag)) __OTORP__(Sfio_t *file;Namval_t *np;int flag;){
char *cp;
sh_sigcheck();
if(flag)
flag = '\n';
@ -816,7 +816,7 @@ static int print_namval __PARAM__((Sfio_t *file,register Namval_t *np,register i
}
if(cp=nv_getval(np))
{
register Namarr_t *ap;
Namarr_t *ap;
sfputr(file,sh_fmtq(nv_name(np)),-1);
if(!flag)
{
@ -850,9 +850,9 @@ static void print_all __PARAM__((Sfio_t *file,Hashtab_t *root), (file, root)) __
* format initialization list given a list of assignments <argp>
*/
static void genvalue __PARAM__((struct argnod *argp, const char *prefix, int n, int indent), (argp, prefix, n, indent)) __OTORP__(struct argnod *argp; const char *prefix; int n; int indent;){
register struct argnod *ap;
register char *cp,*nextcp;
register int m,isarray;
struct argnod *ap;
char *cp,*nextcp;
int m,isarray;
Namval_t *np;
if(n==0)
m = strlen(prefix);
@ -947,13 +947,13 @@ static void genvalue __PARAM__((struct argnod *argp, const char *prefix, int n,
/*
* walk the virtual tree and print or delete name-value pairs
*/
static char *walk_tree __PARAM__((register Namval_t *np, int dlete), (np, dlete)) __OTORP__(register Namval_t *np; int dlete;){
static char *walk_tree __PARAM__((Namval_t *np, int dlete), (np, dlete)) __OTORP__(Namval_t *np; int dlete;){
static Sfio_t *out;
int n;
Fcin_t save;
int savtop = staktell();
char *savptr = stakfreeze(0);
register struct argnod *ap;
struct argnod *ap;
struct argnod *arglist=0;
char *name = nv_name(np);
stakseek(ARGVAL);
@ -985,7 +985,7 @@ static char *walk_tree __PARAM__((register Namval_t *np, int dlete), (np, dlete)
/*
* get discipline for compound initializations
*/
static char *get_tree __PARAM__((register Namval_t *np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t *np; Namfun_t *fp;){
static char *get_tree __PARAM__((Namval_t *np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t *np; Namfun_t *fp;){
NOT_USED(fp);
return(walk_tree(np,0));
}
@ -993,7 +993,7 @@ static char *get_tree __PARAM__((register Namval_t *np, Namfun_t *fp), (np, fp))
/*
* put discipline for compound initializations
*/
static void put_tree __PARAM__((register Namval_t *np, const char *val, int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t *np; const char *val; int flags;Namfun_t *fp;){
static void put_tree __PARAM__((Namval_t *np, const char *val, int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t *np; const char *val; int flags;Namfun_t *fp;){
walk_tree(np,1);
if(fp = nv_stack(np,NIL(Namfun_t*)))
{
@ -1008,8 +1008,8 @@ static void put_tree __PARAM__((register Namval_t *np, const char *val, int flag
/*
* Insert discipline to cause $x to print current tree
*/
void nv_setvtree __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register Namfun_t *nfp = newof(NIL(__V_*),Namfun_t,1,0);
void nv_setvtree __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
Namfun_t *nfp = newof(NIL(__V_*),Namfun_t,1,0);
nfp->disc = &treedisc;
nv_stack(np, nfp);
}
@ -1017,11 +1017,11 @@ void nv_setvtree __PARAM__((register Namval_t *np), (np)) __OTORP__(register Nam
/*
* print the attributes of name value pair give by <np>
*/
static void print_attribute __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register const Shtable_t *tp;
register char *cp;
register unsigned val;
register unsigned mask;
static void print_attribute __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
const Shtable_t *tp;
char *cp;
unsigned val;
unsigned mask;
#ifdef SHOPT_OO
Namval_t *nq;
char *cclass=0;
@ -1099,9 +1099,9 @@ static void print_attribute __PARAM__((register Namval_t *np), (np)) __OTORP__(r
*/
static void print_scan __PARAM__((Sfio_t *file, int flag, Hashtab_t *root, int option), (file, flag, root, option)) __OTORP__(Sfio_t *file; int flag; Hashtab_t *root; int option;){
register char **argv;
register Namval_t *np;
register int namec;
char **argv;
Namval_t *np;
int namec;
Namval_t *onp = 0;
flag &= ~NV_ASSIGN;
scanmask = flag;
@ -1148,7 +1148,7 @@ static void pushname __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
/*
* The inverse of creating a reference node
*/
static void unref __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
static void unref __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
if(!nv_isattr(np,NV_REF))
return;
nv_offattr(np,NV_NOFREE|NV_REF);

View file

@ -113,8 +113,8 @@
#define SOFT 2
int b_ulimit __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *limit;
register int flag = 0, mode=0, n;
char *limit;
int flag = 0, mode=0, n;
#ifdef _lib_getrlimit
struct rlimit rlp;
#endif /* _lib_getrlimit */

View file

@ -101,8 +101,8 @@
#include "builtins.h"
int b_umask __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *mask;
register int flag = 0, sflag = 0;
char *mask;
int flag = 0, sflag = 0;
NOT_USED(extra);
while((argc = optget(argv,sh_optumask))) switch(argc)
{
@ -121,7 +121,7 @@ int b_umask __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra))
argv += opt_index;
if(mask = *argv)
{
register int c;
int c;
if(isdigit(*mask))
{
while(c = *mask++)

View file

@ -113,8 +113,8 @@ static int whence __PROTO__((char**, int));
* In this case return 0 when -v or -V or unknown option, otherwise
* the shift count to the command is returned
*/
int b_command __PARAM__((register int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(register int argc;char *argv[];__V_ *extra;){
register int n, flags=0;
int b_command __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
int n, flags=0;
NOT_USED(extra);
opt_index = opt_char = 0;
while((n = optget(argv,sh_optcommand))) switch(n)
@ -151,7 +151,7 @@ int b_command __PARAM__((register int argc,char *argv[],__V_ *extra), (argc, arg
* for the whence command
*/
int b_whence __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int flags=0, n;
int flags=0, n;
NOT_USED(argc);
NOT_USED(extra);
if(*argv[0]=='t')
@ -183,12 +183,12 @@ int b_whence __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra))
return(whence(argv, flags));
}
static int whence __PARAM__((char **argv, register int flags), (argv, flags)) __OTORP__(char **argv; register int flags;){
register const char *name;
register Namval_t *np;
register const char *cp;
register aflag,r=0;
register const char *msg;
static int whence __PARAM__((char **argv, int flags), (argv, flags)) __OTORP__(char **argv; int flags;){
const char *name;
Namval_t *np;
const char *cp;
int aflag,r=0;
const char *msg;
int notrack = 1;
while(name= *argv++)
{

View file

@ -107,7 +107,7 @@ static char macro[] = "_??";
* if <str> is equal to <newstr> returns <str>+strlen(<str>)+1
* otherwise returns <str>+strlen(<str>)
*/
static char *overlay __PARAM__((register char *str,register const char *newstr), (str, newstr)) __OTORP__(register char *str;register const char *newstr;){
static char *overlay __PARAM__((char *str,const char *newstr), (str, newstr)) __OTORP__(char *str;const char *newstr;){
while(*str && *str == *newstr++)
str++;
if(*str)
@ -132,7 +132,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
char *staksav = stakptr(0);
struct comnod *comptr = (struct comnod*)stakalloc(sizeof(struct comnod));
struct argnod *ap = (struct argnod*)stakseek(ARGVAL);
register char *out;
char *out;
char *begin;
int addstar;
int rval = 0;
@ -140,8 +140,8 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
int nomarkdirs = !sh_isoption(SH_MARKDIRS);
#ifdef SHOPT_MULTIBYTE
{
register int c = *cur;
register genchar *cp;
int c = *cur;
genchar *cp;
/* adjust cur */
cp = (genchar *)outbuff + *cur;
c = *cp;
@ -157,7 +157,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
ap->argflag = (ARG_MAC|ARG_EXP);
ap->argnxt.ap = 0;
{
register int c;
int c;
if(out>outbuff)
{
/* go to beginning of word */
@ -201,10 +201,10 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
if(mode!='*')
sh_onoption(SH_MARKDIRS);
{
register char **com;
char **com;
char *cp=begin;
int narg,cmd_completion=0;
register int size;
int size;
while(cp>outbuff && ((size=cp[-1])==' ' || size=='\t'))
cp--;
if((cp==outbuff || strchr(";&|(",size)) && *begin!='~' && !strchr(ap->argval,'/'))
@ -230,7 +230,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
{
if (strip && !cmd_completion)
{
register char **ptrcom;
char **ptrcom;
for(ptrcom=com;*ptrcom;ptrcom++)
/* trim directory prefix */
*ptrcom = path_basename(*ptrcom);
@ -317,7 +317,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
sh_offoption(SH_MARKDIRS);
#ifdef SHOPT_MULTIBYTE
{
register int c;
int c;
/* first re-adjust cur */
out = outbuff + *cur;
c = *out;
@ -335,8 +335,8 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
* look for edit macro named _i
* if found, puts the macro definition into lookahead buffer and returns 1
*/
ed_macro __PARAM__((register int i), (i)) __OTORP__(register int i;){
register char *out;
ed_macro __PARAM__((int i), (i)) __OTORP__(int i;){
char *out;
Namval_t *np;
genchar buff[LOOKAHEAD+1];
if(i != '@')
@ -369,7 +369,7 @@ ed_macro __PARAM__((register int i), (i)) __OTORP__(register int i;){
* Enter the fc command on the current history line
*/
ed_fulledit __PARAM__((void), ()){
register char *cp;
char *cp;
if(!sh.hist_ptr)
return(-1);
/* use EDITOR on current command */

View file

@ -190,7 +190,7 @@ int tty_check __PARAM__((int fd), (fd)) __OTORP__(int fd;){
* is called again without an intervening tty_set()
*/
int tty_get __PARAM__((register int fd, register struct termios *tty), (fd, tty)) __OTORP__(register int fd; register struct termios *tty;){
int tty_get __PARAM__((int fd, struct termios *tty), (fd, tty)) __OTORP__(int fd; struct termios *tty;){
if(fd == savefd)
*tty = savetty;
else
@ -243,7 +243,7 @@ int tty_set __PARAM__((int fd, int action, struct termios *tty), (fd, action, tt
*
}*/
void tty_cooked __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
void tty_cooked __PARAM__((int fd), (fd)) __OTORP__(int fd;){
if(editb.e_raw==0)
return;
@ -274,7 +274,7 @@ void tty_cooked __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
*
}*/
tty_raw __PARAM__((register int fd, int echo), (fd, echo)) __OTORP__(register int fd; int echo;){
tty_raw __PARAM__((int fd, int echo), (fd, echo)) __OTORP__(int fd; int echo;){
#ifdef L_MASK
struct ltchars lchars;
#endif /* L_MASK */
@ -385,7 +385,7 @@ tty_raw __PARAM__((register int fd, int echo), (fd, echo)) __OTORP__(register in
*/
# ifdef TIOCGETC
tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
tty_alt __PARAM__((int fd), (fd)) __OTORP__(int fd;){
int mask;
struct tchars ttychars;
switch(editb.e_raw)
@ -431,7 +431,7 @@ tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
# define IEXTEN 0
# endif /* IEXTEN */
tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
tty_alt __PARAM__((int fd), (fd)) __OTORP__(int fd;){
switch(editb.e_raw)
{
case ECHOMODE:
@ -498,7 +498,7 @@ tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
*/
int ed_window __PARAM__((void), ()){
int rows,cols;
register char *cp = nv_getval(COLUMNS);
char *cp = nv_getval(COLUMNS);
if(cp)
cols = atoi(cp)-1;
else
@ -521,8 +521,8 @@ int ed_window __PARAM__((void), ()){
*/
void ed_flush __PARAM__((void), ()){
register int n = editb.e_outptr-editb.e_outbase;
register int fd = ERRIO;
int n = editb.e_outptr-editb.e_outbase;
int fd = ERRIO;
if(n<=0)
return;
write(fd,editb.e_outbase,(unsigned)n);
@ -568,11 +568,11 @@ void ed_crlf __PARAM__((void), ()){
*/
void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
register char *pp;
register char *last;
char *pp;
char *last;
char *ppmax;
int myquote = 0;
register int qlen = 1;
int qlen = 1;
char inquote = 0;
editb.e_fd = fd;
#ifdef KSHELL
@ -584,7 +584,7 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
#endif /* KSHELL */
if(sh.hist_ptr)
{
register History_t *hp = sh.hist_ptr;
History_t *hp = sh.hist_ptr;
editb.e_hismax = hist_max(hp);
editb.e_hismin = hist_min(hp);
}
@ -599,7 +599,7 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
ppmax = pp+PRSIZE-1;
*pp++ = '\r';
{
register int c;
int c;
while(c= *last++) switch(c)
{
case '\r':
@ -648,7 +648,7 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
*pp = 0;
if((editb.e_wsize -= editb.e_plen) < 7)
{
register int shift = 7-editb.e_wsize;
int shift = 7-editb.e_wsize;
editb.e_wsize = 7;
pp = editb.e_prompt+1;
strcpy(pp,pp+shift);
@ -675,8 +675,8 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
* sfpkrd() correctly (i,e., those that support poll() or select()
*/
int ed_read __PARAM__((int fd, char *buff, int size), (fd, buff, size)) __OTORP__(int fd; char *buff; int size;){
register int rv= -1;
register int delim = (editb.e_raw==RAWMODE?'\r':'\n');
int rv= -1;
int delim = (editb.e_raw==RAWMODE?'\r':'\n');
sh_onstate(SH_TTYWAIT);
errno = EINTR;
while(rv<0 && errno==EINTR)
@ -740,10 +740,10 @@ done:
* onto the stack so that it can be checked for KEYTRAP
* putstack() returns 1 except when in the middle of a multi-byte char
*/
static int putstack __PARAM__((char string[], register int nbyte, int type), (string, nbyte, type)) __OTORP__(char string[]; register int nbyte; int type;){
register int c;
static int putstack __PARAM__((char string[], int nbyte, int type), (string, nbyte, type)) __OTORP__(char string[]; int nbyte; int type;){
int c;
#ifdef SHOPT_MULTIBYTE
register int max,last;
int max,last;
static int curchar, cursize=0;
last = max = nbyte;
nbyte = 0;
@ -829,7 +829,7 @@ static int putstack __PARAM__((char string[], register int nbyte, int type), (st
* 2 Next key is literal
*/
int ed_getchar __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register int n, c;
int n, c;
char readin[LOOKAHEAD+1];
if(!lookahead)
{
@ -887,7 +887,7 @@ int ed_getchar __PARAM__((int mode), (mode)) __OTORP__(int mode;){
return(c);
}
void ed_ungetchar __PARAM__((register int c), (c)) __OTORP__(register int c;){
void ed_ungetchar __PARAM__((int c), (c)) __OTORP__(int c;){
if (lookahead < LOOKAHEAD)
previous[lookahead++] = c;
return;
@ -897,10 +897,10 @@ void ed_ungetchar __PARAM__((register int c), (c)) __OTORP__(register int c;){
* put a character into the output buffer
*/
void ed_putchar __PARAM__((register int c), (c)) __OTORP__(register int c;){
register char *dp = editb.e_outptr;
void ed_putchar __PARAM__((int c), (c)) __OTORP__(int c;){
char *dp = editb.e_outptr;
#ifdef SHOPT_MULTIBYTE
register int d;
int d;
/* check for place holder */
if(c == MARKER)
return;
@ -934,9 +934,9 @@ void ed_putchar __PARAM__((register int c), (c)) __OTORP__(register int c;){
*/
ed_virt_to_phys __PARAM__((genchar *virt,genchar *phys,int cur,int voff,int poff), (virt, phys, cur, voff, poff)) __OTORP__(genchar *virt;genchar *phys;int cur;int voff;int poff;){
register genchar *sp = virt;
register genchar *dp = phys;
register int c;
genchar *sp = virt;
genchar *dp = phys;
int c;
genchar *curp = sp + cur;
genchar *dpmax = phys+MAXLINE;
int r;
@ -1001,11 +1001,11 @@ ed_virt_to_phys __PARAM__((genchar *virt,genchar *phys,int cur,int voff,int poff
*/
int ed_internal __PARAM__((const char *src, genchar *dest), (src, dest)) __OTORP__(const char *src; genchar *dest;){
register const unsigned char *cp = (unsigned char *)src;
register int c;
register genchar *dp = dest;
register int d;
register int size;
const unsigned char *cp = (unsigned char *)src;
int c;
genchar *dp = dest;
int d;
int size;
if((unsigned char*)dest == cp)
{
genchar buffer[MAXLINE];
@ -1042,9 +1042,9 @@ int ed_internal __PARAM__((const char *src, genchar *dest), (src, dest)) __OTORP
*/
int ed_external __PARAM__((const genchar *src, char *dest), (src, dest)) __OTORP__(const genchar *src; char *dest;){
register int c;
register char *dp = dest;
register int d;
int c;
char *dp = dest;
int d;
char *dpmax = dp+sizeof(genchar)*MAXLINE-2;
if((char*)src == dp)
{
@ -1084,7 +1084,7 @@ void ed_gencpy __PARAM__((genchar *dp,const genchar *sp), (dp, sp)) __OTORP__(ge
* copy at most <n> items from <sp> to <dp>
*/
void ed_genncpy __PARAM__((register genchar *dp,register const genchar *sp, int n), (dp, sp, n)) __OTORP__(register genchar *dp;register const genchar *sp; int n;){
void ed_genncpy __PARAM__((genchar *dp,const genchar *sp, int n), (dp, sp, n)) __OTORP__(genchar *dp;const genchar *sp; int n;){
while(n-->0 && (*dp++ = *sp++));
}
@ -1092,8 +1092,8 @@ void ed_genncpy __PARAM__((register genchar *dp,register const genchar *sp, int
* find the string length of <str>
*/
int ed_genlen __PARAM__((register const genchar *str), (str)) __OTORP__(register const genchar *str;){
register const genchar *sp = str;
int ed_genlen __PARAM__((const genchar *str), (str)) __OTORP__(const genchar *str;){
const genchar *sp = str;
while(*sp++);
return(sp-str-1);
}
@ -1108,10 +1108,10 @@ int ed_genlen __PARAM__((register const genchar *str), (str)) __OTORP__(register
*/
ed_setwidth __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register int indx = 0;
register int state = 0;
register int c;
register int n = 0;
int indx = 0;
int state = 0;
int c;
int n = 0;
static char widths[6] = {1,1};
while(1) switch(c = *string++)
{
@ -1160,7 +1160,7 @@ ed_setwidth __PARAM__((const char *string), (string)) __OTORP__(const char *stri
/*
* returns 1 when <n> bytes starting at <a> and <b> are equal
*/
static int compare __PARAM__((register const char *a,register const char *b,register int n), (a, b, n)) __OTORP__(register const char *a;register const char *b;register int n;){
static int compare __PARAM__((const char *a,const char *b,int n), (a, b, n)) __OTORP__(const char *a;const char *b;int n;){
while(n-->0)
{
if(*a++ != *b++)
@ -1188,8 +1188,8 @@ static struct termio ott;
tcgetattr __PARAM__((int fd, struct termios *tt), (fd, tt)) __OTORP__(int fd; struct termios *tt;){
register int r;
register int i;
int r;
int i;
tcgeta = 0;
echoctl = (ECHOCTL!=0);
if((r=ioctl(fd,TCGETS,tt))>=0 || errno!=EINVAL)
@ -1209,10 +1209,10 @@ tcgetattr __PARAM__((int fd, struct termios *tt), (fd, tt)) __OTORP__(int fd; st
}
tcsetattr __PARAM__((int fd,int mode,struct termios *tt), (fd, mode, tt)) __OTORP__(int fd;int mode;struct termios *tt;){
register int r;
int r;
if(tcgeta)
{
register int i;
int i;
ott.c_lflag = tt->c_lflag;
ott.c_oflag = tt->c_oflag;
ott.c_iflag = tt->c_iflag;
@ -1250,10 +1250,10 @@ tcsetattr __PARAM__((int fd,int mode,struct termios *tt), (fd, mode, tt)) __OTOR
* Execute keyboard trap on given buffer <inbuff> of given size <isize>
* <mode> < 0 for vi insert mode
*/
static int keytrap __PARAM__((char *inbuff,register int insize, int bufsize, int mode), (inbuff, insize, bufsize, mode)) __OTORP__(char *inbuff;register int insize; int bufsize; int mode;){
static int keytrap __PARAM__((char *inbuff,int insize, int bufsize, int mode), (inbuff, insize, bufsize, mode)) __OTORP__(char *inbuff;int insize; int bufsize; int mode;){
static char vi_insert[2];
static long col;
register char *cp;
char *cp;
inbuff[insize] = 0;
col = editb.e_cur;
if(mode== -2)

View file

@ -190,10 +190,10 @@ static int cr_ok;
static Histloc_t location = { -5, 0 };
ed_emacsread __PARAM__((int fd,char *buff,int scend), (fd, buff, scend)) __OTORP__(int fd;char *buff;int scend;){
register int c;
register int i;
register genchar *out;
register int count;
int c;
int i;
genchar *out;
int count;
int adjust,oadjust;
char backslash;
genchar *kptr;
@ -667,8 +667,8 @@ process:
}
static void show_info __PARAM__((const char *str), (str)) __OTORP__(const char *str;){
register genchar *out = drawbuff;
register int c;
genchar *out = drawbuff;
int c;
genchar string[LBUF];
int sav_cur = cur;
/* save current line */
@ -690,15 +690,15 @@ static void show_info __PARAM__((const char *str), (str)) __OTORP__(const char *
draw(UPDATE);
}
static void putstring __PARAM__((register char *sp), (sp)) __OTORP__(register char *sp;){
register int c;
static void putstring __PARAM__((char *sp), (sp)) __OTORP__(char *sp;){
int c;
while (c= *sp++)
putchar(c);
}
static int escape __PARAM__((register genchar *out,int count), (out, count)) __OTORP__(register genchar *out;int count;){
register int i,value;
static int escape __PARAM__((genchar *out,int count), (out, count)) __OTORP__(genchar *out;int count;){
int i,value;
int digit,ch;
digit = 0;
value = 0;
@ -965,7 +965,7 @@ static int escape __PARAM__((register genchar *out,int count), (out, count)) __O
*/
static void xcommands __PARAM__((int count), (count)) __OTORP__(int count;){
register int i = ed_getchar(0);
int i = ed_getchar(0);
NOT_USED(count);
switch(i)
{
@ -1052,9 +1052,9 @@ static void search __PARAM__((genchar *out,int direction), (out, direction)) __O
#ifndef ESH_NFIRST
Histloc_t location;
#endif
register int i,sl;
int i,sl;
genchar str_buff[LBUF];
register genchar *string = drawbuff;
genchar *string = drawbuff;
/* save current line */
char sav_cur = cur;
genncpy(str_buff,string,sizeof(str_buff)/CHARSIZE-1);
@ -1161,18 +1161,18 @@ static void draw __PARAM__((Draw_t option), (option)) __OTORP__(Draw_t option;){
#define UPPER '>'
static char overflow; /* Screen overflow flag set */
register genchar *sptr; /* Pointer within screen */
genchar *sptr; /* Pointer within screen */
static int offset; /* Screen offset */
static char scvalid; /* Screen is up to date */
genchar nscreen[2*MAXLINE]; /* New entire screen */
genchar *ncursor; /* New cursor */
register genchar *nptr; /* Pointer to New screen */
genchar *nptr; /* Pointer to New screen */
char longline; /* Line overflow */
genchar *logcursor;
genchar *nscend; /* end of logical screen */
register int i;
int i;
nptr = nscreen;
sptr = drawbuff;
@ -1330,8 +1330,8 @@ static void draw __PARAM__((Draw_t option), (option)) __OTORP__(Draw_t option;){
* cursor is set to reflect the change
*/
static void setcursor __PARAM__((register int newp,int c), (newp, c)) __OTORP__(register int newp;int c;){
register int oldp = cursor - screen;
static void setcursor __PARAM__((int newp,int c), (newp, c)) __OTORP__(int newp;int c;){
int oldp = cursor - screen;
if (oldp > newp)
{
if (!cr_ok || (2*(newp+plen)>(oldp+plen)))
@ -1359,12 +1359,12 @@ skip:
}
#ifdef SHOPT_MULTIBYTE
static int print __PARAM__((register int c), (c)) __OTORP__(register int c;){
static int print __PARAM__((int c), (c)) __OTORP__(int c;){
return((c&~STRIP)==0 && isprint(c));
}
static int isword __PARAM__((register int i), (i)) __OTORP__(register int i;){
register int c = drawbuff[i];
static int isword __PARAM__((int i), (i)) __OTORP__(int i;){
int c = drawbuff[i];
return((c&~STRIP) || isalnum(c));
}
#endif /* SHOPT_MULTIBYTE */

View file

@ -171,7 +171,7 @@ static History_t *hist_ptr;
# include <pwd.h>
int acctinit __PARAM__((void), ()){
register char *cp, *acctfile;
char *cp, *acctfile;
Namval_t *np = nv_search("ACCTFILE",sh.var_tree,0);
if(!np || !(acctfile=nv_getval(np)))
@ -229,13 +229,13 @@ static void hist_touch __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handl
* hist_open() returns 1, if history file is open
*/
int sh_histinit __PARAM__((void), ()){
register int fd;
register History_t *hp;
register char *histname;
int fd;
History_t *hp;
char *histname;
char *fname=0;
int histmask, maxlines, hist_start;
register char *cp;
register off_t hsize = 0;
char *cp;
off_t hsize = 0;
if(sh.hist_ptr=hist_ptr)
return(1);
@ -384,7 +384,7 @@ retry:
* close the history file and free the space
*/
void hist_close __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){
void hist_close __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
sfclose(hp->histfp);
free((char*)hp);
hist_ptr = 0;
@ -401,7 +401,7 @@ void hist_close __PARAM__((register History_t *hp), (hp)) __OTORP__(register His
/*
* check history file format to see if it begins with special byte
*/
static int hist_check __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
static int hist_check __PARAM__((int fd), (fd)) __OTORP__(int fd;){
unsigned char magic[2];
lseek(fd,(off_t)0,SEEK_SET);
if((read(fd,(char*)magic,2)!=2) || (magic[0]!=HIST_UNDO))
@ -422,9 +422,9 @@ static int hist_clean __PARAM__((int fd), (fd)) __OTORP__(int fd;){
*/
static void hist_trim __PARAM__((int n), (n)) __OTORP__(int n;){
register char *cp;
register int incmd=1, c=0;
register History_t *hist_new, *hist_old = hist_ptr;
char *cp;
int incmd=1, c=0;
History_t *hist_new, *hist_old = hist_ptr;
char *buff, *endbuff;
off_t oldp,newp;
struct stat statb;
@ -490,9 +490,9 @@ static void hist_trim __PARAM__((int n), (n)) __OTORP__(int n;){
/*
* position history file at size and find next command number
*/
static int hist_nearend __PARAM__((Sfio_t *iop, register off_t size), (iop, size)) __OTORP__(Sfio_t *iop; register off_t size;){
register unsigned char *cp, *endbuff;
register int n, incmd=1;
static int hist_nearend __PARAM__((Sfio_t *iop, off_t size), (iop, size)) __OTORP__(Sfio_t *iop; off_t size;){
unsigned char *cp, *endbuff;
int n, incmd=1;
unsigned char *buff, marker[4];
if(size <= 2L || sfseek(iop,size,SEEK_SET)<0)
goto begin;
@ -556,10 +556,10 @@ begin:
* the previous command.
*/
void hist_eof __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){
register char *cp,*first,*endbuff;
register int incmd = 0;
register off_t count = hp->histcnt;
void hist_eof __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
char *cp,*first,*endbuff;
int incmd = 0;
off_t count = hp->histcnt;
int n,skip=0;
char *buff;
sfseek(hp->histfp,count,SEEK_SET);
@ -652,8 +652,8 @@ void hist_eof __PARAM__((register History_t *hp), (hp)) __OTORP__(register Histo
* This routine will cause the previous command to be cancelled
*/
void hist_cancel __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){
register int c;
void hist_cancel __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
int c;
if(!hp)
return;
sfputc(hp->histfp,HIST_UNDO);
@ -668,8 +668,8 @@ void hist_cancel __PARAM__((register History_t *hp), (hp)) __OTORP__(register Hi
* flush the current history command
*/
void hist_flush __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){
register char *buff;
void hist_flush __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
char *buff;
if(hp)
{
if(buff=(char*)sfreserve(hp->histfp,0,1))
@ -695,11 +695,11 @@ void hist_flush __PARAM__((register History_t *hp), (hp)) __OTORP__(register His
* a zero byte. Line sequencing is added as required
*/
static int hist_write __PARAM__((Sfio_t *iop,const __V_ *buff,register int insize,Sfdisc_t* handle), (iop, buff, insize, handle)) __OTORP__(Sfio_t *iop;const __V_ *buff;register int insize;Sfdisc_t* handle;){
register char *bufptr = ((char*)buff)+insize;
register History_t *hp = hist_ptr;
register int c,size = insize;
register off_t cur;
static int hist_write __PARAM__((Sfio_t *iop,const __V_ *buff,int insize,Sfdisc_t* handle), (iop, buff, insize, handle)) __OTORP__(Sfio_t *iop;const __V_ *buff;int insize;Sfdisc_t* handle;){
char *bufptr = ((char*)buff)+insize;
History_t *hp = hist_ptr;
int c,size = insize;
off_t cur;
NOT_USED(handle);
if(!histflush)
return(write(sffileno(iop),(char*)buff,size));
@ -769,7 +769,7 @@ static int hist_write __PARAM__((Sfio_t *iop,const __V_ *buff,register int insiz
* The buffer must be large enough to hold HIST_MARKSZ chars
*/
static void hist_marker __PARAM__((register char *buff,register long cmdno), (buff, cmdno)) __OTORP__(register char *buff;register long cmdno;){
static void hist_marker __PARAM__((char *buff,long cmdno), (buff, cmdno)) __OTORP__(char *buff;long cmdno;){
*buff++ = HIST_CMDNO;
*buff++ = 0;
*buff++ = (cmdno>>16);
@ -781,14 +781,14 @@ static void hist_marker __PARAM__((register char *buff,register long cmdno), (bu
/*
* return byte offset in history file for command <n>
*/
off_t hist_tell __PARAM__((register History_t *hp, int n), (hp, n)) __OTORP__(register History_t *hp; int n;){
off_t hist_tell __PARAM__((History_t *hp, int n), (hp, n)) __OTORP__(History_t *hp; int n;){
return(hp->histcmds[hist_ind(hp,n)]);
}
/*
* seek to the position of command <n>
*/
off_t hist_seek __PARAM__((register History_t *hp, int n), (hp, n)) __OTORP__(register History_t *hp; int n;){
off_t hist_seek __PARAM__((History_t *hp, int n), (hp, n)) __OTORP__(History_t *hp; int n;){
return(sfseek(hp->histfp,hp->histcmds[hist_ind(hp,n)],SEEK_SET));
}
@ -798,9 +798,9 @@ off_t hist_seek __PARAM__((register History_t *hp, int n), (hp, n)) __OTORP__(re
* each new-line character is replaced with string <nl>.
*/
void hist_list __PARAM__((register History_t *hp,Sfio_t *outfile, off_t offset,int last, char *nl), (hp, outfile, offset, last, nl)) __OTORP__(register History_t *hp;Sfio_t *outfile; off_t offset;int last; char *nl;){
register int oldc=0;
register int c;
void hist_list __PARAM__((History_t *hp,Sfio_t *outfile, off_t offset,int last, char *nl), (hp, outfile, offset, last, nl)) __OTORP__(History_t *hp;Sfio_t *outfile; off_t offset;int last; char *nl;){
int oldc=0;
int c;
if(offset<0 || !hp)
{
sfputr(outfile,e_unknown,'\n');
@ -828,8 +828,8 @@ void hist_list __PARAM__((register History_t *hp,Sfio_t *outfile, off_t offset,i
* direction < 1 for backwards search
*/
Histloc_t hist_find __PARAM__((register History_t*hp,char *string,register int index1,int flag,int direction), (hp, string, index1, flag, direction)) __OTORP__(register History_t*hp;char *string;register int index1;int flag;int direction;){
register int index2;
Histloc_t hist_find __PARAM__((History_t*hp,char *string,int index1,int flag,int direction), (hp, string, index1, flag, direction)) __OTORP__(History_t*hp;char *string;int index1;int flag;int direction;){
int index2;
off_t offset;
int *coffset=0;
Histloc_t location;
@ -886,10 +886,10 @@ Histloc_t hist_find __PARAM__((register History_t*hp,char *string,register int i
* returns the line number of the match if successful, otherwise -1
*/
int hist_match __PARAM__((register History_t *hp,off_t offset,char *string,int *coffset), (hp, offset, string, coffset)) __OTORP__(register History_t *hp;off_t offset;char *string;int *coffset;){
register unsigned char *cp;
register int c;
register off_t count;
int hist_match __PARAM__((History_t *hp,off_t offset,char *string,int *coffset), (hp, offset, string, coffset)) __OTORP__(History_t *hp;off_t offset;char *string;int *coffset;){
unsigned char *cp;
int c;
off_t count;
int line = 0;
int chrs=0;
#ifdef SHOPT_MULTIBYTE
@ -960,10 +960,10 @@ int hist_match __PARAM__((register History_t *hp,off_t offset,char *string,int *
*/
int hist_copy __PARAM__((char *s1,int size,int command,int line), (s1, size, command, line)) __OTORP__(char *s1;int size;int command;int line;){
register int c;
register History_t *hp = hist_ptr;
register int count = 0;
register char *s1max = s1+size;
int c;
History_t *hp = hist_ptr;
int count = 0;
char *s1max = s1+size;
off_t offset;
if(!hp)
return(-1);
@ -1002,10 +1002,10 @@ int hist_copy __PARAM__((char *s1,int size,int command,int line), (s1, size, com
*/
char *hist_word __PARAM__((char *string,int size,int word), (string, size, word)) __OTORP__(char *string;int size;int word;){
register int c;
register char *s1 = string;
register unsigned char *cp = (unsigned char*)s1;
register int flag = 0;
int c;
char *s1 = string;
unsigned char *cp = (unsigned char*)s1;
int flag = 0;
if(!hist_ptr)
#ifdef KSHELL
{
@ -1047,7 +1047,7 @@ char *hist_word __PARAM__((char *string,int size,int word), (string, size, word)
* compute the new command and line number.
*/
Histloc_t hist_locate __PARAM__((History_t *hp,register int command,register int line,int lines), (hp, command, line, lines)) __OTORP__(History_t *hp;register int command;register int line;int lines;){
Histloc_t hist_locate __PARAM__((History_t *hp,int command,int line,int lines), (hp, command, line, lines)) __OTORP__(History_t *hp;int command;int line;int lines;){
Histloc_t next;
line += lines;
if(!hp)
@ -1057,7 +1057,7 @@ Histloc_t hist_locate __PARAM__((History_t *hp,register int command,register int
}
if(lines > 0)
{
register int count;
int count;
while(command <= hp->histind)
{
count = hist_copy(NIL(char*),0, command,-1);
@ -1069,7 +1069,7 @@ Histloc_t hist_locate __PARAM__((History_t *hp,register int command,register int
}
else
{
register int least = (int)hp->histind-hp->histsize;
int least = (int)hp->histind-hp->histsize;
while(1)
{
if(line >=0)
@ -1094,7 +1094,7 @@ done:
* Handle history file exceptions
*/
static int hist_exceptf __PARAM__((Sfio_t* fp, int type, Sfdisc_t *handle), (fp, type, handle)) __OTORP__(Sfio_t* fp; int type; Sfdisc_t *handle;){
register int newfd,oldfd;
int newfd,oldfd;
History_t *hp = (History_t*)handle;
if(type==SF_WRITE)
{
@ -1110,7 +1110,7 @@ static int hist_exceptf __PARAM__((Sfio_t* fp, int type, Sfdisc_t *handle), (fp,
close(newfd);
if(lseek(oldfd,(off_t)0,SEEK_END) < hp->histcnt)
{
register int index = hp->histind;
int index = hp->histind;
lseek(oldfd,(off_t)2,SEEK_SET);
hp->histcnt = 2;
hp->histind = 1;

View file

@ -247,9 +247,9 @@ static int textmod __PROTO__((int,int));
*
-*/
ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar)) __OTORP__(int fd; register char *shbuf; int nchar;){
register int i; /* general variable */
register int term_char; /* read() termination character */
ed_viread __PARAM__((int fd, char *shbuf, int nchar), (fd, shbuf, nchar)) __OTORP__(int fd; char *shbuf; int nchar;){
int i; /* general variable */
int term_char; /* read() termination character */
char prompt[PRSIZE+2]; /* prompt */
genchar Physical[2*MAXLINE]; /* physical image */
genchar Ubuf[MAXLINE]; /* used for U command */
@ -316,7 +316,7 @@ ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar
}
else
{
register int c = shbuf[0];
int c = shbuf[0];
/*** Save and remove the last character if its an eol, ***/
/* changing '\r' to '\n' */
@ -448,7 +448,7 @@ ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar
virtual[i] = '\n';
if(!echoctl)
{
register int c = virtual[i];
int c = virtual[i];
if( c<=usrerase)
{
/*** user typed escaped erase or kill char ***/
@ -652,7 +652,7 @@ ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar
#define virtual editb.e_inbuf /* pointer to virtual image buffer */
static void append __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int mode;){
register int i,j;
int i,j;
if( last_virt<max_col && last_phys<max_col )
{
@ -675,8 +675,8 @@ static void append __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int
*
}*/
static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __OTORP__(int nwords; register int cmd;){
register int tcur_virt = cur_virt;
static void backword __PARAM__((int nwords, int cmd), (nwords, cmd)) __OTORP__(int nwords; int cmd;){
int tcur_virt = cur_virt;
while( nwords-- && tcur_virt > first_virt )
{
if( !kshisblank(tcur_virt) && kshisblank(tcur_virt-1)
@ -684,8 +684,8 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
--tcur_virt;
else if(cmd != 'B')
{
register int last = isalph(tcur_virt-1);
register int cur = isalph(tcur_virt);
int last = isalph(tcur_virt-1);
int cur = isalph(tcur_virt);
if((!cur && last) || (cur && !last))
--tcur_virt;
}
@ -719,8 +719,8 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
}*/
static int cntlmode __PARAM__((void), ()){
register int c;
register int i;
int c;
int i;
genchar tmp_u_space[MAXLINE]; /* temporary u_space */
genchar *real_u_space; /* points to real u_space */
int tmp_u_column = INVALID; /* temporary u_column */
@ -829,7 +829,7 @@ static int cntlmode __PARAM__((void), ()){
case cntl('V'):
{
register const char *p = &e_version[5];
const char *p = &e_version[5];
save_v();
del_line(BAD);
while(c = *p++)
@ -971,7 +971,7 @@ static int cntlmode __PARAM__((void), ()){
case '#': /** insert(delete) # to (no)comment command **/
if( cur_virt != INVALID )
{
register genchar *p = &virtual[last_virt+1];
genchar *p = &virtual[last_virt+1];
*p = 0;
/*** see whether first char is comment char ***/
c = (virtual[0]=='#');
@ -1026,8 +1026,8 @@ static int cntlmode __PARAM__((void), ()){
*
}*/
static void cursor __PARAM__((register int x), (x)) __OTORP__(register int x;){
register int delta;
static void cursor __PARAM__((int x), (x)) __OTORP__(int x;){
int delta;
#ifdef SHOPT_MULTIBYTE
while(physical[x]==MARKER)
@ -1076,9 +1076,9 @@ static void cursor __PARAM__((register int x), (x)) __OTORP__(register int x;){
*
}*/
static void cdelete __PARAM__((register int nchars, int mode), (nchars, mode)) __OTORP__(register int nchars; int mode;){
register int i;
register genchar *vp;
static void cdelete __PARAM__((int nchars, int mode), (nchars, mode)) __OTORP__(int nchars; int mode;){
int i;
genchar *vp;
if( cur_virt < first_virt )
{
@ -1162,8 +1162,8 @@ static void del_line __PARAM__((int mode), (mode)) __OTORP__(int mode;){
}*/
static int delmotion __PARAM__((int motion, int mode), (motion, mode)) __OTORP__(int motion; int mode;){
register int begin, end, delta;
/* the following saves a register */
int begin, end, delta;
/* the following saves a */
if( cur_virt == INVALID )
return(0);
@ -1215,8 +1215,8 @@ static int delmotion __PARAM__((int motion, int mode), (motion, mode)) __OTORP__
*
}*/
static void endword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __OTORP__(int nwords; register int cmd;){
register int tcur_virt = cur_virt;
static void endword __PARAM__((int nwords, int cmd), (nwords, cmd)) __OTORP__(int nwords; int cmd;){
int tcur_virt = cur_virt;
while( nwords-- )
{
if( !kshisblank(tcur_virt) && tcur_virt<=last_virt )
@ -1251,8 +1251,8 @@ static void endword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __O
*
}*/
static void forward __PARAM__((register int nwords, int cmd), (nwords, cmd)) __OTORP__(register int nwords; int cmd;){
register int tcur_virt = cur_virt;
static void forward __PARAM__((int nwords, int cmd), (nwords, cmd)) __OTORP__(int nwords; int cmd;){
int tcur_virt = cur_virt;
while( nwords-- )
{
if( cmd == 'W' )
@ -1290,8 +1290,8 @@ static void forward __PARAM__((register int nwords, int cmd), (nwords, cmd)) __O
*
}*/
static int getcount __PARAM__((register int c), (c)) __OTORP__(register int c;){
register int i;
static int getcount __PARAM__((int c), (c)) __OTORP__(int c;){
int i;
/*** get any repeat count ***/
@ -1330,9 +1330,9 @@ static int getcount __PARAM__((register int c), (c)) __OTORP__(register int c;){
*
}*/
static void getline __PARAM__((register int mode), (mode)) __OTORP__(register int mode;){
register int c;
register int tmp;
static void getline __PARAM__((int mode), (mode)) __OTORP__(int mode;){
int c;
int tmp;
addnl = 1;
@ -1494,11 +1494,11 @@ static void getline __PARAM__((register int mode), (mode)) __OTORP__(register in
*
}*/
static int mvcursor __PARAM__((register int motion), (motion)) __OTORP__(register int motion;){
register int count;
register int tcur_virt;
register int incr = -1;
register int bound = 0;
static int mvcursor __PARAM__((int motion), (motion)) __OTORP__(int motion;){
int count;
int tcur_virt;
int incr = -1;
int bound = 0;
static int last_find = 0; /* last find command */
switch(motion)
@ -1669,9 +1669,9 @@ find_b:
* print a string
*/
static void pr_string __PARAM__((register const char *sp), (sp)) __OTORP__(register const char *sp;){
static void pr_string __PARAM__((const char *sp), (sp)) __OTORP__(const char *sp;){
/*** copy string sp ***/
register char *ptr = editb.e_outptr;
char *ptr = editb.e_outptr;
while(*sp)
*ptr++ = *sp++;
editb.e_outptr = ptr;
@ -1685,7 +1685,7 @@ static void pr_string __PARAM__((register const char *sp), (sp)) __OTORP__(regis
*
}*/
static void putstring __PARAM__((register int col, register int nchars), (col, nchars)) __OTORP__(register int col; register int nchars;){
static void putstring __PARAM__((int col, int nchars), (col, nchars)) __OTORP__(int col; int nchars;){
while( nchars-- )
putchar(physical[col++]);
return;
@ -1721,9 +1721,9 @@ static void putstring __PARAM__((register int col, register int nchars), (col, n
}*/
static void refresh __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register int p;
register int regb;
register int first_w = first_wind;
int p;
int regb;
int first_w = first_wind;
int p_differ;
int new_lw;
int ncur_phys;
@ -1890,8 +1890,8 @@ static void refresh __PARAM__((int mode), (mode)) __OTORP__(int mode;){
*
}*/
static void replace __PARAM__((register int c, register int increment), (c, increment)) __OTORP__(register int c; register int increment;){
register int cur_window;
static void replace __PARAM__((int c, int increment), (c, increment)) __OTORP__(int c; int increment;){
int cur_window;
if( cur_virt == INVALID )
{
@ -1945,7 +1945,7 @@ static void replace __PARAM__((register int c, register int increment), (c, incr
}*/
static void restore_v __PARAM__((void), ()){
register int tmpcol;
int tmpcol;
genchar tmpspace[MAXLINE];
if( u_column == INVALID-1 )
@ -1971,7 +1971,7 @@ static void restore_v __PARAM__((void), ()){
}*/
static void save_last __PARAM__((void), ()){
register int i;
int i;
if( (i = cur_virt - first_virt + 1) > 0 )
{
@ -2015,8 +2015,8 @@ static void save_v __PARAM__((void), ()){
* search for <string> in the current command
*/
static int curline_search __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register int len=strlen(string);
register const char *dp,*cp=string, *dpmax;
int len=strlen(string);
const char *dp,*cp=string, *dpmax;
#ifdef SHOPT_MULTIBYTE
ed_external(u_space,(char*)u_space);
#endif /* SHOPT_MULTIBYTE */
@ -2031,10 +2031,10 @@ static int curline_search __PARAM__((const char *string), (string)) __OTORP__(co
return(-1);
}
static int search __PARAM__((register int mode), (mode)) __OTORP__(register int mode;){
register int new_direction;
register int oldcurhline;
register int i;
static int search __PARAM__((int mode), (mode)) __OTORP__(int mode;){
int new_direction;
int oldcurhline;
int i;
static int direction = -1;
Histloc_t location;
@ -2114,9 +2114,9 @@ static int search __PARAM__((register int mode), (mode)) __OTORP__(register int
}*/
static void sync_cursor __PARAM__((void), ()){
register int p;
register int v;
register int c;
int p;
int v;
int c;
int new_phys;
if( cur_virt == INVALID )
@ -2199,10 +2199,10 @@ static void sync_cursor __PARAM__((void), ()){
*
}*/
static int textmod __PARAM__((register int c, int mode), (c, mode)) __OTORP__(register int c; int mode;){
register int i;
register genchar *p = lastline;
register int trepeat = repeat;
static int textmod __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int mode;){
int i;
genchar *p = lastline;
int trepeat = repeat;
static int lastmacro;
genchar *savep;
@ -2521,19 +2521,19 @@ yankeol:
#ifdef SHOPT_MULTIBYTE
static int isalph __PARAM__((register int c), (c)) __OTORP__(register int c;){
register int v = virtual[c];
static int isalph __PARAM__((int c), (c)) __OTORP__(int c;){
int v = virtual[c];
return((v&~STRIP) || isalnum(v) || v=='_');
}
static int kshisblank __PARAM__((register int c), (c)) __OTORP__(register int c;){
register int v = virtual[c];
static int kshisblank __PARAM__((int c), (c)) __OTORP__(int c;){
int v = virtual[c];
return((v&~STRIP)==0 && isspace(v));
}
static int ismetach __PARAM__((register int c), (c)) __OTORP__(register int c;){
register int v = virtual[c];
static int ismetach __PARAM__((int c), (c)) __OTORP__(int c;){
int v = virtual[c];
return((v&~STRIP)==0 && ismeta(v));
}
@ -2544,7 +2544,7 @@ yankeol:
*/
static int getrchar()
{
register int c;
int c;
if((c=ed_getchar(1))== usrlnext)
c = ed_getchar(2);
return(c);

View file

@ -66,10 +66,10 @@ static char id[] = "\n@(#)mamstate (AT&T Bell Laboratories) 06/26/89\0\n";
main(argc, argv)
int argc;
register char** argv;
char** argv;
{
register char* s;
register int c;
char* s;
int c;
long ref;
struct stat st;
char buf[1024];

View file

@ -133,9 +133,9 @@ static char flagadr[NUM_OPTS+1];
* The -o option is used to set option by name
* This routine returns the number of non-option arguments
*/
int sh_argopts __PARAM__((int argc,register char *argv[]), (argc, argv)) __OTORP__(int argc;register char *argv[];){
register int n;
register Shopt_t newflags=sh.options, opt;
int sh_argopts __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){
int n;
Shopt_t newflags=sh.options, opt;
int setflag=0, action=0, trace=(int)sh_isoption(SH_XTRACE);
Namval_t *np = NIL(Namval_t*);
const char *cp;
@ -296,8 +296,8 @@ int sh_argopts __PARAM__((int argc,register char *argv[]), (argc, argv)) __OTORP
* returns the value of $-
*/
char *sh_argdolminus __PARAM__((void), ()){
register const char *cp=sh_optksh;
register char *flagp=flagadr;
const char *cp=sh_optksh;
char *flagp=flagadr;
while(cp< &sh_optksh[NUM_OPTS])
{
if(sh.options&flagval[cp-sh_optksh])
@ -329,8 +329,8 @@ void sh_argset __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
* If flag is set, then the block dolh is not freed
*/
struct dolnod *sh_argfree __PARAM__((struct dolnod *blk,int flag), (blk, flag)) __OTORP__(struct dolnod *blk;int flag;){
register struct dolnod* argr=blk;
register struct dolnod* argblk;
struct dolnod* argr=blk;
struct dolnod* argblk;
if(argblk=argr)
{
if((--argblk->dolrefcnt)==0)
@ -364,10 +364,10 @@ struct dolnod *sh_argfree __PARAM__((struct dolnod *blk,int flag), (blk, flag))
* grab space for arglist and copy args
* The strings are copied after the argument vector
*/
struct dolnod *sh_argcreate __PARAM__((register char *argv[]), (argv)) __OTORP__(register char *argv[];){
register struct dolnod *dp;
register char **pp=argv, *sp;
register int size=0,n;
struct dolnod *sh_argcreate __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
struct dolnod *dp;
char **pp=argv, *sp;
int size=0,n;
/* count args and number of bytes of arglist */
while(sp= *pp++)
size += strlen(sp);
@ -391,7 +391,7 @@ struct dolnod *sh_argcreate __PARAM__((register char *argv[]), (argv)) __OTORP__
* used to set new arguments for functions
*/
struct dolnod *sh_argnew __PARAM__((char *argi[], struct dolnod **savargfor), (argi, savargfor)) __OTORP__(char *argi[]; struct dolnod **savargfor;){
register struct dolnod *olddolh = dolh;
struct dolnod *olddolh = dolh;
*savargfor = argfor;
dolh = 0;
argfor = 0;
@ -416,7 +416,7 @@ void sh_argreset __PARAM__((struct dolnod *blk, struct dolnod *afor), (blk, afor
* increase the use count so that an sh_argset will not make it go away
*/
struct dolnod *sh_arguse __PARAM__((void), ()){
register struct dolnod *dh;
struct dolnod *dh;
if(dh=dolh)
dh->dolrefcnt++;
return(dh);
@ -426,8 +426,8 @@ struct dolnod *sh_arguse __PARAM__((void), ()){
* Print option settings on standard output
* if mode==1 for -o format, otherwise +o format
*/
static void print_opts __PARAM__((Shopt_t oflags,register int mode), (oflags, mode)) __OTORP__(Shopt_t oflags;register int mode;){
register const Shtable_t *tp = shtab_options;
static void print_opts __PARAM__((Shopt_t oflags,int mode), (oflags, mode)) __OTORP__(Shopt_t oflags;int mode;){
const Shtable_t *tp = shtab_options;
Shopt_t value;
if(mode)
sfputr(sfstdout,ERROR_translate(e_heading,1),'\n');
@ -459,10 +459,10 @@ static void print_opts __PARAM__((Shopt_t oflags,register int mode), (oflags, mo
* build an argument list
*/
char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs, comptr)) __OTORP__(int *nargs; const struct comnod *comptr;){
register struct argnod *argp;
struct argnod *argp;
struct argnod *arghead=0;
{
register const struct comnod *ac = comptr;
const struct comnod *ac = comptr;
/* see if the arguments have already been expanded */
if(!ac->comarg)
{
@ -471,7 +471,7 @@ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs,
}
else if(!(ac->comtyp&COMSCAN))
{
register struct dolnod *ap = (struct dolnod*)ac->comarg;
struct dolnod *ap = (struct dolnod*)ac->comarg;
*nargs = ap->dolnum;
return(ap->dolval+ap->dolbot);
}
@ -489,9 +489,9 @@ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs,
}
}
{
register char **comargn;
register int argn;
register char **comargm;
char **comargn;
int argn;
char **comargm;
argn = *nargs;
/* allow room to prepend args */
#ifdef SHOPT_VPIX
@ -528,14 +528,14 @@ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs,
}
/* Argument expansion */
static int arg_expand __PARAM__((register struct argnod *argp, struct argnod **argchain), (argp, argchain)) __OTORP__(register struct argnod *argp; struct argnod **argchain;){
register int count = 0;
static int arg_expand __PARAM__((struct argnod *argp, struct argnod **argchain), (argp, argchain)) __OTORP__(struct argnod *argp; struct argnod **argchain;){
int count = 0;
argp->argflag &= ~ARG_MAKE;
#ifdef SHOPT_DEVFD
if(*argp->argval==0 && (argp->argflag&ARG_EXP))
{
/* argument of the form (cmd) */
register struct argnod *ap;
struct argnod *ap;
int monitor, fd, pv[2];
ap = (struct argnod*)stakseek(ARGVAL);
ap->argflag |= ARG_MAKE;

View file

@ -101,14 +101,14 @@
static int level;
static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type, double n), (ptr, lvalue, type, n)) __OTORP__(const char **ptr; struct lval *lvalue; int type; double n;){
register double r= 0;
double r= 0;
char *str = (char*)*ptr;
switch(type)
{
case ASSIGN:
{
register Namval_t *np = (Namval_t*)(lvalue->value);
register Namarr_t *ap;
Namval_t *np = (Namval_t*)(lvalue->value);
Namarr_t *ap;
if(ap = nv_arrayptr(np))
{
if(!array_assoc(ap))
@ -119,13 +119,13 @@ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type,
}
case LOOKUP:
{
register int c = *str;
int c = *str;
lvalue->value = (char*)0;
if(c=='.')
c = str[1];
if(isaletter(c))
{
register Namval_t *np;
Namval_t *np;
while(c= *++str, isaname(c)||c=='.');
if(c=='(')
{
@ -177,7 +177,7 @@ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type,
}
case VALUE:
{
register Namval_t *np = (Namval_t*)(lvalue->value);
Namval_t *np = (Namval_t*)(lvalue->value);
if(sh_isoption(SH_NOEXEC))
return(0);
if((level || sh_isoption(SH_NOUNSET)) && nv_isnull(np) && !nv_isattr(np,NV_INTEGER))
@ -200,13 +200,13 @@ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type,
return(r);
}
double sh_strnum __PARAM__((register const char *str, char** ptr), (str, ptr)) __OTORP__(register const char *str; char** ptr;){
double sh_strnum __PARAM__((const char *str, char** ptr), (str, ptr)) __OTORP__(const char *str; char** ptr;){
return(strval(str,(char**)ptr, arith));
}
double sh_arith __PARAM__((register const char *str), (str)) __OTORP__(register const char *str;){
double sh_arith __PARAM__((const char *str), (str)) __OTORP__(const char *str;){
const char *ptr = str;
register double d;
double d;
if(*str==0)
return(0);
d = strval(str,(char**)&ptr,arith);

View file

@ -114,8 +114,8 @@ struct index_array
* but <= ARRAY_MAX) is returned.
*
*/
static int arsize __PARAM__((register int maxi), (maxi)) __OTORP__(register int maxi;){
register int i = roundof(maxi,ARRAY_INCR);
static int arsize __PARAM__((int maxi), (maxi)) __OTORP__(int maxi;){
int i = roundof(maxi,ARRAY_INCR);
return (i>ARRAY_MAX?ARRAY_MAX:i);
}
@ -126,10 +126,10 @@ static int arsize __PARAM__((register int maxi), (maxi)) __OTORP__(register int
* allocated Namarr_t structure is returned.
* <maxi> becomes the current index of the array.
*/
static struct index_array *array_grow __PARAM__((register struct index_array *arp,int maxi), (arp, maxi)) __OTORP__(register struct index_array *arp;int maxi;){
register struct index_array *ap;
register int i=0;
register int newsize = arsize(maxi+1);
static struct index_array *array_grow __PARAM__((struct index_array *arp,int maxi), (arp, maxi)) __OTORP__(struct index_array *arp;int maxi;){
struct index_array *ap;
int i=0;
int newsize = arsize(maxi+1);
if (maxi >= ARRAY_MAX)
error(ERROR_exit(1),e_subscript, fmtbase((long)maxi,10,0));
ap = new_of(struct index_array,(newsize-1)*sizeof(union Value*));
@ -158,7 +158,7 @@ static struct index_array *array_grow __PARAM__((register struct index_array *ar
* Check for bounds violation for indexed array
*/
void array_check __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval_t *np;int flag;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
struct index_array *ap = (struct index_array*)nv_arrayptr(np);
if(ap->header.nelem&ARRAY_UNDEF)
{
ap->header.nelem &= ~ARRAY_UNDEF;
@ -194,9 +194,9 @@ void array_check __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval
* After the lookup is done the last @ or * subscript is incremented
*/
union Value *array_find __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval_t *np;int flag;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register union Value *up;
register unsigned dot=0;
struct index_array *ap = (struct index_array*)nv_arrayptr(np);
union Value *up;
unsigned dot=0;
if(is_associative(ap))
up = (union Value*)((*ap->header.fun)(np,NIL(char*),0));
else
@ -241,12 +241,12 @@ union Value *array_find __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__
* freeing relevant storage
*/
static Namarr_t *nv_changearray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char*,int)), (np, fun)) __OTORP__(Namval_t *np; __V_ *(*fun)();){
register Namarr_t *ap;
Namarr_t *ap;
char numbuff[NUMSIZE];
unsigned dot, digit, n;
union Value *up;
struct index_array *save_ap;
register char *string_index= &numbuff[NUMSIZE];
char *string_index= &numbuff[NUMSIZE];
numbuff[NUMSIZE]='\0';
if(!fun || !(ap = nv_arrayptr(np)) || is_associative(ap))
@ -284,7 +284,7 @@ static Namarr_t *nv_changearray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,
* The array pointer is returned if sucessful.
*/
Namarr_t *nv_setarray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char*,int)), (np, fun)) __OTORP__(Namval_t *np; __V_ *(*fun)();){
register Namarr_t *ap;
Namarr_t *ap;
if(fun && (ap = nv_arrayptr(np)) && !is_associative(ap))
{
@ -321,8 +321,8 @@ Namarr_t *nv_setarray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char
* Otherwise, 1 is returned.
*/
int nv_nextsub __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register unsigned dot;
struct index_array *ap = (struct index_array*)nv_arrayptr(np);
unsigned dot;
if(!ap || !(ap->header.nelem&ARRAY_SCAN))
return(0);
if(is_associative(ap))
@ -353,9 +353,9 @@ int nv_nextsub __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
* The node pointer is returned which can be NULL if <np> is
* not already array and the ARRAY_ADD bit of <mode> is not set.
*/
Namval_t *nv_putsub __PARAM__((Namval_t *np,register char *sp,register long mode), (np, sp, mode)) __OTORP__(Namval_t *np;register char *sp;register long mode;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register int size = (mode&ARRAY_MASK);
Namval_t *nv_putsub __PARAM__((Namval_t *np,char *sp,long mode), (np, sp, mode)) __OTORP__(Namval_t *np;char *sp;long mode;){
struct index_array *ap = (struct index_array*)nv_arrayptr(np);
int size = (mode&ARRAY_MASK);
if(!ap || !ap->header.fun)
{
if(sp)
@ -367,7 +367,7 @@ Namval_t *nv_putsub __PARAM__((Namval_t *np,register char *sp,register long mode
}
if(!ap || size>=ap->maxi)
{
register struct index_array *apold;
struct index_array *apold;
if(size==0)
return(NIL(Namval_t*));
ap = array_grow(apold=ap,size);
@ -398,9 +398,9 @@ Namval_t *nv_putsub __PARAM__((Namval_t *np,register char *sp,register long mode
* process an array subscript for node <np> given the subscript <cp>
* returns pointer to character after the subscript
*/
char *nv_endsubscript __PARAM__((Namval_t *np, register char *cp, int mode), (np, cp, mode)) __OTORP__(Namval_t *np; register char *cp; int mode;){
register int count=1, quoted=0, c;
register char *sp = cp+1;
char *nv_endsubscript __PARAM__((Namval_t *np, char *cp, int mode), (np, cp, mode)) __OTORP__(Namval_t *np; char *cp; int mode;){
int count=1, quoted=0, c;
char *sp = cp+1;
/* first find matching ']' */
while(count>0 && (c= *++cp))
{
@ -435,9 +435,9 @@ char *nv_endsubscript __PARAM__((Namval_t *np, register char *cp, int mode), (np
char *nv_getsub __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
static char numbuff[NUMSIZE];
register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register unsigned dot, n;
register char *cp = &numbuff[NUMSIZE];
struct index_array *ap = (struct index_array*)nv_arrayptr(np);
unsigned dot, n;
char *cp = &numbuff[NUMSIZE];
if(!ap)
return(NIL(char*));
if(is_associative(ap))
@ -456,7 +456,7 @@ char *nv_getsub __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
* If <np> is an indexed array node, the current subscript index
* retuned, otherwise returns -1
*/
int nv_aindex __PARAM__((register Namval_t* np), (np)) __OTORP__(register Namval_t* np;){
int nv_aindex __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
Namarr_t *ap = nv_arrayptr(np);
if(!ap || is_associative(ap))
return(-1);
@ -475,9 +475,9 @@ struct assoc_array
/*
* This is the default implementation for associate arrays
*/
__V_ *nv_associative __PARAM__((register Namval_t *np,const char *sp,int mode), (np, sp, mode)) __OTORP__(register Namval_t *np;const char *sp;int mode;){
register struct assoc_array *ap = (struct assoc_array*)nv_arrayptr(np);
register int type;
__V_ *nv_associative __PARAM__((Namval_t *np,const char *sp,int mode), (np, sp, mode)) __OTORP__(Namval_t *np;const char *sp;int mode;){
struct assoc_array *ap = (struct assoc_array*)nv_arrayptr(np);
int type;
switch(mode)
{
case NV_AINIT:
@ -536,7 +536,7 @@ __V_ *nv_associative __PARAM__((register Namval_t *np,const char *sp,int mode),
/*
* Assign values to an array
*/
void nv_setvec __PARAM__((register Namval_t *np,register int argc,register char *argv[]), (np, argc, argv)) __OTORP__(register Namval_t *np;register int argc;register char *argv[];){
void nv_setvec __PARAM__((Namval_t *np,int argc,char *argv[]), (np, argc, argv)) __OTORP__(Namval_t *np;int argc;char *argv[];){
while(--argc >= 0)
{
if(argc>0 || nv_isattr(np,NV_ARRAY))

View file

@ -136,8 +136,8 @@ void sh_deparse __PARAM__((Sfio_t *out, const union anynode *t,int tflags), (out
/*
* print script corresponding to shell tree <t>
*/
static void p_tree __PARAM__((register const union anynode *t,register int tflags), (t, tflags)) __OTORP__(register const union anynode *t;register int tflags;){
register char *cp;
static void p_tree __PARAM__((const union anynode *t,int tflags), (t, tflags)) __OTORP__(const union anynode *t;int tflags;){
char *cp;
int save = end_line;
int needbrace = (tflags&NEED_BRACE);
tflags &= ~NEED_BRACE;
@ -280,7 +280,7 @@ static void p_tree __PARAM__((register const union anynode *t,register int tflag
case TARITH:
{
register struct argnod *ap = t->ar.arexpr;
struct argnod *ap = t->ar.arexpr;
if(begin_line && level)
sfnputc(outfile,'\t',level);
sfprintf(outfile,"(( %s ))%c",ap->argflag&ARG_RAW?sh_fmtq(ap->argval):ap->argval,end_line);
@ -396,7 +396,7 @@ static void p_tree __PARAM__((register const union anynode *t,register int tflag
* decrement indent level for flag==END
*/
static void p_keyword __PARAM__((const char *word,int flag), (word, flag)) __OTORP__(const char *word;int flag;){
register int sep;
int sep;
if(flag==END)
sep = end_line;
else if(*word=='[')
@ -416,9 +416,9 @@ static void p_keyword __PARAM__((const char *word,int flag), (word, flag)) __OTO
level++;
}
static void p_arg __PARAM__((register const struct argnod *arg,register int endchar,int opts), (arg, endchar, opts)) __OTORP__(register const struct argnod *arg;register int endchar;int opts;){
register const char *cp;
register int flag;
static void p_arg __PARAM__((const struct argnod *arg,int endchar,int opts), (arg, endchar, opts)) __OTORP__(const struct argnod *arg;int endchar;int opts;){
const char *cp;
int flag;
do
{
if(!arg->argnxt.ap)
@ -454,9 +454,9 @@ static void p_arg __PARAM__((register const struct argnod *arg,register int endc
return;
}
static void p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OTORP__(register const struct ionod *iop;){
register int iof;
register char *cp;
static void p_redirect __PARAM__((const struct ionod *iop), (iop)) __OTORP__(const struct ionod *iop;){
int iof;
char *cp;
for(;iop;iop=iop->ionxt)
{
iof=iop->iofile;
@ -517,8 +517,8 @@ static void p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OT
return;
}
static void p_comarg __PARAM__((const register struct comnod *com), (com)) __OTORP__(const register struct comnod *com;){
register int flag = end_line;
static void p_comarg __PARAM__((const struct comnod *com), (com)) __OTORP__(const struct comnod *com;){
int flag = end_line;
if(com->comarg || com->comio)
flag = ' ';
if(com->comset)
@ -538,8 +538,8 @@ static void p_comarg __PARAM__((const register struct comnod *com), (com)) __OTO
}
static void p_comlist __PARAM__((const struct dolnod *dol,int endchar), (dol, endchar)) __OTORP__(const struct dolnod *dol;int endchar;){
register char *cp, *const*argv;
register int flag = ' ', special;
char *cp, *const*argv;
int flag = ' ', special;
argv = dol->dolval+ARG_SPARE;
cp = *argv;
special = (*cp=='[' && cp[1]==0);
@ -562,7 +562,7 @@ static void p_comlist __PARAM__((const struct dolnod *dol,int endchar), (dol, en
return;
}
static void p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTORP__(register const struct regnod *reg;){
static void p_switch __PARAM__((const struct regnod *reg), (reg)) __OTORP__(const struct regnod *reg;){
if(level>1)
sfnputc(outfile,'\t',level-1);
p_arg(reg->regptr,')',PRE);
@ -583,7 +583,7 @@ static void p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTO
/*
* output here documents
*/
static void here_body __PARAM__((register const struct ionod *iop), (iop)) __OTORP__(register const struct ionod *iop;){
static void here_body __PARAM__((const struct ionod *iop), (iop)) __OTORP__(const struct ionod *iop;){
Sfio_t *infile;
#ifdef xxx
if(iop->iolink)

View file

@ -159,7 +159,7 @@
*/
static struct ld_info *getinfo __PARAM__((__V_ *module), (module)) __OTORP__(__V_ *module;){
struct ld_info *info=ld_info;
register int n=1;
int n=1;
if (!ld_info || module != last_module)
{
last_module = module;

View file

@ -158,8 +158,8 @@ static void glob_dir __PROTO__((struct argnod*));
#ifdef SHOPT_NOCASE
# include <ctype.h>
static void utol __PARAM__((register char const *str1,register char *str2), (str1, str2)) __OTORP__(register char const *str1;register char *str2;){
register int c;
static void utol __PARAM__((char const *str1,char *str2), (str1, str2)) __OTORP__(char const *str1;char *str2;){
int c;
for(; c= *((unsigned char*)str1); str1++,str2++)
{
if(isupper(c))
@ -180,9 +180,9 @@ static void glob_dir __PROTO__((struct argnod*));
int path_expand __PARAM__((const char *pattern, struct argnod **arghead), (pattern, arghead)) __OTORP__(const char *pattern; struct argnod **arghead;){
register struct argnod *ap;
register struct glob *gp;
register char *pat;
struct argnod *ap;
struct glob *gp;
char *pat;
#ifdef KSHELL
struct glob globdata;
membase = &globdata;
@ -223,10 +223,10 @@ int path_expand __PARAM__((const char *pattern, struct argnod **arghead), (patte
}
static void glob_dir __PARAM__((struct argnod *ap), (ap)) __OTORP__(struct argnod *ap;){
register char *rescan;
register char *prefix;
register char *pat;
register struct dirent *dirp;
char *rescan;
char *prefix;
char *pat;
struct dirent *dirp;
DIR *dirf;
char *path=0;
char quote = 0;
@ -344,7 +344,7 @@ process:
#endif /* SHOPT_NOCASE */
while(dirp = readdir(dirf))
{
register int c;
int c;
if(!D_FILENO(dirp))
continue;
if(fignore && *fignore && strmatch(dirp->d_name, fignore))
@ -365,9 +365,9 @@ process:
return;
}
static void addmatch __PARAM__((const char *dir,const char *pat,const register char *rescan,char *endslash), (dir, pat, rescan, endslash)) __OTORP__(const char *dir;const char *pat;const register char *rescan;char *endslash;){
register struct argnod *ap = (struct argnod*)stakseek(ARGVAL);
register struct glob *gp = globptr();
static void addmatch __PARAM__((const char *dir,const char *pat,const char *rescan,char *endslash), (dir, pat, rescan, endslash)) __OTORP__(const char *dir;const char *pat;const char *rescan;char *endslash;){
struct argnod *ap = (struct argnod*)stakseek(ARGVAL);
struct glob *gp = globptr();
struct stat statb;
if(dir)
{
@ -429,11 +429,11 @@ static void addmatch __PARAM__((const char *dir,const char *pat,const register
* scan tree and add each name that matches the given pattern
*/
static void scantree __PARAM__((Hashtab_t *tree, const char *pattern), (tree, pattern)) __OTORP__(Hashtab_t *tree; const char *pattern;){
register Hashpos_t *hp;
register Namval_t *np;
register struct argnod *ap;
register struct glob *gp = globptr();
register char *cp;
Hashpos_t *hp;
Namval_t *np;
struct argnod *ap;
struct glob *gp = globptr();
char *cp;
if(hp = hashscan(tree,0))
{
while((np = (Namval_t*)hashnext(hp)) && !nv_isnull(np))
@ -461,7 +461,7 @@ static void scantree __PARAM__((Hashtab_t *tree, const char *pattern), (tree, pa
* The number of matches is returned
*/
int path_complete __PARAM__((const char *name,register const char *suffix, struct argnod **arghead), (name, suffix, arghead)) __OTORP__(const char *name;register const char *suffix; struct argnod **arghead;){
int path_complete __PARAM__((const char *name,const char *suffix, struct argnod **arghead), (name, suffix, arghead)) __OTORP__(const char *name;const char *suffix; struct argnod **arghead;){
sufstr = suffix;
suflen = strlen(suffix);
return(path_expand(name,arghead));
@ -474,10 +474,10 @@ int path_complete __PARAM__((const char *name,register const char *suffix, struc
*/
static void sh_trim(sp)
register char *sp;
char *sp;
{
register char *dp = sp;
register int c;
char *dp = sp;
int c;
while(1)
{
if((c= *sp++) == '\\')
@ -491,9 +491,9 @@ register char *sp;
#ifdef SHOPT_BRACEPAT
int path_generate __PARAM__((struct argnod *todo, struct argnod **arghead), (todo, arghead)) __OTORP__(struct argnod *todo; struct argnod **arghead;){
register char *cp;
register int brace;
register struct argnod *ap;
char *cp;
int brace;
struct argnod *ap;
struct argnod *top = 0;
struct argnod *apin;
char *pat, *rescan, *bracep;

View file

@ -106,10 +106,10 @@ static char indone;
/*
* Most signals caught or ignored by the shell come here
*/
void sh_fault __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
register int flag;
register char *trap;
register struct checkpt *pp = (struct checkpt*)sh.jmplist;
void sh_fault __PARAM__((int sig), (sig)) __OTORP__(int sig;){
int flag;
char *trap;
struct checkpt *pp = (struct checkpt*)sh.jmplist;
/* reset handler */
signal(sig, sh_fault);
/* handle ignored signals */
@ -176,8 +176,8 @@ void sh_fault __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
* initialize signal handling
*/
void sh_siginit __PARAM__((void), ()){
register int sig, n=SIGTERM+1;
register const struct shtable2 *tp = shtab_signals;
int sig, n=SIGTERM+1;
const struct shtable2 *tp = shtab_signals;
init_shtab_signals();
sig_begin();
/* find the largest signal number in the table */
@ -214,8 +214,8 @@ void sh_siginit __PARAM__((void), ()){
/*
* Turn on trap handler for signal <sig>
*/
void sh_sigtrap __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
register int flag;
void sh_sigtrap __PARAM__((int sig), (sig)) __OTORP__(int sig;){
int flag;
sh.st.otrapcom = 0;
if(sig==0)
sh_sigdone();
@ -238,7 +238,7 @@ void sh_sigtrap __PARAM__((register int sig), (sig)) __OTORP__(register int sig;
* set signal handler so sh_done is called for all caught signals
*/
void sh_sigdone __PARAM__((void), ()){
register int flag, sig = sh.sigmax;
int flag, sig = sh.sigmax;
setdone=1;
sh.sigflag[0] |= SH_SIGFAULT;
while(--sig>0)
@ -254,9 +254,9 @@ void sh_sigdone __PARAM__((void), ()){
* Free the trap strings if mode is non-zero
* If mode>1 then ignored traps cause signal to be ignored
*/
void sh_sigreset __PARAM__((register int mode), (mode)) __OTORP__(register int mode;){
register char *trap;
register int flag, sig=sh.st.trapmax;
void sh_sigreset __PARAM__((int mode), (mode)) __OTORP__(int mode;){
char *trap;
int flag, sig=sh.st.trapmax;
while(sig-- > 0)
{
if(trap=sh.st.trapcom[sig])
@ -296,9 +296,9 @@ void sh_sigreset __PARAM__((register int mode), (mode)) __OTORP__(register int m
/*
* free up trap if set and restore signal handler if modified
*/
void sh_sigclear __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
register int flag = sh.sigflag[sig];
register char *trap;
void sh_sigclear __PARAM__((int sig), (sig)) __OTORP__(int sig;){
int flag = sh.sigflag[sig];
char *trap;
sh.st.otrapcom=0;
if(!(flag&SH_SIGFAULT))
return;
@ -316,8 +316,8 @@ void sh_sigclear __PARAM__((register int sig), (sig)) __OTORP__(register int sig
*/
void sh_chktrap __PARAM__((void), ()){
register int sig=sh.st.trapmax;
register char *trap;
int sig=sh.st.trapmax;
char *trap;
if(!sh.trapnote)
sig=0;
sh.trapnote &= ~SH_SIGTRAP;
@ -401,9 +401,9 @@ int sh_trap __PARAM__((const char *trap, int mode), (trap, mode)) __OTORP__(cons
/*
* exit the current scope and jump to an earlier one based on pp->mode
*/
void sh_exit __PARAM__((register int xno), (xno)) __OTORP__(register int xno;){
register struct checkpt *pp = (struct checkpt*)sh.jmplist;
register int sig=0;
void sh_exit __PARAM__((int xno), (xno)) __OTORP__(int xno;){
struct checkpt *pp = (struct checkpt*)sh.jmplist;
int sig=0;
sh.exitval=xno;
if(xno==SH_EXITSIG)
sh.exitval |= (sig=sh.lastsig);
@ -471,9 +471,9 @@ void sh_exit __PARAM__((register int xno), (xno)) __OTORP__(register int xno;){
* This is the exit routine for the shell
*/
void sh_done __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
register char *t;
register int savxit = sh.exitval;
void sh_done __PARAM__((int sig), (sig)) __OTORP__(int sig;){
char *t;
int savxit = sh.exitval;
sh.trapnote = 0;
indone=1;
if(sig==0)

View file

@ -102,8 +102,8 @@ Fcin_t _Fcin;
/*
* open stream <f> for fast character input
*/
int fcfopen __PARAM__((register Sfio_t* f), (f)) __OTORP__(register Sfio_t* f;){
register int n;
int fcfopen __PARAM__((Sfio_t* f), (f)) __OTORP__(Sfio_t* f;){
int n;
char *buff;
Fcin_t save;
errno = 0;
@ -136,9 +136,9 @@ int fcfopen __PARAM__((register Sfio_t* f), (f)) __OTORP__(register Sfio_t* f;){
* the previous character is a 0 byte.
*/
int fcfill __PARAM__((void), ()){
register int n;
register Sfio_t *f;
register unsigned char *last=_Fcin.fclast, *ptr=_Fcin.fcptr;
int n;
Sfio_t *f;
unsigned char *last=_Fcin.fclast, *ptr=_Fcin.fcptr;
if(!(f=fcfile()))
{
/* see whether pointer has passed null byte */
@ -170,7 +170,7 @@ int fcfill __PARAM__((void), ()){
* Synchronize and close the current stream
*/
int fcclose __PARAM__((void), ()){
register unsigned char *ptr;
unsigned char *ptr;
if(_Fcin.fclast==0)
return(0);
if((ptr=_Fcin.fcptr)>_Fcin.fcbuff && *(ptr-1)==0)

View file

@ -170,7 +170,7 @@ static Namval_t *ifsnp;
/*
* Invalidate all path name bindings
*/
static void rehash __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
static void rehash __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
nv_onattr(np,NV_NOALIAS);
}
@ -187,8 +187,8 @@ static char *nospace __PARAM__((int unused), (unused)) __OTORP__(int unused;){
# include "edit.h"
/* Trap for CSWIDTH variable */
static void put_cswidth __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
register char *cp;
register char *name = nv_name(np);
char *cp;
char *name = nv_name(np);
if(ed_setwidth(val?val:"") && !(flags&NV_IMPORT))
error(ERROR_exit(1),e_format,nv_name(np));
nv_putv(np, val, flags, fp);
@ -196,8 +196,8 @@ static char *nospace __PARAM__((int unused), (unused)) __OTORP__(int unused;){
#endif /* SHOPT_MULTIBYTE */
/* Trap for VISUAL and EDITOR variables */
static void put_ed __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){
register const char *cp, *name=nv_name(np);
static void put_ed __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
const char *cp, *name=nv_name(np);
if(*name=='E' && nv_getval(nv_scoped(VISINOD)))
goto done;
sh_offoption(SH_VI|SH_EMACS|SH_GMACS);
@ -225,7 +225,7 @@ static void put_optindex __PARAM__((Namval_t* np,const char *val,int flags,Namfu
}
/* Trap for restricted variables PATH, SHELL, ENV */
static void put_restricted __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){
static void put_restricted __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
if(!(flags&NV_RDONLY) && sh_isoption(SH_RESTRICTED))
error(ERROR_exit(1),e_restricted,nv_name(np));
if(nv_name(np)==nv_name(PATHNOD))
@ -498,7 +498,7 @@ static MsgStr allmsgs[] = {
/*
* Without this proto, standard C says that _DtGetMessage() returns
* an int, even though it really returns a pointer. The compiler is
* then free to use the high 32-bits of the return register for
* then free to use the high 32-bits of the return for
* something else (like scratch), and that can garble the pointer.
*/
char *_DtGetMessage __PROTO__((char *filename, int set, int n, char *s));
@ -713,7 +713,7 @@ char *savedNlsPath;
void charsize_init __PARAM__((void), ()){
static char fc[3] = { 0301, ESS2, ESS3};
char buff[8];
register int i,n;
int i,n;
wchar_t wc;
memset(buff,0301,MB_CUR_MAX);
for(i=0; i<=2; i++)
@ -762,7 +762,7 @@ char *savedNlsPath;
free((__V_*)sh_lexstates[ST_BEGIN]);
if(ast.locale.set&LC_SET_CTYPE)
{
register int c;
int c;
char *state[4];
sh_lexstates[ST_BEGIN] = state[0] = (char*)malloc(4*(1<<CHAR_BIT));
memcpy(state[0],sh_lexrstates[ST_BEGIN],(1<<CHAR_BIT));
@ -811,7 +811,7 @@ char *savedNlsPath;
#endif /* _hdr_locale */
/* Trap for IFS assignment and invalidates state table */
static void put_ifs __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){
static void put_ifs __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
ifsnp = 0;
nv_putv(np, val, flags, fp);
}
@ -820,9 +820,9 @@ static void put_ifs __PARAM__((register Namval_t* np,const char *val,int flags,N
* This is the lookup function for IFS
* It keeps the sh.ifstable up to date
*/
static char* get_ifs __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){
register char *cp, *value;
register int c,n;
static char* get_ifs __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
char *cp, *value;
int c,n;
value = nv_getv(np,fp);
if(np!=ifsnp)
{
@ -872,7 +872,7 @@ static char* get_ifs __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp))
# define gettimeofday(a,b)
#endif
static void put_seconds __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){
static void put_seconds __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
static double sec_offset;
double d;
struct tms tp;
@ -896,7 +896,7 @@ static void put_seconds __PARAM__((register Namval_t* np,const char *val,int fla
}
}
static char* get_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){
static char* get_seconds __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
struct tms tp;
double d;
NOT_USED(fp);
@ -905,7 +905,7 @@ static char* get_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np, f
return(sh_ftos(d,nv_size(np)));
}
static double nget_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){
static double nget_seconds __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
struct tms tp;
NOT_USED(fp);
gettimeofday(&tp,NIL(void *));
@ -915,9 +915,9 @@ static double nget_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np,
/*
* These three functions are used to get and set the RANDOM variable
*/
static void put_rand __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){
static void put_rand __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
static long rand_last;
register long n;
long n;
NOT_USED(fp);
if(!val)
{
@ -939,8 +939,8 @@ static void put_rand __PARAM__((register Namval_t* np,const char *val,int flags,
* get random number in range of 0 - 2**15
* never pick same number twice in a row
*/
static double nget_rand __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){
register long cur, last= *np->nvalue.lp;
static double nget_rand __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
long cur, last= *np->nvalue.lp;
NOT_USED(fp);
do
cur = (rand()>>rand_shift)&RANDMASK;
@ -949,8 +949,8 @@ static double nget_rand __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp
return((double)cur);
}
static char* get_rand __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){
register long n = nget_rand(np,fp);
static char* get_rand __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
long n = nget_rand(np,fp);
return(fmtbase(n, 10, 0));
}
@ -969,7 +969,7 @@ static double nget_lineno __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OT
}
static void put_lineno __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
register long n;
long n;
NOT_USED(fp);
if(!val)
{
@ -984,8 +984,8 @@ static void put_lineno __PARAM__((Namval_t* np,const char *val,int flags,Namfun_
sh.st.firstline += nget_lineno(np,fp)+1-n;
}
static char* get_lineno __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){
register long n = nget_lineno(np,fp);
static char* get_lineno __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
long n = nget_lineno(np,fp);
return(fmtbase(n, 10, 0));
}
@ -1014,7 +1014,7 @@ static void put_lastarg __PARAM__((Namval_t* np,const char *val,int flags,Namfun
* set or unset the mappings given a colon separated list of directories
*/
static void vpath_set __PARAM__((char *str, int mode), (str, mode)) __OTORP__(char *str; int mode;){
register char *lastp, *oldp=str, *newp=strchr(oldp,':');
char *lastp, *oldp=str, *newp=strchr(oldp,':');
if(!sh.lim.fs3d)
return;
while(newp)
@ -1030,8 +1030,8 @@ static void put_lastarg __PARAM__((Namval_t* np,const char *val,int flags,Namfun
}
/* catch vpath assignments */
static void put_vpath __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){
register char *cp;
static void put_vpath __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
char *cp;
if(cp = nv_getval(np))
vpath_set(cp,0);
if(val)
@ -1079,7 +1079,7 @@ static Namfun_t L_ARG_init = { &L_ARG_disc};
* This function will get called whenever a configuration parameter changes
*/
static int newconf __PARAM__((const char *name, const char *path, const char *value), (name, path, value)) __OTORP__(const char *name; const char *path; const char *value;){
register char *arg;
char *arg;
if(strcmp(name,"UNIVERSE")==0 && strcmp(astconf(name,0,0),value))
{
sh.universe = 0;
@ -1098,9 +1098,9 @@ static int newconf __PARAM__((const char *name, const char *path, const char *va
/*
* initialize the shell
*/
int sh_init __PARAM__((register int argc,register char *argv[]), (argc, argv)) __OTORP__(register int argc;register char *argv[];){
register char *name;
register int n,prof;
int sh_init __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){
char *name;
int n,prof;
#ifdef MTRACE
Mt_certify = 1;
#endif /* MTRACE */
@ -1241,8 +1241,8 @@ void sh_reinit __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
/*
* set when creating a local variable of this name
*/
Namfun_t *nv_cover __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register Namfun_t *nfp=0;
Namfun_t *nv_cover __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
Namfun_t *nfp=0;
if(np==IFSNOD)
nfp = &IFS_init;
else if(np==PATHNOD)
@ -1299,10 +1299,10 @@ static void nv_init __PARAM__((void), ()){
*/
static Hashtab_t *inittree __PARAM__((const struct shtable2 *name_vals), (name_vals)) __OTORP__(const struct shtable2 *name_vals;){
register Namval_t *np;
register const struct shtable2 *tp;
register unsigned n = 0;
register Hashtab_t *treep;
Namval_t *np;
const struct shtable2 *tp;
unsigned n = 0;
Hashtab_t *treep;
for(tp=name_vals;*tp->sh_name;tp++)
n++;
np = (Namval_t*)calloc(n,sizeof(Namval_t));
@ -1348,10 +1348,10 @@ static Hashtab_t *inittree __PARAM__((const struct shtable2 *name_vals), (name_v
*/
static void env_init __PARAM__((void), ()){
register char *cp;
register Namval_t *np;
register char **ep=environ;
register char *next=0;
char *cp;
Namval_t *np;
char **ep=environ;
char *next=0;
if(ep)
{
while(cp= *ep++)

View file

@ -153,7 +153,7 @@ static int slowread __PROTO__((Sfio_t*, __V_*, int, Sfdisc_t*));
static int slowexcept __PROTO__((Sfio_t*, int, Sfdisc_t*));
static int pipeexcept __PROTO__((Sfio_t*, int, Sfdisc_t*));
static int io_prompt __PROTO__((int));
static int io_heredoc __PROTO__((register struct ionod*));
static int io_heredoc __PROTO__((struct ionod*));
static void sftrack __PROTO__((Sfio_t*,int,int));
static int tee_write __PROTO__((Sfio_t*,const __V_*,int,Sfdisc_t*));
static const Sfdisc_t eval_disc = { NULL, NULL, NULL, eval_exceptf, NULL};
@ -178,7 +178,7 @@ static short filemapsize;
/* ======== input output and file copying ======== */
void sh_ioinit __PARAM__((void), ()){
register int n;
int n;
filemapsize = 8;
filemap = (struct fdsave*)malloc(8*sizeof(struct fdsave));
#ifdef SHOPT_FASTPIPE
@ -215,10 +215,10 @@ void sh_ioinit __PARAM__((void), ()){
* For output streams, the buffer is set to sh.output and put into
* the sh.outpool synchronization pool
*/
Sfio_t *sh_iostream __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
register Sfio_t *iop;
register int status = sh_iocheckfd(fd);
register int flags = SF_WRITE;
Sfio_t *sh_iostream __PARAM__((int fd), (fd)) __OTORP__(int fd;){
Sfio_t *iop;
int status = sh_iocheckfd(fd);
int flags = SF_WRITE;
char *bp;
int size;
#ifdef SHOPT_FASTPIPE
@ -282,8 +282,8 @@ Sfio_t *sh_iostream __PARAM__((register int fd), (fd)) __OTORP__(register int fd
/*
* preserve the file descriptor or stream by moving it
*/
static void io_preserve __PARAM__((register Sfio_t *sp, register int f2), (sp, f2)) __OTORP__(register Sfio_t *sp; register int f2;){
register int fd;
static void io_preserve __PARAM__((Sfio_t *sp, int f2), (sp, f2)) __OTORP__(Sfio_t *sp; int f2;){
int fd;
if(sp)
fd = sfsetfd(sp,10);
else
@ -315,8 +315,8 @@ static void io_preserve __PARAM__((register Sfio_t *sp, register int f2), (sp, f
* The original stream <f1> is closed.
* The new file descriptor <f2> is returned;
*/
int sh_iorenumber __PARAM__((register int f1,register int f2), (f1, f2)) __OTORP__(register int f1;register int f2;){
register Sfio_t *sp = sh.sftable[f2];
int sh_iorenumber __PARAM__((int f1,int f2), (f1, f2)) __OTORP__(int f1;int f2;){
Sfio_t *sp = sh.sftable[f2];
if(f1!=f2)
{
/* see whether file descriptor is in use */
@ -330,7 +330,7 @@ int sh_iorenumber __PARAM__((register int f1,register int f2), (f1, f2)) __OTORP
sh_close(f2);
if(f2<=2 && sp)
{
register Sfio_t *spnew = sh_iostream(f1);
Sfio_t *spnew = sh_iostream(f1);
sh.fdstatus[f2] = (sh.fdstatus[f1]&~IOCLEX);
sfsetfd(spnew,f2);
sfswap(spnew,sp);
@ -354,9 +354,9 @@ int sh_iorenumber __PARAM__((register int f1,register int f2), (f1, f2)) __OTORP
/*
* close a file descriptor and update stream table and attributes
*/
int sh_close __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
register Sfio_t *sp;
register int r = 0;
int sh_close __PARAM__((int fd), (fd)) __OTORP__(int fd;){
Sfio_t *sp;
int r = 0;
if(fd<0)
return(-1);
if(fd==sh.coutpipe)
@ -379,9 +379,9 @@ int sh_close __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
* Open a file for reading
* On failure, print message.
*/
int sh_open __PARAM__((register const char *path, int flags, ...), (va_alist)) __OTORP__(va_dcl)
{ __OTORP__(register const char *path; int flags; )
register int fd;
int sh_open __PARAM__((const char *path, int flags, ...), (va_alist)) __OTORP__(va_dcl)
{ __OTORP__(const char *path; int flags; )
int fd;
mode_t mode;
#ifdef SOCKET
struct sockaddr_in addr;
@ -432,8 +432,8 @@ int sh_open __PARAM__((register const char *path, int flags, ...), (va_alist)) _
return(fd);
}
int sh_chkopen __PARAM__((register const char *name), (name)) __OTORP__(register const char *name;){
register int fd = sh_open(name,O_RDONLY,0);
int sh_chkopen __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
int fd = sh_open(name,O_RDONLY,0);
if(fd < 0)
error(ERROR_system(1),e_open,name);
return(fd);
@ -442,8 +442,8 @@ int sh_chkopen __PARAM__((register const char *name), (name)) __OTORP__(register
/*
* move open file descriptor to a number > 2
*/
int sh_iomovefd __PARAM__((register int fdold), (fdold)) __OTORP__(register int fdold;){
register int fdnew;
int sh_iomovefd __PARAM__((int fdold), (fdold)) __OTORP__(int fdold;){
int fdnew;
if(fdold<0 || fdold>2)
return(fdold);
fdnew = sh_iomovefd(dup(fdold));
@ -456,7 +456,7 @@ int sh_iomovefd __PARAM__((register int fdold), (fdold)) __OTORP__(register int
/*
* create a pipe and print message on failure
*/
int sh_pipe __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];){
int sh_pipe __PARAM__((int pv[]), (pv)) __OTORP__(int pv[];){
int fd[2];
if(pipe(fd)<0 || (pv[0]=fd[0])<0 || (pv[1]=fd[1])<0)
error(ERROR_system(1),e_pipe);
@ -470,7 +470,7 @@ int sh_pipe __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];){
/*
* close a pipe
*/
void sh_pclose __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];){
void sh_pclose __PARAM__((int pv[]), (pv)) __OTORP__(int pv[];){
if(pv[0]>=2)
sh_close(pv[0]);
if(pv[1]>=2)
@ -485,9 +485,9 @@ void sh_pclose __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];
* flag = 3 when called from $( < ...), just open file and return
*/
int sh_redirect __PARAM__((struct ionod *iop, int flag), (iop, flag)) __OTORP__(struct ionod *iop; int flag;){
register char *fname;
register int fd, iof;
register Namval_t *np=0;
char *fname;
int fd, iof;
Namval_t *np=0;
const char *message = e_open;
int o_mode; /* mode flag for open */
static char io_op[5]; /* used for -x trace info */
@ -663,9 +663,9 @@ fail:
/*
* Create a tmp file for the here-document
*/
static int io_heredoc __PARAM__((register struct ionod *iop), (iop)) __OTORP__(register struct ionod *iop;){
register Sfio_t *infile = 0, *outfile;
register char fd;
static int io_heredoc __PARAM__((struct ionod *iop), (iop)) __OTORP__(struct ionod *iop;){
Sfio_t *infile = 0, *outfile;
char fd;
/* create an unnamed temporary file */
if(!(outfile=sftmp(0)))
error(ERROR_system(1),e_tmpcreate);
@ -716,12 +716,12 @@ static int tee_write __PARAM__((Sfio_t *iop,const __V_ *buff,int n,Sfdisc_t *unu
* if <origfd> < 0, then -origfd is saved, but not duped so that it
* will be closed with sh_iorestore.
*/
void sh_iosave __PARAM__((register int origfd, int oldtop), (origfd, oldtop)) __OTORP__(register int origfd; int oldtop;){
void sh_iosave __PARAM__((int origfd, int oldtop), (origfd, oldtop)) __OTORP__(int origfd; int oldtop;){
/*@
assume oldtop>=0 && oldtop<sh.lim.open_max;
@*/
register int savefd;
int savefd;
/* see if already saved, only save once */
for(savefd=sh.topfd; --savefd>=oldtop; )
{
@ -752,7 +752,7 @@ void sh_iosave __PARAM__((register int origfd, int oldtop), (origfd, oldtop)) __
filemap[sh.topfd++].save_fd = savefd;
if(savefd >=0)
{
register Sfio_t* sp = sh.sftable[origfd];
Sfio_t* sp = sh.sftable[origfd];
/* make saved file close-on-exec */
fcntl(savefd,F_SETFD,FD_CLOEXEC);
if(origfd==job.fd)
@ -777,7 +777,7 @@ void sh_iosave __PARAM__((register int origfd, int oldtop), (origfd, oldtop)) __
* close all saved file descriptors
*/
void sh_iounsave __PARAM__((void), ()){
register int fd, savefd, newfd;
int fd, savefd, newfd;
for(newfd=fd=0; fd < sh.topfd; fd++)
{
if((savefd = filemap[fd].save_fd)< 0)
@ -795,7 +795,7 @@ void sh_iounsave __PARAM__((void), ()){
* restore saved file descriptors from <last> on
*/
void sh_iorestore __PARAM__((int last), (last)) __OTORP__(int last;){
register int origfd, savefd, fd;
int origfd, savefd, fd;
for (fd = sh.topfd - 1; fd >= last; fd--)
{
origfd = filemap[fd].orig_fd;
@ -830,8 +830,8 @@ void sh_iorestore __PARAM__((int last), (last)) __OTORP__(int last;){
* returns -1 for failure, 0 for success
* <mode> is the same as for access()
*/
sh_ioaccess __PARAM__((int fd,register int mode), (fd, mode)) __OTORP__(int fd;register int mode;){
register int flags;
sh_ioaccess __PARAM__((int fd,int mode), (fd, mode)) __OTORP__(int fd;int mode;){
int flags;
if(mode==X_OK)
return(-1);
if((flags=sh_iocheckfd(fd))!=IOCLOSE)
@ -852,8 +852,8 @@ sh_ioaccess __PARAM__((int fd,register int mode), (fd, mode)) __OTORP__(int fd;r
* 0 returned on error
*/
static int str2inet __PARAM__((register const char *sp, struct sockaddr_in *addr), (sp, addr)) __OTORP__(register const char *sp; struct sockaddr_in *addr;){
register int n=0,c,v;
static int str2inet __PARAM__((const char *sp, struct sockaddr_in *addr), (sp, addr)) __OTORP__(const char *sp; struct sockaddr_in *addr;){
int n=0,c,v;
unsigned long a=0;
unsigned short p;
@ -883,8 +883,8 @@ static int str2inet __PARAM__((register const char *sp, struct sockaddr_in *addr
/*
* Handle interrupts for slow streams
*/
static int slowexcept __PARAM__((register Sfio_t *iop, int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(register Sfio_t *iop; int type; Sfdisc_t *handle;){
register int n,fno;
static int slowexcept __PARAM__((Sfio_t *iop, int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop; int type; Sfdisc_t *handle;){
int n,fno;
NOT_USED(handle);
if(type!=SF_READ)
return(0);
@ -949,7 +949,7 @@ static void time_grace __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handl
sh.trapnote |= SH_SIGTRAP;
}
static int piperead __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;register int size;Sfdisc_t *handle;){
static int piperead __PARAM__((Sfio_t *iop,__V_ *buff,int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;int size;Sfdisc_t *handle;){
NOT_USED(handle);
size = ed_read(sffileno(iop), (char*)buff, size);
return(size);
@ -958,7 +958,7 @@ static int piperead __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t
* This is the read discipline that is applied to slow devices
* This routine takes care of prompting for input
*/
static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;register int size;Sfdisc_t *handle;){
static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;int size;Sfdisc_t *handle;){
int (*readf) __PROTO__((int, char*, int));
NOT_USED(handle);
if(io_prompt(sh.nextprompt)<0 && errno==EIO)
@ -987,8 +987,8 @@ static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t
* check and return the attributes for a file descriptor
*/
int sh_iocheckfd __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
register int flags, n;
int sh_iocheckfd __PARAM__((int fd), (fd)) __OTORP__(int fd;){
int flags, n;
if((n=sh.fdstatus[fd])&IOCLOSE)
return(n);
if(!(n&(IOREAD|IOWRITE)))
@ -1051,8 +1051,8 @@ int sh_iocheckfd __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
* Display prompt PS<flag> on standard error
*/
static int io_prompt __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){
register char *cp;
static int io_prompt __PARAM__((int flag), (flag)) __OTORP__(int flag;){
char *cp;
char *endprompt;
static short cmdno;
int sfflags;
@ -1067,7 +1067,7 @@ static int io_prompt __PARAM__((register int flag), (flag)) __OTORP__(register i
{
case 1:
{
register int c;
int c;
#if defined(TIOCLBIC) && defined(LFLUSHO)
if(!sh_isoption(SH_VI|SH_EMACS|SH_GMACS))
{
@ -1133,9 +1133,9 @@ static int pipeexcept __PARAM__((Sfio_t* iop, int mode, Sfdisc_t* handle), (iop,
* keep track of each stream that is opened and closed
*/
static void sftrack __PARAM__((Sfio_t* sp,int flag, int newfd), (sp, flag, newfd)) __OTORP__(Sfio_t* sp;int flag; int newfd;){
register int fd = sffileno(sp);
register struct checkpt *pp;
register int mode;
int fd = sffileno(sp);
struct checkpt *pp;
int mode;
if(flag==SF_SETFD && newfd<0)
{
flag = SF_CLOSE;
@ -1224,9 +1224,9 @@ struct eval
* Create a stream consisting of a space separated argv[] list
*/
Sfio_t *sh_sfeval __PARAM__((register char *argv[]), (argv)) __OTORP__(register char *argv[];){
register Sfio_t *iop;
register char *cp;
Sfio_t *sh_sfeval __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
Sfio_t *iop;
char *cp;
if(argv[1])
cp = "";
else
@ -1234,7 +1234,7 @@ Sfio_t *sh_sfeval __PARAM__((register char *argv[]), (argv)) __OTORP__(register
iop = sfopen(NIL(Sfio_t*),(char*)cp,"s");
if(argv[1])
{
register struct eval *ep;
struct eval *ep;
if(!(ep = new_of(struct eval,0)))
return(NIL(Sfio_t*));
ep->disc = eval_disc;
@ -1251,9 +1251,9 @@ Sfio_t *sh_sfeval __PARAM__((register char *argv[]), (argv)) __OTORP__(register
*/
static int eval_exceptf __PARAM__((Sfio_t *iop,int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop;int type; Sfdisc_t *handle;){
register struct eval *ep = (struct eval*)handle;
register char *cp;
register int len;
struct eval *ep = (struct eval*)handle;
char *cp;
int len;
/* no more to do */
if(type!=SF_READ || !(cp = ep->argv[0]))
@ -1292,8 +1292,8 @@ static int eval_exceptf __PARAM__((Sfio_t *iop,int type, Sfdisc_t *handle), (iop
*/
static Sfio_t *subopen __PARAM__((Sfio_t* sp, off_t offset, long size), (sp, offset, size)) __OTORP__(Sfio_t* sp; off_t offset; long size;){
register struct subfile *disp;
register int fd = sffileno(sp);
struct subfile *disp;
int fd = sffileno(sp);
if(sfseek(sp,offset,SEEK_SET) <0)
return(NIL(Sfio_t*));
if(!(disp = (struct subfile*)malloc(sizeof(struct subfile)+IOBSIZE+1)))
@ -1310,8 +1310,8 @@ static Sfio_t *subopen __PARAM__((Sfio_t* sp, off_t offset, long size), (sp, off
/*
* read function for subfile discipline
*/
static int subread __PARAM__((Sfio_t* sp,__V_* buff,register int size,Sfdisc_t* handle), (sp, buff, size, handle)) __OTORP__(Sfio_t* sp;__V_* buff;register int size;Sfdisc_t* handle;){
register struct subfile *disp = (struct subfile*)handle;
static int subread __PARAM__((Sfio_t* sp,__V_* buff,int size,Sfdisc_t* handle), (sp, buff, size, handle)) __OTORP__(Sfio_t* sp;__V_* buff;int size;Sfdisc_t* handle;){
struct subfile *disp = (struct subfile*)handle;
NOT_USED(sp);
if(disp->left == 0)
return(0);
@ -1324,8 +1324,8 @@ static int subread __PARAM__((Sfio_t* sp,__V_* buff,register int size,Sfdisc_t*
/*
* exception handler for subfile discipline
*/
static int subexcept __PARAM__((Sfio_t* sp,register int mode, Sfdisc_t* handle), (sp, mode, handle)) __OTORP__(Sfio_t* sp;register int mode; Sfdisc_t* handle;){
register struct subfile *disp = (struct subfile*)handle;
static int subexcept __PARAM__((Sfio_t* sp,int mode, Sfdisc_t* handle), (sp, mode, handle)) __OTORP__(Sfio_t* sp;int mode; Sfdisc_t* handle;){
struct subfile *disp = (struct subfile*)handle;
if(mode==SF_CLOSE)
{
sfdisc(sp,SF_POPDISC);
@ -1342,8 +1342,8 @@ static int subexcept __PARAM__((Sfio_t* sp,register int mode, Sfdisc_t* handle),
* print a list of arguments in columns
*/
void sh_menu __PARAM__((Sfio_t *outfile,int argn,char *argv[]), (outfile, argn, argv)) __OTORP__(Sfio_t *outfile;int argn;char *argv[];){
register int i,j;
register char **arg;
int i,j;
char **arg;
int nrow, ncol=1, ndigits=1;
int fldsize, wsize = ed_window();
char *cp = nv_getval(nv_scoped(LINES));
@ -1397,8 +1397,8 @@ skip:
/*
* shell version of read() for user added builtins
*/
ssize_t sh_read __PARAM__((register int fd, __V_* buff, size_t n), (fd, buff, n)) __OTORP__(register int fd; __V_* buff; size_t n;){
register Sfio_t *sp;
ssize_t sh_read __PARAM__((int fd, __V_* buff, size_t n), (fd, buff, n)) __OTORP__(int fd; __V_* buff; size_t n;){
Sfio_t *sp;
if(sp=sh.sftable[fd])
return(sfread(sp,buff,n));
else
@ -1409,8 +1409,8 @@ ssize_t sh_read __PARAM__((register int fd, __V_* buff, size_t n), (fd, buff, n)
/*
* shell version of write() for user added builtins
*/
ssize_t sh_write __PARAM__((register int fd, const __V_* buff, size_t n), (fd, buff, n)) __OTORP__(register int fd; const __V_* buff; size_t n;){
register Sfio_t *sp;
ssize_t sh_write __PARAM__((int fd, const __V_* buff, size_t n), (fd, buff, n)) __OTORP__(int fd; const __V_* buff; size_t n;){
Sfio_t *sp;
if(sp=sh.sftable[fd])
return(sfwrite(sp,buff,n));
else
@ -1421,8 +1421,8 @@ ssize_t sh_write __PARAM__((register int fd, const __V_* buff, size_t n), (fd, b
/*
* shell version of lseek() for user added builtins
*/
off_t sh_seek __PARAM__((register int fd, off_t offset, int whence), (fd, offset, whence)) __OTORP__(register int fd; off_t offset; int whence;){
register Sfio_t *sp;
off_t sh_seek __PARAM__((int fd, off_t offset, int whence), (fd, offset, whence)) __OTORP__(int fd; off_t offset; int whence;){
Sfio_t *sp;
if(sp=sh.sftable[fd])
return(sfseek(sp,offset,whence));
else
@ -1430,8 +1430,8 @@ off_t sh_seek __PARAM__((register int fd, off_t offset, int whence), (fd, offset
}
#undef dup
int sh_dup __PARAM__((register int old), (old)) __OTORP__(register int old;){
register int fd = dup(old);
int sh_dup __PARAM__((int old), (old)) __OTORP__(int old;){
int fd = dup(old);
if(fd>=0)
sh.fdstatus[fd] = (sh.fdstatus[old]&~IOCLEX);
return(fd);

View file

@ -210,10 +210,10 @@ static Sfio_t *outfile;
* This is the SIGCLD interrupt routine
* When called with sig==0, it does a blocking wait
*/
static void job_waitsafe __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
register pid_t pid;
register struct process *pw;
register int flags;
static void job_waitsafe __PARAM__((int sig), (sig)) __OTORP__(int sig;){
pid_t pid;
struct process *pw;
int flags;
struct process dummy;
struct jobsave *jp;
int wstat;
@ -347,7 +347,7 @@ static void job_waitsafe __PARAM__((register int sig), (sig)) __OTORP__(register
* if lflag is set the switching driver message will not print
*/
void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){
register int ntry=0;
int ntry=0;
job.fd = JOBTTY;
signal(SIGCHLD,job_waitsafe);
@ -382,8 +382,8 @@ void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){
{
/* Get a controlling terminal and set process group */
/* This should have already been done by rlogin */
register int fd;
register char *ttynam;
int fd;
char *ttynam;
#ifndef SIGTSTP
setpgid(0,sh.pid);
#endif /*SIGTSTP */
@ -482,8 +482,8 @@ void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){
* restore tty driver and pgrp
*/
int job_close __PARAM__((void), ()){
register struct process *pw = job.pwlist;
register int count = 0, running = 0;
struct process *pw = job.pwlist;
int count = 0, running = 0;
if(possible && !job.jobcontrol)
return(0);
else if(!possible && (!sh_isstate(SH_MONITOR) || sh_isstate(SH_FORKED)))
@ -553,7 +553,7 @@ int job_close __PARAM__((void), ()){
return(0);
}
static void job_set __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){
static void job_set __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
/* save current terminal state */
tty_get(job.fd,&my_stty);
if(pw->p_flag&P_STTY)
@ -568,7 +568,7 @@ static void job_set __PARAM__((register struct process *pw), (pw)) __OTORP__(reg
#endif /* SIGTSTP */
}
static void job_reset __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){
static void job_reset __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
/* save the terminal state for current job */
#ifdef SIGTSTP
job_fgrp(pw,tcgetpgrp(job.fd));
@ -593,9 +593,9 @@ static void job_reset __PARAM__((register struct process *pw), (pw)) __OTORP__(r
*/
void job_bwait __PARAM__((char **jobs), (jobs)) __OTORP__(char **jobs;){
register char *job;
register struct process *pw;
register pid_t pid;
char *job;
struct process *pw;
pid_t pid;
if(*jobs==0)
job_wait((pid_t)-1);
else while(job = *jobs++)
@ -621,10 +621,10 @@ void job_bwait __PARAM__((char **jobs), (jobs)) __OTORP__(char **jobs;){
*/
int job_walk __PARAM__((Sfio_t *file,int (*fun)(struct process*,int),int arg,char *joblist[]), (file, fun, arg, joblist)) __OTORP__(Sfio_t *file;int (*fun)();int arg;char *joblist[];){
register struct process *pw = job.pwlist;
register int r = 0;
register char *jobid, **jobs=joblist;
register struct process *px;
struct process *pw = job.pwlist;
int r = 0;
char *jobid, **jobs=joblist;
struct process *px;
job_string = 0;
outfile = file;
by_number = 0;
@ -680,7 +680,7 @@ int job_walk __PARAM__((Sfio_t *file,int (*fun)(struct process*,int),int arg,cha
/*
* send signal <sig> to background process group if not disowned
*/
int job_terminate __PARAM__((register struct process *pw,register int sig), (pw, sig)) __OTORP__(register struct process *pw;register int sig;){
int job_terminate __PARAM__((struct process *pw,int sig), (pw, sig)) __OTORP__(struct process *pw;int sig;){
if(pw->p_pgrp && !(pw->p_flag&P_DISOWN))
job_kill(pw,sig);
return(0);
@ -693,11 +693,11 @@ int job_terminate __PARAM__((register struct process *pw,register int sig), (pw,
* flag JOB_PFLAG for process id(s) only
*/
int job_list __PARAM__((struct process *pw,register int flag), (pw, flag)) __OTORP__(struct process *pw;register int flag;){
register struct process *px = pw;
register int n;
register const char *msg;
register int msize;
int job_list __PARAM__((struct process *pw,int flag), (pw, flag)) __OTORP__(struct process *pw;int flag;){
struct process *px = pw;
int n;
const char *msg;
int msize;
if(!pw || pw->p_job<=0)
return(1);
if(pw->p_env != sh.jobenv)
@ -768,9 +768,9 @@ int job_list __PARAM__((struct process *pw,register int flag), (pw, flag)) __OTO
* get the process group given the job number
* This routine returns the process group number or -1
*/
static struct process *job_bystring __PARAM__((register char *ajob), (ajob)) __OTORP__(register char *ajob;){
register struct process *pw=job.pwlist;
register int c;
static struct process *job_bystring __PARAM__((char *ajob), (ajob)) __OTORP__(char *ajob;){
struct process *pw=job.pwlist;
int c;
if(*ajob++ != '%' || !pw)
return(NIL(struct process*));
c = *ajob;
@ -794,9 +794,9 @@ static struct process *job_bystring __PARAM__((register char *ajob), (ajob)) __O
* Kill a job or process
*/
int job_kill __PARAM__((register struct process *pw,register int sig), (pw, sig)) __OTORP__(register struct process *pw;register int sig;){
register pid_t pid;
register int r;
int job_kill __PARAM__((struct process *pw,int sig), (pw, sig)) __OTORP__(struct process *pw;int sig;){
pid_t pid;
int r;
const char *msg;
#ifdef SIGTSTP
int stopsig = (sig==SIGSTOP||sig==SIGTSTP||sig==SIGTTIN||sig==SIGTTOU);
@ -884,10 +884,10 @@ int job_kill __PARAM__((register struct process *pw,register int sig), (pw, sig)
*/
static struct process *job_byname __PARAM__((char *name), (name)) __OTORP__(char *name;){
register struct process *pw = job.pwlist;
register struct process *pz = 0;
register int *flag = 0;
register char *cp = name;
struct process *pw = job.pwlist;
struct process *pz = 0;
int *flag = 0;
char *cp = name;
int offset;
if(!sh.hist_ptr)
return(NIL(struct process*));
@ -917,10 +917,10 @@ static struct process *job_byname __PARAM__((char *name), (name)) __OTORP__(char
*/
void job_clear __PARAM__((void), ()){
register struct process *pw, *px;
register struct process *pwnext;
register int j = BYTE(sh.lim.child_max);
register struct jobsave *jp;
struct process *pw, *px;
struct process *pwnext;
int j = BYTE(sh.lim.child_max);
struct jobsave *jp;
for(pw=job.pwlist; pw; pw=pwnext)
{
pwnext = pw->p_nxtjob;
@ -954,8 +954,8 @@ void job_clear __PARAM__((void), ()){
*/
int job_post __PARAM__((pid_t pid, pid_t join), (pid, join)) __OTORP__(pid_t pid; pid_t join;){
register struct process *pw;
register History_t *hp = sh.hist_ptr;
struct process *pw;
History_t *hp = sh.hist_ptr;
sh.jobenv = sh.curenv;
if(job.toclear)
{
@ -1023,7 +1023,7 @@ int job_post __PARAM__((pid_t pid, pid_t join), (pid, join)) __OTORP__(pid_t pid
*/
static struct process *job_bypid __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){
register struct process *pw, *px;
struct process *pw, *px;
for(pw=job.pwlist; pw; pw=pw->p_nxtjob)
for(px=pw; px; px=px->p_nxtproc)
{
@ -1038,7 +1038,7 @@ static struct process *job_bypid __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t p
*/
static struct process *job_byjid __PARAM__((int jobid), (jobid)) __OTORP__(int jobid;){
register struct process *pw;
struct process *pw;
for(pw=job.pwlist;pw; pw = pw->p_nxtjob)
{
if(pw->p_job==jobid)
@ -1050,10 +1050,10 @@ static struct process *job_byjid __PARAM__((int jobid), (jobid)) __OTORP__(int j
/*
* print a signal message
*/
static void job_prmsg __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){
static void job_prmsg __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
if(pw->p_exit!=SIGINT && pw->p_exit!=SIGPIPE)
{
register const char *msg, *dump;
const char *msg, *dump;
msg = job_sigmsg((int)(pw->p_exit));
msg = ERROR_translate(msg,1);
if(pw->p_flag&P_COREDUMP)
@ -1075,9 +1075,9 @@ static void job_prmsg __PARAM__((register struct process *pw), (pw)) __OTORP__(r
* pid=-1 to wait for all runing processes
*/
void job_wait __PARAM__((register pid_t pid), (pid)) __OTORP__(register pid_t pid;){
register struct process *pw=0,*px;
register int jobid = 0;
void job_wait __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){
struct process *pw=0,*px;
int jobid = 0;
char intr = 0;
if(pid <= 0)
{
@ -1230,8 +1230,8 @@ done:
* disown job if bgflag == 'd'
*/
job_switch __PARAM__((register struct process *pw,int bgflag), (pw, bgflag)) __OTORP__(register struct process *pw;int bgflag;){
register const char *msg;
job_switch __PARAM__((struct process *pw,int bgflag), (pw, bgflag)) __OTORP__(struct process *pw;int bgflag;){
const char *msg;
if(!pw || !(pw=job_byjid((int)pw->p_job)))
return(1);
if(bgflag=='d')
@ -1276,7 +1276,7 @@ job_switch __PARAM__((register struct process *pw,int bgflag), (pw, bgflag)) __O
* Set the foreground group associated with a job
*/
static void job_fgrp __PARAM__((register struct process *pw, int newgrp), (pw, newgrp)) __OTORP__(register struct process *pw; int newgrp;){
static void job_fgrp __PARAM__((struct process *pw, int newgrp), (pw, newgrp)) __OTORP__(struct process *pw; int newgrp;){
for(; pw; pw=pw->p_nxtproc)
pw->p_fgrp = newgrp;
}
@ -1285,9 +1285,9 @@ static void job_fgrp __PARAM__((register struct process *pw, int newgrp), (pw, n
* turn off STOP state of a process group and send CONT signals
*/
static void job_unstop __PARAM__((register struct process *px), (px)) __OTORP__(register struct process *px;){
register struct process *pw;
register int num = 0;
static void job_unstop __PARAM__((struct process *px), (px)) __OTORP__(struct process *px;){
struct process *pw;
int num = 0;
for(pw=px ;pw ;pw=pw->p_nxtproc)
{
if(pw->p_flag&P_STOPPED)
@ -1313,8 +1313,8 @@ static void job_unstop __PARAM__((register struct process *px), (px)) __OTORP__(
* if <notify> is non-zero, then jobs with pending notifications are unposted
*/
static struct process *job_unpost __PARAM__((register struct process *pwtop,int notify), (pwtop, notify)) __OTORP__(register struct process *pwtop;int notify;){
register struct process *pw;
static struct process *job_unpost __PARAM__((struct process *pwtop,int notify), (pwtop, notify)) __OTORP__(struct process *pwtop;int notify;){
struct process *pw;
/* make sure all processes are done */
#ifdef DEBUG
sfprintf(sfstderr,"%ld: unpost pid=%ld\n",(long)getpid(),(long)pwtop->p_pid);
@ -1361,8 +1361,8 @@ static struct process *job_unpost __PARAM__((register struct process *pwtop,int
/*
* unlink a job form the job list
*/
static void job_unlink __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){
register struct process *px;
static void job_unlink __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
struct process *px;
if(pw==job.pwlist)
{
job.pwlist = pw->p_nxtjob;
@ -1383,15 +1383,15 @@ static void job_unlink __PARAM__((register struct process *pw), (pw)) __OTORP__(
*/
static int job_alloc __PARAM__((void), ()){
register int j=0;
register unsigned mask = 1;
register unsigned char *freeword;
register int jmax = BYTE(sh.lim.child_max);
int j=0;
unsigned mask = 1;
unsigned char *freeword;
int jmax = BYTE(sh.lim.child_max);
/* skip to first word with a free slot */
for(j=0;job.freejobs[j] == UCHAR_MAX; j++);
if(j >= jmax)
{
register struct process *pw;
struct process *pw;
for(j=1; j < sh.lim.child_max; j++)
{
if((pw=job_byjid(j))&& !job_unpost(pw,0))
@ -1412,9 +1412,9 @@ static int job_alloc __PARAM__((void), ()){
* return a job number
*/
static void job_free __PARAM__((register int n), (n)) __OTORP__(register int n;){
register int j = (--n)/CHAR_BIT;
register unsigned mask;
static void job_free __PARAM__((int n), (n)) __OTORP__(int n;){
int j = (--n)/CHAR_BIT;
unsigned mask;
n -= j*CHAR_BIT;
mask = 1 << n;
job.freejobs[j] &= ~mask;
@ -1442,9 +1442,9 @@ static char *job_sigmsg __PARAM__((int sig), (sig)) __OTORP__(int sig;){
* if pid==0, then oldest saved process is deleted
* If pid is not found a -1 is returned.
*/
int job_chksave __PARAM__((register pid_t pid), (pid)) __OTORP__(register pid_t pid;){
register struct jobsave *jp = bck_list, *jpold=0;
register int r= -1;
int job_chksave __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){
struct jobsave *jp = bck_list, *jpold=0;
int r= -1;
while(jp)
{
if(jp->pid==pid)

View file

@ -199,7 +199,7 @@ static void refvar __PARAM__((int type), (type)) __OTORP__(int type;){
* This routine gets called when reading across a buffer boundary
* If lexd.nocopy is off, then current token is saved on the stack
*/
static void lex_advance __PARAM__((Sfio_t *iop, const char *buff, register int size), (iop, buff, size)) __OTORP__(Sfio_t *iop; const char *buff; register int size;){
static void lex_advance __PARAM__((Sfio_t *iop, const char *buff, int size), (iop, buff, size)) __OTORP__(Sfio_t *iop; const char *buff; int size;){
#ifdef KSHELL
/* write to history file and to stderr if necessary */
if(!sfstacked(iop))
@ -234,7 +234,7 @@ static void lex_advance __PARAM__((Sfio_t *iop, const char *buff, register int s
* preserves lexical state
*/
static int lexfill __PARAM__((void), ()){
register int c;
int c;
struct lexdata savedata;
struct lexstate savestate;
savedata = lexd;
@ -264,10 +264,10 @@ void sh_lexinit __PARAM__((int mode), (mode)) __OTORP__(int mode;){
#ifdef DBUG
int sh_lex __PARAM__((void), ()){
register int flag;
int flag;
extern __MANGLE__ int lextoken __PROTO__((void));
char *quoted, *macro, *split, *expand;
register int tok = lextoken();
int tok = lextoken();
quoted = macro = split = expand = "";
if(tok==0 && (flag=shlex.arg->argflag))
{
@ -326,8 +326,8 @@ static void mbStateSkip __PARAM__((const char *state, int *c, int *n, int *len),
* Returns the token type
*/
int sh_lex __PARAM__((void), ()){
register const char *state;
register int n, c, mode=ST_BEGIN, wordflags=0;
const char *state;
int n, c, mode=ST_BEGIN, wordflags=0;
int len, inlevel=lexd.level, assignment=0, ingrave=0;
Sfio_t *sp;
if(lexd.paren)
@ -1283,8 +1283,8 @@ breakloop:
* read to end of command substitution
*/
static int comsub __PARAM__((void), ()){
register int n,c,count=1;
register int line=sh.inlineno;
int n,c,count=1;
int line=sh.inlineno;
char word[5];
int messages=0;
struct lexstate save;
@ -1355,8 +1355,8 @@ done:
* allocate ionode with delimiter filled in without disturbing stak
*/
static void nested_here __PARAM__((void), ()){
register struct ionod *iop;
register int n,offset;
struct ionod *iop;
int n,offset;
struct argnod *arg = shlex.arg;
char *base;
if(offset=staktell())
@ -1386,8 +1386,8 @@ static void nested_here __PARAM__((void), ()){
* if <copy> is non,zero, then the characters are copied to the stack
* <state> is the initial lexical state
*/
void sh_lexskip __PARAM__((int close, register int copy, int state), (close, copy, state)) __OTORP__(int close; register int copy; int state;){
register char *cp;
void sh_lexskip __PARAM__((int close, int copy, int state), (close, copy, state)) __OTORP__(int close; int copy; int state;){
char *cp;
lexd.nest = close;
lex_state = state;
lexd.nocopy += !copy;
@ -1411,11 +1411,11 @@ void sh_lexskip __PARAM__((int close, register int copy, int state), (close, co
* returns 1 for complete here-doc, 0 for EOF
*/
static int here_copy __PARAM__((register struct ionod *iop), (iop)) __OTORP__(register struct ionod *iop;){
register const char *state;
register int c,n;
register char *bufp,*cp;
register Sfio_t *sp;
static int here_copy __PARAM__((struct ionod *iop), (iop)) __OTORP__(struct ionod *iop;){
const char *state;
int c,n;
char *bufp,*cp;
Sfio_t *sp;
int stripflg, nsave, special=0;
if(iop->iolst)
here_copy(iop->iolst);
@ -1593,7 +1593,7 @@ done:
/*
* generates string for given token
*/
static char *fmttoken __PARAM__((register int sym), (sym)) __OTORP__(register int sym;){
static char *fmttoken __PARAM__((int sym), (sym)) __OTORP__(int sym;){
static char tok[3];
if(sym < 0)
return((char*)e_lexzerobyte);
@ -1601,7 +1601,7 @@ static char *fmttoken __PARAM__((register int sym), (sym)) __OTORP__(register in
return(shlex.arg?shlex.arg->argval:"?");
if(sym&SYMRES)
{
register const Shtable_t *tp=shtab_reserved;
const Shtable_t *tp=shtab_reserved;
while(tp->sh_number && tp->sh_number!=sym)
tp++;
return((char*)tp->sh_name);
@ -1652,9 +1652,9 @@ static char *fmttoken __PARAM__((register int sym), (sym)) __OTORP__(register in
*/
void sh_syntax __PARAM__((void), ()){
register const char *cp = e_unexpected;
register int tok = shlex.token;
register char *tokstr;
const char *cp = e_unexpected;
int tok = shlex.token;
char *tokstr;
Sfio_t *sp;
if((tok==EOFSYM) && shlex.lasttok)
{
@ -1667,7 +1667,7 @@ void sh_syntax __PARAM__((void), ()){
if((sp=fcfile()) || (sh.infd>=0 && (sp=sh.sftable[sh.infd])))
{
/* clear out any pending input */
register Sfio_t *top;
Sfio_t *top;
while(fcget()>0);
fcclose();
while(top=sfstack(sp,SF_POPSTACK))
@ -1696,10 +1696,10 @@ void sh_syntax __PARAM__((void), ()){
* If mode==2, the each $"" string is printed on standard output
*/
struct argnod *sh_endword __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register const char *state = sh_lexstates[ST_NESTED];
register int n;
register char *sp,*dp;
register int inquote=0, inlit=0; /* set within quoted strings */
const char *state = sh_lexstates[ST_NESTED];
int n;
char *sp,*dp;
int inquote=0, inlit=0; /* set within quoted strings */
struct argnod* argp;
char *ep=0;
int offset = staktell();
@ -1901,8 +1901,8 @@ struct alias
* This code gets called whenever an end of string is found with alias
*/
static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop;int type;Sfdisc_t *handle;){
register struct alias *ap = (struct alias*)handle;
register Namval_t *np;
struct alias *ap = (struct alias*)handle;
Namval_t *np;
static char buf[2];
if(type==0 || !ap)
return(0);
@ -1911,7 +1911,7 @@ static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop
{
if(type==SF_CLOSE)
{
register Sfdisc_t *dp = sfdisc(iop,SF_POPDISC);
Sfdisc_t *dp = sfdisc(iop,SF_POPDISC);
if(dp!=handle)
sfdisc(iop,dp);
else if(ap)
@ -1922,7 +1922,7 @@ static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop
if(ap->nextc)
{
/* if last character is a blank, then next work can be alias */
register int c = fcpeek(-1);
int c = fcpeek(-1);
if(isblank(c))
shlex.aliasok = 1;
*buf = ap->nextc;
@ -1938,7 +1938,7 @@ done:
static void setupalias __PARAM__((const char *string,Namval_t *np), (string, np)) __OTORP__(const char *string;Namval_t *np;){
register Sfio_t *iop, *base;
Sfio_t *iop, *base;
struct alias *ap = (struct alias*)malloc(sizeof(struct alias));
ap->disc = alias_disc;
iop = sfopen(NIL(Sfio_t*),(char*)string,"s");

View file

@ -161,7 +161,7 @@ static char *mac_getstring __PROTO__((char*));
/*
* perform only parameter substitution and catch failures
*/
char *sh_mactry __PARAM__((register char *string), (string)) __OTORP__(register char *string;){
char *sh_mactry __PARAM__((char *string), (string)) __OTORP__(char *string;){
if(string)
{
int jmp_val;
@ -183,7 +183,7 @@ char *sh_mactry __PARAM__((register char *string), (string)) __OTORP__(register
* yields a single pathname.
* If <mode> negative, than expansion rules for assignment are applied.
*/
char *sh_mactrim __PARAM__((char *str, register int mode), (str, mode)) __OTORP__(char *str; register int mode;){
char *sh_mactrim __PARAM__((char *str, int mode), (str, mode)) __OTORP__(char *str; int mode;){
struct _mac_ savemac;
savemac = mac;
stakseek(0);
@ -217,9 +217,9 @@ char *sh_mactrim __PARAM__((char *str, register int mode), (str, mode)) __OTORP_
/*
* Perform all the expansions on the argument <argp>
*/
int sh_macexpand __PARAM__((register struct argnod *argp, struct argnod **arghead), (argp, arghead)) __OTORP__(register struct argnod *argp; struct argnod **arghead;){
register int flags = argp->argflag;
register char *str = argp->argval;
int sh_macexpand __PARAM__((struct argnod *argp, struct argnod **arghead), (argp, arghead)) __OTORP__(struct argnod *argp; struct argnod **arghead;){
int flags = argp->argflag;
char *str = argp->argval;
struct _mac_ savemac;
savemac = mac;
stakseek(ARGVAL);
@ -248,9 +248,9 @@ int sh_macexpand __PARAM__((register struct argnod *argp, struct argnod **arghea
* The result is written to <outfile>
*/
void sh_machere __PARAM__((Sfio_t *infile, Sfio_t *outfile, char *string), (infile, outfile, string)) __OTORP__(Sfio_t *infile; Sfio_t *outfile; char *string;){
register int c,n;
register const char *state = sh_lexstates[ST_QUOTE];
register char *cp;
int c,n;
const char *state = sh_lexstates[ST_QUOTE];
char *cp;
Fcin_t save;
struct _mac_ savemac;
savemac = mac;
@ -353,9 +353,9 @@ void sh_machere __PARAM__((Sfio_t *infile, Sfio_t *outfile, char *string), (infi
* Process the characters up to <endch> or end of input string
*/
static void copyto __PARAM__((int endch, int newquote), (endch, newquote)) __OTORP__(int endch; int newquote;){
register int c,n;
register const char *state = sh_lexstates[ST_MACRO];
register char *cp,*first;
int c,n;
const char *state = sh_lexstates[ST_MACRO];
char *cp,*first;
int tilde = -1;
int oldquote = mac.quote;
int ansi_c = 0;
@ -566,7 +566,7 @@ done:
* This will be in libast some day
*/
static int strgrpmatch __PARAM__((char *string, char *pattern, int match[], int nmatch,int flags), (string, pattern, match, nmatch, flags)) __OTORP__(char *string; char *pattern; int match[]; int nmatch;int flags;){
register char *cp=string, *dp;
char *cp=string, *dp;
int c=0,anchor = (flags&STR_LEFT);
flags &= ~STR_LEFT;
/* optimize a little */
@ -607,9 +607,9 @@ static int strgrpmatch __PARAM__((char *string, char *pattern, int match[], int
/*
* copy <str> to stack performing sub-expression substitutions
*/
static void mac_substitute __PARAM__((register char *cp,char *str,register int subexp[],int subsize), (cp, str, subexp, subsize)) __OTORP__(register char *cp;char *str;register int subexp[];int subsize;){
register int c,n;
register char *first=cp;
static void mac_substitute __PARAM__((char *cp,char *str,int subexp[],int subsize), (cp, str, subexp, subsize)) __OTORP__(char *cp;char *str;int subexp[];int subsize;){
int c,n;
char *first=cp;
while(1)
{
while((c= *cp++) && c!=ESCAPE);
@ -644,11 +644,11 @@ static void mac_substitute __PARAM__((register char *cp,char *str,register int s
*/
static int varsub __PARAM__((void), ()){
static char idbuff[2];
register int c;
register int type=0; /* M_xxx */
register char *v,*argp=0;
register Namval_t *np = NIL(Namval_t*);
register int dolg=0, mode=0;
int c;
int type=0; /* M_xxx */
char *v,*argp=0;
Namval_t *np = NIL(Namval_t*);
int dolg=0, mode=0;
Namarr_t *ap=0;
int dolmax=0, vsize= -1, offset, nulflg, replen=0, bysub=0;
char *id = idbuff, *pattern=0, *repstr;
@ -711,7 +711,7 @@ retry1:
c -= '0';
if(type)
{
register int d;
int d;
while((d=fcget()),isadigit(d))
c = 10*c + (d-'0');
fcseek(-1);
@ -1023,7 +1023,7 @@ retry1:
retry2:
if(v && (!nulflg || *v ) && c!='+')
{
register int d = (mode=='@'?' ':mac.ifs);
int d = (mode=='@'?' ':mac.ifs);
int match[20], nmatch;
while(1)
{
@ -1156,8 +1156,8 @@ nosub:
* <type> is 0 for older `...` version
*/
static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
register int c;
register char *str;
int c;
char *str;
Sfio_t *sp;
Fcin_t save;
struct slnod *saveslp = sh.st.staklist;
@ -1167,7 +1167,7 @@ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
char *savptr = stakfreeze(0);
int saveflags = sh_isstate(SH_HISTORY|SH_VERBOSE);
int newlines;
register union anynode *t;
union anynode *t;
savemac = mac;
sh.st.staklist=0;
if(type)
@ -1228,7 +1228,7 @@ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
if(t->tre.tretyp==0 && !t->com.comarg)
{
/* special case $( < file) */
register int fd;
int fd;
struct checkpt buff;
sh_pushcontext(&buff,SH_JMPIO);
if(t->tre.treio && !(((t->tre.treio)->iofile)&IOUFD) &&
@ -1279,10 +1279,10 @@ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
/*
* copy <str> onto the stack
*/
static void mac_copy __PARAM__((register const char *str, register int size), (str, size)) __OTORP__(register const char *str; register int size;){
register char *state;
register const char *cp=str;
register int c,n,nopat;
static void mac_copy __PARAM__((const char *str, int size), (str, size)) __OTORP__(const char *str; int size;){
char *state;
const char *cp=str;
int c,n,nopat;
nopat = (mac.quote||mac.assign==1||mac.arith);
if(mac.sp)
sfwrite(mac.sp,str,size);
@ -1403,7 +1403,7 @@ static void mac_copy __PARAM__((register const char *str, register int size), (s
* Do filename expansion of required
*/
static void endfield __PARAM__((int split), (split)) __OTORP__(int split;){
register struct argnod *argp;
struct argnod *argp;
if(staktell() > ARGVAL || split)
{
argp = (struct argnod*)stakfreeze(1);
@ -1432,9 +1432,9 @@ static void endfield __PARAM__((int split), (split)) __OTORP__(int split;){
* Finds the right substring of STRING using the expression PAT
* the longest substring is found when FLAG is set.
*/
static int substring __PARAM__((register const char *string,const char *pat,int match[], int flag), (string, pat, match, flag)) __OTORP__(register const char *string;const char *pat;int match[]; int flag;){
register const char *sp=string;
register int size,len,nmatch,n;
static int substring __PARAM__((const char *string,const char *pat,int match[], int flag), (string, pat, match, flag)) __OTORP__(const char *string;const char *pat;int match[]; int flag;){
const char *sp=string;
int size,len,nmatch,n;
int smatch[20];
sp += (len=strlen(sp));
size = sp-string;
@ -1467,8 +1467,8 @@ static int substring __PARAM__((register const char *string,const char *pat,int
#ifdef SHOPT_MULTIBYTE
static char *lastchar __PARAM__((const char *string, const char *endstring), (string, endstring)) __OTORP__(const char *string; const char *endstring;){
register char *str = (char*)string;
register int c;
char *str = (char*)string;
int c;
mblen(NIL(char*),MB_CUR_MAX);
while(*str)
{
@ -1481,9 +1481,9 @@ static int substring __PARAM__((register const char *string,const char *pat,int
return(str);
}
static int charlen __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register const char *str = string;
register int n=0;
register int c;
const char *str = string;
int n=0;
int c;
wchar_t w;
mblen(NIL(char*),MB_CUR_MAX);
while(*str)
@ -1504,8 +1504,8 @@ static int substring __PARAM__((register const char *string,const char *pat,int
* <offset> is byte offset for beginning of tilde string
*/
static void tilde_expand2 __PARAM__((register int offset), (offset)) __OTORP__(register int offset;){
register char *cp;
static void tilde_expand2 __PARAM__((int offset), (offset)) __OTORP__(int offset;){
char *cp;
int curoff = staktell();
stakputc(0);
if(cp = sh_tilde(stakptr(offset)))
@ -1526,11 +1526,11 @@ static void tilde_expand2 __PARAM__((register int offset), (offset)) __OTORP__(r
* If string doesn't start with ~ or ~... not found then 0 returned.
*/
static char *sh_tilde __PARAM__((register const char *string), (string)) __OTORP__(register const char *string;){
register char *cp;
register int c;
register struct passwd *pw;
register Namval_t *np;
static char *sh_tilde __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
char *cp;
int c;
struct passwd *pw;
Namval_t *np;
static Hashtab_t *logins_tree;
if(*string++!='~')
return(NIL(char*));
@ -1562,8 +1562,8 @@ static char *sh_tilde __PARAM__((register const char *string), (string)) __OTORP
/*
* return values for special macros
*/
static char *special __PARAM__((register int c), (c)) __OTORP__(register int c;){
register Namval_t *np;
static char *special __PARAM__((int c), (c)) __OTORP__(int c;){
Namval_t *np;
switch(c)
{
case '@':
@ -1605,8 +1605,8 @@ static void mac_error __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
* \ characters are stripped from string.
*/
static char *mac_getstring __PARAM__((char *pattern), (pattern)) __OTORP__(char *pattern;){
register char *cp = pattern;
register int c;
char *cp = pattern;
int c;
while(c = *cp++)
{
if(c==ESCAPE)
@ -1625,8 +1625,8 @@ static char *mac_getstring __PARAM__((char *pattern), (pattern)) __OTORP__(char
*/
static char *nextname __PARAM__((const char *prefix, int len), (prefix, len)) __OTORP__(const char *prefix; int len;){
static Hashpos_t *hp;
register Namval_t *np;
register char *cp;
Namval_t *np;
char *cp;
if(!prefix)
hp = hashscan(sh.var_tree,0);
else if(hp)

View file

@ -130,7 +130,7 @@ static time_t mailtime;
static char beenhere = 0;
#ifdef _lib_sigvec
void clearsigmask __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
void clearsigmask __PARAM__((int sig), (sig)) __OTORP__(int sig;){
struct sigvec vec;
if(sigvec(sig,NIL(struct sigvec*),&vec)>=0 && vec.sv_mask)
{
@ -141,10 +141,10 @@ static char beenhere = 0;
#endif /* _lib_sigvec */
main __PARAM__((int ac, char *av[]), (ac, av)) __OTORP__(int ac; char *av[];){
register char *name;
register int fdin;
register Sfio_t *iop;
register int rshflag; /* set for restricted shell */
char *name;
int fdin;
Sfio_t *iop;
int rshflag; /* set for restricted shell */
struct checkpt buff;
int prof;
char *command;
@ -322,7 +322,7 @@ main __PARAM__((int ac, char *av[]), (ac, av)) __OTORP__(int ac; char *av[];){
* fdin is the input file descriptor
*/
static void exfile __PARAM__((register Sfio_t *iop,register int fno), (iop, fno)) __OTORP__(register Sfio_t *iop;register int fno;){
static void exfile __PARAM__((Sfio_t *iop,int fno), (iop, fno)) __OTORP__(Sfio_t *iop;int fno;){
time_t curtime;
union anynode *t;
int maxtry=IOMAXTRY, tdone=0, execflags;
@ -412,7 +412,7 @@ static void exfile __PARAM__((register Sfio_t *iop,register int fno), (iop, fno)
sh_offstate(SH_INTERACTIVE|SH_ERREXIT|SH_MONITOR);
if(sh_isstate(SH_INTERACTIVE) && !tdone)
{
register char *mail;
char *mail;
#ifdef JOBS
sh_offstate(SH_MONITOR);
sh_onstate(sh_isoption(SH_MONITOR));
@ -529,8 +529,8 @@ done:
/* prints out messages if files in list have been modified since last call */
static void chkmail __PARAM__((char *files), (files)) __OTORP__(char *files;){
register char *cp,*sp,*qp;
register char save;
char *cp,*sp,*qp;
char save;
struct argnod *arglist=0;
int offset = staktell();
char *savstak=stakptr(0);
@ -626,7 +626,7 @@ static void fixargs __PARAM__((char **argv, int mode), (argv, mode)) __OTORP__(c
#else
static char *buff;
static int command_len;
register char *cp;
char *cp;
int offset=0,size;
# ifdef PSTAT
union pstun un;

View file

@ -230,9 +230,9 @@ void mirror_env __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;)
* Perform parameter assignment for a linked list of parameters
* <flags> contains attributes for the parameters
*/
void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg, flags)) __OTORP__(register struct argnod *arg;register int flags;){
register char *cp;
register Namval_t *np;
void nv_setlist __PARAM__((struct argnod *arg,int flags), (arg, flags)) __OTORP__(struct argnod *arg;int flags;){
char *cp;
Namval_t *np;
int traceon = (sh_isoption(SH_XTRACE)!=0);
if(sh_isoption(SH_ALLEXPORT))
flags |= NV_EXPORT;
@ -253,7 +253,7 @@ void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg
{
int flag = (NV_VARNAME|NV_ARRAY|NV_ASSIGN);
struct fornod *fp=(struct fornod*)arg->argchn.ap;
register union anynode *tp=fp->fortre;
union anynode *tp=fp->fortre;
char *prefix = sh.prefix;
cp = fp->fornam;
error_info.line = fp->fortyp-sh.st.firstline;
@ -303,7 +303,7 @@ void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg
np->nvsize &= ~NV_PARAM;
if(traceon)
{
register char *sp=cp;
char *sp=cp;
sh_trace(NIL(char**),0);
sfputr(sfstderr,nv_name(np),-1);
if(nv_isattr(np,NV_ARRAY) && (cp=strchr(sp,'[')))
@ -324,8 +324,8 @@ void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg
/*
* construct a new name from a prefix and base name on the stack
*/
static char *newname __PARAM__((register const char *prefix, register const char *name), (prefix, name)) __OTORP__(register const char *prefix; register const char *name;){
register int offset = staktell();
static char *newname __PARAM__((const char *prefix, const char *name), (prefix, name)) __OTORP__(const char *prefix; const char *name;){
int offset = staktell();
stakputs(prefix);
if(*name!='[')
stakputc('.');
@ -346,11 +346,11 @@ static char *newname __PARAM__((register const char *prefix, register const char
* SH_INIT is only set while initializing the environment
*/
Namval_t *nv_open __PARAM__((const char *name,Hashtab_t *root,int flags), (name, root, flags)) __OTORP__(const char *name;Hashtab_t *root;int flags;){
register char *cp = (char*)name;
register Namval_t *np=0;
register int sep = *cp;
register char *lastdot = 0;
register long mode = ((flags&NV_NOADD)?0:NV_ADD);
char *cp = (char*)name;
Namval_t *np=0;
int sep = *cp;
char *lastdot = 0;
long mode = ((flags&NV_NOADD)?0:NV_ADD);
if(root==sh.alias_tree)
{
while((sep= *(unsigned char*)cp) && (sep!='=') && (sep!='/') &&
@ -552,12 +552,12 @@ failed:
* If <flags> contains NV_NOFREE, previous value is freed, and <string>
* becomes value of node and <flags> becomes attributes
*/
void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags), (np, string, flags)) __OTORP__(register Namval_t *np; const char *string; int flags;){
register const char *sp=string;
register union Value *up;
register char *cp;
register int size = 0;
register int dot;
void nv_putval __PARAM__((Namval_t *np, const char *string, int flags), (np, string, flags)) __OTORP__(Namval_t *np; const char *string; int flags;){
const char *sp=string;
union Value *up;
char *cp;
int size = 0;
int dot;
if(!(flags&NV_RDONLY) && nv_isattr (np, NV_RDONLY))
error(ERROR_exit(1),e_readonly, nv_name(np));
/* The following could cause the shell to fork if assignment
@ -686,7 +686,7 @@ void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags),
rightjust(cp,size,' ');
else if(nv_isattr(np, NV_LJUST))
{
register char *dp;
char *dp;
dp = strlen (cp) + cp;
*(cp = (cp + size)) = 0;
for (; dp < cp; *dp++ = ' ');
@ -722,8 +722,8 @@ void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags),
* will default to a blank.
*/
static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fill)) __OTORP__(char *str; int size; int fill;){
register int n;
register char *cp,*sp;
int n;
char *cp,*sp;
n = strlen(str);
/* ignore trailing blanks */
@ -765,8 +765,8 @@ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fil
*/
static int ja_size __PARAM__((char *str,int size,int type), (str, size, type)) __OTORP__(char *str;int size;int type;){
register char *cp = str;
register int c, n=size;
char *cp = str;
int c, n=size;
int oldn;
wchar_t w;
while(*cp)
@ -774,7 +774,7 @@ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fil
oldn = n;
if((c=mbtowc(&w,cp,MB_CUR_MAX))>0)
{
register int outsize = wcwidth(w);
int outsize = wcwidth(w);
/* allow room for excess input bytes */
n += (c-outsize);
size -= outsize;
@ -813,15 +813,15 @@ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fil
}
static void ja_restore __PARAM__((void), ()){
register char *cp = savechars;
char *cp = savechars;
while(*cp)
*savep++ = *cp++;
savep = 0;
}
#endif /* SHOPT_MULTIBYTE */
static char *staknam __PARAM__((register Namval_t *np, char *value), (np, value)) __OTORP__(register Namval_t *np; char *value;){
register char *p,*q;
static char *staknam __PARAM__((Namval_t *np, char *value), (np, value)) __OTORP__(Namval_t *np; char *value;){
char *p,*q;
q = stakalloc(strlen(nv_name(np))+(value?strlen(value):0)+2);
p=strcopy(q,nv_name(np));
if(value)
@ -835,8 +835,8 @@ static char *staknam __PARAM__((register Namval_t *np, char *value), (np, value)
/*
* put the name and attribute into value of attributes variable
*/
static void attstore __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register int flag = np->nvflag;
static void attstore __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
int flag = np->nvflag;
if(!(flag&NV_EXPORT) || (flag&NV_FUNCT))
return;
flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);
@ -850,7 +850,7 @@ static void attstore __PARAM__((register Namval_t *np), (np)) __OTORP__(register
}
static void pushnam __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register char *value;
char *value;
if(nv_isattr(np,NV_IMPORT))
{
if(np->nvenv)
@ -867,9 +867,9 @@ static void pushnam __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
*/
char **sh_envgen __PARAM__((void), ()){
register char **er;
register int namec;
register char *cp;
char **er;
int namec;
char *cp;
/* L_ARGNOD gets generated automatically as full path name of command */
nv_offattr(L_ARGNOD,NV_EXPORT);
attsize = 6;
@ -893,8 +893,8 @@ static int scanflags;
static int scancount = 0;
static int scanfilter __PARAM__((const char *name, char *arg, __V_ *notused), (name, arg, notused)) __OTORP__(const char *name; char *arg; __V_ *notused;){
register Namval_t *np = (Namval_t*)arg;
register int k=np->nvflag;
Namval_t *np = (Namval_t*)arg;
int k=np->nvflag;
NOT_USED(name);
NOT_USED(notused);
if(scanmask?(k&scanmask)==scanflags:(!scanflags || (k&scanflags)))
@ -935,7 +935,7 @@ int nv_scan __PARAM__((Hashtab_t *root, void (*fn)(Namval_t*), int mask, int fla
* create a new environment scope
*/
void nv_scope __PARAM__((struct argnod *envlist), (envlist)) __OTORP__(struct argnod *envlist;){
register Hashtab_t *newscope;
Hashtab_t *newscope;
newscope = hashalloc(sh.var_tree,HASH_set,HASH_SCOPE|HASH_ALLOCATE,0);
sh.var_tree = newscope;
nv_setlist(envlist,NV_EXPORT|NV_NOSCOPE|NV_IDENT|NV_ASSIGN);
@ -947,7 +947,7 @@ void nv_scope __PARAM__((struct argnod *envlist), (envlist)) __OTORP__(struct ar
* node, as well as its dope vector, if it is an array.
*/
void sh_envnolocal __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
void sh_envnolocal __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
if(nv_isattr(np,NV_EXPORT|NV_NOFREE))
{
if(nv_isattr(np,NV_REF))
@ -980,9 +980,9 @@ void nv_close __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
* by the value of <np>. If <np> denotes an array member, it
* will retain its attributes.
*/
void nv_unset __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register union Value *up = &np->nvalue;
register Namarr_t *ap;
void nv_unset __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
union Value *up = &np->nvalue;
Namarr_t *ap;
if(!forced && nv_isattr (np,NV_RDONLY))
error(ERROR_exit(1),e_readonly, nv_name(np));
if(sh.subshell && !nv_isnull(np))
@ -1032,7 +1032,7 @@ void nv_unset __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval
/*
* return the node pointer in the highest level scope
*/
Namval_t *nv_scoped __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
Namval_t *nv_scoped __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
if(hashscope(sh.var_tree))
return(nv_search((char*)np,sh.var_tree,HASH_BUCKET));
else
@ -1050,10 +1050,10 @@ Namval_t *nv_scoped __PARAM__((register Namval_t *np), (np)) __OTORP__(register
* If <np> has no value, 0 is returned.
*/
char *nv_getval __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register union Value *up= &np->nvalue;
register int numeric;
register Namarr_t *ap;
char *nv_getval __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
union Value *up= &np->nvalue;
int numeric;
Namarr_t *ap;
if(!np->nvfun && !nv_isattr(np,NV_ARRAY|NV_INTEGER|NV_FUNCT|NV_REF))
goto done;
if(ap = nv_arrayptr(np))
@ -1075,7 +1075,7 @@ char *nv_getval __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namv
}
if(numeric)
{
register long l;
long l;
if(!up->cp || nv_isattr (np,NV_CPOINTER))
return((char*)up->cp);
else if(nv_isattr (np,NV_DOUBLE))
@ -1105,10 +1105,10 @@ done:
return ((char*)up->cp);
}
double nv_getnum __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register union Value *up;
register double r=0;
register char *str;
double nv_getnum __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
union Value *up;
double r=0;
char *str;
if(np->nvfun)
{
if(!local)
@ -1140,10 +1140,10 @@ double nv_getnum __PARAM__((register Namval_t *np), (np)) __OTORP__(register Nam
* value to conform to <newatts>. The <size> of left and right
* justified fields may be given.
*/
void nv_newattr __PARAM__((register Namval_t *np, unsigned newatts, int size), (np, newatts, size)) __OTORP__(register Namval_t *np; unsigned newatts; int size;){
register char *sp;
register char *cp = 0;
register unsigned int n;
void nv_newattr __PARAM__((Namval_t *np, unsigned newatts, int size), (np, newatts, size)) __OTORP__(Namval_t *np; unsigned newatts; int size;){
char *sp;
char *cp = 0;
unsigned int n;
Namarr_t *ap = 0;
int oldsize,oldatts;
@ -1219,9 +1219,9 @@ void nv_newattr __PARAM__((register Namval_t *np, unsigned newatts, int size),
#ifndef _NEXT_SOURCE
static char *oldgetenv __PARAM__((const char *string), (string)) __OTORP__(const
char *string;){
register char c0,c1;
register const char *cp, *sp;
register char **av = environ;
char c0,c1;
const char *cp, *sp;
char **av = environ;
if(!string || (c0= *string)==0)
return(0);
if((c1= *++string)==0)
@ -1246,7 +1246,7 @@ static char *oldgetenv __PARAM__((const char *string), (string)) __OTORP__(const
* around the problems, others don't.
*/
char *ksh_getenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register Namval_t *np;
Namval_t *np;
if(!sh.var_tree)
return(oldgetenv(name));
if((np = nv_search(name,sh.var_tree,0)) && nv_isattr(np,NV_EXPORT))
@ -1266,7 +1266,7 @@ char *ksh_getenv __PARAM__((const char *name), (name)) __OTORP__(const char *nam
* no calls to this routine. - harry phinney 8/15/1994.
*/
int ksh_putenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register Namval_t *np;
Namval_t *np;
if(name)
{
np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN);
@ -1281,7 +1281,7 @@ int ksh_putenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;
* Override libast setenv()
*/
char* setenviron __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register Namval_t *np;
Namval_t *np;
if(name)
{
np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN);
@ -1298,8 +1298,8 @@ char* setenviron __PARAM__((const char *name), (name)) __OTORP__(const char *nam
* <str1> and <str2> may point to the same place.
*/
static void ltou __PARAM__((register char const *str1,register char *str2), (str1, str2)) __OTORP__(register char const *str1;register char *str2;){
register int c;
static void ltou __PARAM__((char const *str1,char *str2), (str1, str2)) __OTORP__(char const *str1;char *str2;){
int c;
for(; c= *((unsigned char*)str1); str1++,str2++)
{
if(islower(c))
@ -1316,8 +1316,8 @@ static void ltou __PARAM__((register char const *str1,register char *str2), (str
* <str1> and <str2> may point to the same place.
*/
static void utol __PARAM__((register char const *str1,register char *str2), (str1, str2)) __OTORP__(register char const *str1;register char *str2;){
register int c;
static void utol __PARAM__((char const *str1,char *str2), (str1, str2)) __OTORP__(char const *str1;char *str2;){
int c;
for(; c= *((unsigned char*)str1); str1++,str2++)
{
if(isupper(c))
@ -1333,8 +1333,8 @@ static void utol __PARAM__((register char const *str1,register char *str2), (str
* <fp> is null to pop, otherwise, <fp> is pushed onto stack
* The top of the stack is returned
*/
Namfun_t *nv_stack __PARAM__((register Namval_t *np, register Namfun_t* fp), (np, fp)) __OTORP__(register Namval_t *np; register Namfun_t* fp;){
register Namfun_t *lp;
Namfun_t *nv_stack __PARAM__((Namval_t *np, Namfun_t* fp), (np, fp)) __OTORP__(Namval_t *np; Namfun_t* fp;){
Namfun_t *lp;
if(fp)
{
if((lp=np->nvfun)==fp)
@ -1364,8 +1364,8 @@ Namfun_t *nv_stack __PARAM__((register Namval_t *np, register Namfun_t* fp), (np
* Special builtins cannot be replaced and return -1
*/
int sh_addbuiltin __PARAM__((const char *path, int (*bltin)(int, char*[],__V_*),__V_ *extra), (path, bltin, extra)) __OTORP__(const char *path; int (*bltin)();__V_ *extra;){
register const char *cp, *name = path_basename(path);
register Namval_t *np, *nq=0;
const char *cp, *name = path_basename(path);
Namval_t *np, *nq=0;
if(name==path && (cp=strchr(name,'.')) && cp!=name)
{
int offset = staktell();
@ -1412,8 +1412,8 @@ static char *curbuf;
* with <places> places after the decimal point. The string
* will be stored within static variable <numbuf>.
*/
char *sh_ftos __PARAM__((double val,register int places), (val, places)) __OTORP__(double val;register int places;){
register char *cp, *sp;
char *sh_ftos __PARAM__((double val,int places), (val, places)) __OTORP__(double val;int places;){
char *cp, *sp;
int decpt,sign;
cp = sffcvt(val,places,&decpt,&sign);
@ -1440,8 +1440,8 @@ char *sh_ftos __PARAM__((double val,register int places), (val, places)) __OTORP
* convert <val> to a string with <places> significant figures
* The result is placed in a local buffer and a pointer returned
*/
char *sh_etos __PARAM__((double val,register int places), (val, places)) __OTORP__(double val;register int places;){
register int bufsize = places+8;
char *sh_etos __PARAM__((double val,int places), (val, places)) __OTORP__(double val;int places;){
int bufsize = places+8;
if(!curbuf)
curbuf = (char*)malloc(maxbufsize=bufsize);
else if(bufsize > maxbufsize)
@ -1453,9 +1453,9 @@ char *sh_etos __PARAM__((double val,register int places), (val, places)) __OTORP
/*
* call the next getval function in the chain
*/
char *nv_getv __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; register Namfun_t *nfp;){
register Namfun_t *fp;
register char *cp;
char *nv_getv __PARAM__((Namval_t *np, Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; Namfun_t *nfp;){
Namfun_t *fp;
char *cp;
if((fp = nfp) != NIL(Namfun_t*) && !local)
fp = nfp = nfp->next;
local=0;
@ -1478,9 +1478,9 @@ char *nv_getv __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OTO
/*
* call the next getnum function in the chain
*/
double nv_getn __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; register Namfun_t *nfp;){
register Namfun_t *fp;
register double d=0;
double nv_getn __PARAM__((Namval_t *np, Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; Namfun_t *nfp;){
Namfun_t *fp;
double d=0;
if((fp = nfp) != NIL(Namfun_t*) && !local)
fp = nfp = nfp->next;
local=0;
@ -1507,8 +1507,8 @@ double nv_getn __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OT
/*
* call the next assign function in the chain
*/
void nv_putv __PARAM__((Namval_t *np, const char *value, int flags, register Namfun_t *nfp), (np, value, flags, nfp)) __OTORP__(Namval_t *np; const char *value; int flags; register Namfun_t *nfp;){
register Namfun_t *fp;
void nv_putv __PARAM__((Namval_t *np, const char *value, int flags, Namfun_t *nfp), (np, value, flags, nfp)) __OTORP__(Namval_t *np; const char *value; int flags; Namfun_t *nfp;){
Namfun_t *fp;
if((fp=nfp) != NIL(Namfun_t*) && !local)
fp = nfp = nfp->next;
local=0;
@ -1542,8 +1542,8 @@ struct vardisc
/*
* free discipline if no more discipline functions
*/
static void chktfree __PARAM__((register Namval_t *np, register struct vardisc *vp), (np, vp)) __OTORP__(register Namval_t *np; register struct vardisc *vp;){
register int n;
static void chktfree __PARAM__((Namval_t *np, struct vardisc *vp), (np, vp)) __OTORP__(Namval_t *np; struct vardisc *vp;){
int n;
for(n=0; n< sizeof(vp->disc)/sizeof(*vp->disc); n++)
{
if(vp->disc[n])
@ -1562,8 +1562,8 @@ static void chktfree __PARAM__((register Namval_t *np, register struct vardisc *
* This function performs an assignment disc on the given node <np>
*/
static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *handle), (np, val, flags, handle)) __OTORP__(Namval_t *np;const char* val;int flags;Namfun_t *handle;){
register struct vardisc *vp = (struct vardisc*)handle;
register Namval_t *nq, **disc;
struct vardisc *vp = (struct vardisc*)handle;
Namval_t *nq, **disc;
if(val)
{
if(!(nq=vp->disc[ASSIGN]))
@ -1585,7 +1585,7 @@ static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *h
}
if(val)
{
register char *cp;
char *cp;
double d;
if(nv_isnull(SH_VALNOD))
cp=0;
@ -1619,9 +1619,9 @@ static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *h
* the lookup on the given node <np>
*/
static char* lookup __PARAM__((Namval_t *np, Namfun_t *handle), (np, handle)) __OTORP__(Namval_t *np; Namfun_t *handle;){
register struct vardisc *vp = (struct vardisc*)handle;
register Namval_t *nq;
register char *cp=0;
struct vardisc *vp = (struct vardisc*)handle;
Namval_t *nq;
char *cp=0;
if((nq=vp->disc[LOOKUP]) && nq!=BLOCKED)
{
nv_unset(SH_VALNOD);
@ -1641,7 +1641,7 @@ static char* lookup __PARAM__((Namval_t *np, Namfun_t *handle), (np, handle)) __
/*
* node creation discipline
*/
Namval_t *nv_create __PARAM__((register Namval_t* np,const char *name,register Namfun_t *fp), (np, name, fp)) __OTORP__(register Namval_t* np;const char *name;register Namfun_t *fp;){
Namval_t *nv_create __PARAM__((Namval_t* np,const char *name,Namfun_t *fp), (np, name, fp)) __OTORP__(Namval_t* np;const char *name;Namfun_t *fp;){
if(np == (Namval_t*)fp)
fp = np->nvfun;
else if(fp)
@ -1668,14 +1668,14 @@ static const Namdisc_t shdisc =
* If <event> is NULL, then return the event name after <action>
* If <event> is NULL, and <action> is NULL, return the first event
*/
char *nv_setdisc __PARAM__((register Namval_t* np,register const char *event,Namval_t *action,register Namfun_t *fp), (np, event, action, fp)) __OTORP__(register Namval_t* np;register const char *event;Namval_t *action;register Namfun_t *fp;){
register struct vardisc *vp = (struct vardisc*)np->nvfun;
register int type;
char *nv_setdisc __PARAM__((Namval_t* np,const char *event,Namval_t *action,Namfun_t *fp), (np, event, action, fp)) __OTORP__(Namval_t* np;const char *event;Namval_t *action;Namfun_t *fp;){
struct vardisc *vp = (struct vardisc*)np->nvfun;
int type;
if(np == (Namval_t*)fp)
{
static const char *discnames[] = { "get", "set", "unset", 0 };
register const char *name;
register int getname=0;
const char *name;
int getname=0;
/* top level call, check for get/set */
if(!event)
{
@ -1744,10 +1744,10 @@ char *nv_setdisc __PARAM__((register Namval_t* np,register const char *event,Nam
/*
* Create a reference node from <np>
*/
void nv_setref __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){
register Namval_t *nq, *nr;
register char *cp;
register int flags = NV_ARRAY|NV_VARNAME|NV_REF;
void nv_setref __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
Namval_t *nq, *nr;
char *cp;
int flags = NV_ARRAY|NV_VARNAME|NV_REF;
Hashtab_t *hp=sh.var_tree;
if(nv_isattr(np,NV_REF))
return;

View file

@ -151,9 +151,9 @@ static struct argnod *label_last;
* type=='V' for variable assignment lists
* Otherwise type is determined by the command */
static void writedefs __PARAM__((struct argnod *arglist, int line, int type, struct argnod *cmd), (arglist, line, type, cmd)) __OTORP__(struct argnod *arglist; int line; int type; struct argnod *cmd;){
register struct argnod *argp = arglist;
register char *cp;
register int n;
struct argnod *argp = arglist;
char *cp;
int n;
int width=0;
static char atbuff[20];
static char justify[2];
@ -213,7 +213,7 @@ static void writedefs __PARAM__((struct argnod *arglist, int line, int type, str
* Make a parent node for fork() or io-redirection
*/
static union anynode *makeparent __PARAM__((int flag, union anynode *child), (flag, child)) __OTORP__(int flag; union anynode *child;){
register union anynode *par = getnode(forknod);
union anynode *par = getnode(forknod);
par->fork.forktyp = flag;
par->fork.forktre = child;
par->fork.forkio = 0;
@ -225,7 +225,7 @@ static union anynode *makeparent __PARAM__((int flag, union anynode *child), (fl
* Make a node corresponding to a command list
*/
static union anynode *makelist __PARAM__((int type, union anynode *l, union anynode *r), (type, l, r)) __OTORP__(int type; union anynode *l; union anynode *r;){
register union anynode *t;
union anynode *t;
if(!l || !r)
sh_syntax();
else
@ -247,7 +247,7 @@ static union anynode *makelist __PARAM__((int type, union anynode *l, union anyn
*/
union anynode *sh_parse __PARAM__((Sfio_t *iop, int flag), (iop, flag)) __OTORP__(Sfio_t *iop; int flag;){
register union anynode *t;
union anynode *t;
Fcin_t sav_input;
int sav_prompt = sh.nextprompt;
if(sh.binscript && sffileno(iop)==sh.infd)
@ -305,7 +305,7 @@ union anynode *sh_parse __PARAM__((Sfio_t *iop, int flag), (iop, flag)) __OTORP_
* the parse tree
*/
union anynode *sh_dolparen __PARAM__((void), ()){
register union anynode *t=0;
union anynode *t=0;
Sfio_t *sp = fcfile();
int line = sh.inlineno;
sh.inlineno = error_info.line+sh.st.firstline;
@ -329,7 +329,7 @@ union anynode *sh_dolparen __PARAM__((void), ()){
* This code handles the case where string has been converted
* to a file by an alias setup
*/
register int c;
int c;
char *cp;
if(fcgetc(c) > 0)
fcseek(-1);
@ -358,8 +358,8 @@ void sh_freeup __PARAM__((void), ()){
* stack is freed when reference count is zero
*/
void sh_funstaks __PARAM__((register struct slnod *slp,int flag), (slp, flag)) __OTORP__(register struct slnod *slp;int flag;){
register struct slnod *slpold;
void sh_funstaks __PARAM__((struct slnod *slp,int flag), (slp, flag)) __OTORP__(struct slnod *slp;int flag;){
struct slnod *slpold;
while(slpold=slp)
{
if(slp->slchild)
@ -379,9 +379,9 @@ void sh_funstaks __PARAM__((register struct slnod *slp,int flag), (slp, flag)) _
* list [ ; cmd ]
*/
static union anynode *sh_cmd __PARAM__((register int sym, int flag), (sym, flag)) __OTORP__(register int sym; int flag;){
register union anynode *left, *right;
register int type = FINT|FAMP;
static union anynode *sh_cmd __PARAM__((int sym, int flag), (sym, flag)) __OTORP__(int sym; int flag;){
union anynode *left, *right;
int type = FINT|FAMP;
if(sym==NL)
shlex.lasttok = 0;
left = list(flag);
@ -432,9 +432,9 @@ static union anynode *sh_cmd __PARAM__((register int sym, int flag), (sym, flag)
* list || term
* unfortunately, these are equal precedence
*/
static union anynode *list __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){
register union anynode *t = term(flag);
register int token;
static union anynode *list __PARAM__((int flag), (flag)) __OTORP__(int flag;){
union anynode *t = term(flag);
int token;
while(t && ((token=shlex.token)==ANDFSYM || token==ORFSYM))
t = makelist((token==ANDFSYM?TAND:TORF), t, term(SH_NL));
return(t);
@ -445,9 +445,9 @@ static union anynode *list __PARAM__((register int flag), (flag)) __OTORP__(regi
* item
* item | term
*/
static union anynode *term __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){
register union anynode *t;
register int token;
static union anynode *term __PARAM__((int flag), (flag)) __OTORP__(int flag;){
union anynode *t;
int token;
if(flag&SH_NL)
token = skipnl();
else
@ -463,7 +463,7 @@ static union anynode *term __PARAM__((register int flag), (flag)) __OTORP__(regi
}
else if((t=item(SH_NL|SH_EMPTY)) && shlex.token=='|')
{
register union anynode *tt;
union anynode *tt;
t = makeparent(TFORK|FPOU,t);
if(tt=term(SH_NL))
{
@ -489,9 +489,9 @@ static union anynode *term __PARAM__((register int flag), (flag)) __OTORP__(regi
/*
* case statement
*/
static struct regnod* syncase __PARAM__((register int esym), (esym)) __OTORP__(register int esym;){
register int tok = skipnl();
register struct regnod *r;
static struct regnod* syncase __PARAM__((int esym), (esym)) __OTORP__(int esym;){
int tok = skipnl();
struct regnod *r;
if(tok==esym)
return(NIL(struct regnod*));
r = (struct regnod*)stakalloc(sizeof(struct regnod));
@ -538,11 +538,11 @@ static struct regnod* syncase __PARAM__((register int esym), (esym)) __OTORP__(r
* Otherise a list containing an arithmetic command and a while
* is returned.
*/
static union anynode *arithfor __PARAM__((register union anynode *tf), (tf)) __OTORP__(register union anynode *tf;){
register union anynode *t, *tw = tf;
register int offset;
register struct argnod *argp;
register int n;
static union anynode *arithfor __PARAM__((union anynode *tf), (tf)) __OTORP__(union anynode *tf;){
union anynode *t, *tw = tf;
int offset;
struct argnod *argp;
int n;
int argflag = shlex.arg->argflag;
/* save current input */
Fcin_t sav_input;
@ -551,7 +551,7 @@ static union anynode *arithfor __PARAM__((register union anynode *tf), (tf)) __O
/* split ((...)) into three expressions */
for(n=0; ; n++)
{
register int c;
int c;
argp = (struct argnod*)stakseek(ARGVAL);
argp->argnxt.ap = 0;
argp->argflag = argflag;
@ -617,8 +617,8 @@ static union anynode *arithfor __PARAM__((register union anynode *tf), (tf)) __O
}
static union anynode *funct __PARAM__((void), ()){
register union anynode *t;
register int flag;
union anynode *t;
int flag;
struct slnod *volatile slp=0;
Stak_t *savstak;
#ifdef SHOPT_KIA
@ -735,10 +735,10 @@ static union anynode *funct __PARAM__((void), ()){
/*
* Compound assignment
*/
static struct argnod *assign __PARAM__((register struct argnod *ap), (ap)) __OTORP__(register struct argnod *ap;){
register int n;
register union anynode *t ,**tp;
register struct comnod *ac;
static struct argnod *assign __PARAM__((struct argnod *ap), (ap)) __OTORP__(struct argnod *ap;){
int n;
union anynode *t ,**tp;
struct comnod *ac;
int array=0;
Namval_t *np;
n = strlen(ap->argval)-1;
@ -808,9 +808,9 @@ static struct argnod *assign __PARAM__((register struct argnod *ap), (ap)) __OTO
*/
static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register union anynode *t;
register struct ionod *io;
register int tok = (shlex.token&0xff);
union anynode *t;
struct ionod *io;
int tok = (shlex.token&0xff);
int savwdval = shlex.lasttok;
int savline = shlex.lastline;
if(!(flag&SH_NOIO) && (tok=='<' || tok=='>'))
@ -862,7 +862,7 @@ static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){
/* if statement */
case IFSYM:
{
register union anynode *tt;
union anynode *tt;
t = getnode(ifnod);
t->if_.iftyp=TIF;
t->if_.iftre=sh_cmd(THENSYM,SH_NL);
@ -943,7 +943,7 @@ static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){
case LABLSYM:
{
register struct argnod *argp = label_list;
struct argnod *argp = label_list;
while(argp)
{
if(strcmp(argp->argval,shlex.arg->argval)==0)
@ -1001,9 +1001,9 @@ done:
* This is for a simple command, for list, or compound assignment
*/
static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io)) __OTORP__(int flag; struct ionod *io;){
register struct comnod *t;
register struct argnod *argp;
register int tok;
struct comnod *t;
struct argnod *argp;
int tok;
struct argnod **argtail;
struct argnod **settail;
int keywd=1;
@ -1137,7 +1137,7 @@ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io))
#ifdef SHOPT_KIA
if(shlex.kiafile)
{
register Namval_t *np=(Namval_t*)t->comnamp;
Namval_t *np=(Namval_t*)t->comnamp;
int line = t->comline;
argp = t->comarg;
if(argp)
@ -1171,7 +1171,7 @@ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io))
Namval_t *np=(Namval_t*)t->comnamp;
if((np==SYSBREAK || np==SYSCONT) && (argp->argflag&ARG_RAW) && !isdigit(*argp->argval))
{
register char *cp = argp->argval;
char *cp = argp->argval;
/* convert break/continue labels to numbers */
tok = 0;
for(argp=label_list;argp!=label_last;argp=argp->argnxt.ap)
@ -1214,7 +1214,7 @@ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io))
* skip past newlines but issue prompt if interactive
*/
static int skipnl __PARAM__((void), ()){
register int token;
int token;
while((token=sh_lex())==NL);
if(token==';')
sh_syntax();
@ -1226,8 +1226,8 @@ static int skipnl __PARAM__((void), ()){
* if flag is set then an alias can be in the next word
*/
static struct ionod *inout __PARAM__((struct ionod *lastio,int flag), (lastio, flag)) __OTORP__(struct ionod *lastio;int flag;){
register int iof = shlex.digits, token=shlex.token;
register struct ionod *iop;
int iof = shlex.digits, token=shlex.token;
struct ionod *iop;
switch(token&0xff)
{
case '<':
@ -1299,10 +1299,10 @@ static struct ionod *inout __PARAM__((struct ionod *lastio,int flag), (lastio, f
*/
static struct argnod *qscan __PARAM__((struct comnod *ac,int argn), (ac, argn)) __OTORP__(struct comnod *ac;int argn;){
register char **cp;
register struct argnod *ap;
register struct dolnod* dp;
register int special=0;
char **cp;
struct argnod *ap;
struct dolnod* dp;
int special=0;
/* special hack for test -t compatibility */
if((Namval_t*)ac->comnamp==SYSTEST)
special = 2;
@ -1356,30 +1356,30 @@ static struct argnod *qscan __PARAM__((struct comnod *ac,int argn), (ac, argn))
}
static union anynode *test_expr __PARAM__((int sym), (sym)) __OTORP__(int sym;){
register union anynode *t = test_or();
union anynode *t = test_or();
if(shlex.token!=sym)
sh_syntax();
return(t);
}
static union anynode *test_or __PARAM__((void), ()){
register union anynode *t = test_and();
union anynode *t = test_and();
while(shlex.token==ORFSYM)
t = makelist(TORF|TTEST,t,test_and());
return(t);
}
static union anynode *test_and __PARAM__((void), ()){
register union anynode *t = test_primary();
union anynode *t = test_primary();
while(shlex.token==ANDFSYM)
t = makelist(TAND|TTEST,t,test_primary());
return(t);
}
static union anynode *test_primary __PARAM__((void), ()){
register struct argnod *arg;
register union anynode *t;
register int num,token;
struct argnod *arg;
union anynode *t;
int num,token;
token = skipnl();
num = shlex.digits;
switch(token)
@ -1462,8 +1462,8 @@ static union anynode *test_primary __PARAM__((void), ()){
#ifdef SHOPT_KIA
int kiaclose __PARAM__((void), ()){
register off_t off1,off2;
register int n;
off_t off1,off2;
int n;
if(shlex.kiafile)
{
sfseek(shlex.kiafile,shlex.kiabegin,SEEK_SET);

View file

@ -130,9 +130,9 @@ static int exec_err;
* Sets the PWD variable to this value
*/
char *path_pwd __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register char *cp;
register char *dfault = (char*)e_dot;
register int count = 0;
char *cp;
char *dfault = (char*)e_dot;
int count = 0;
if(sh.pwd)
return((char*)sh.pwd);
while(1)
@ -189,8 +189,8 @@ skip:
*/
char *path_get __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register char *path=0;
register char *sp = sh.lastpath;
char *path=0;
char *sp = sh.lastpath;
static int bin_is_usrbin = -1;
if(strchr(name,'/'))
return("");
@ -220,9 +220,9 @@ char *path_get __PARAM__((const char *name), (name)) __OTORP__(const char *name;
* convert each /usr/bin to /bin and eliminate multiple /bin from <path>
* The resulting path is placed on the stack
*/
static char *path_to_stak __PARAM__((register const char *path), (path)) __OTORP__(register const char *path;){
register const char *cp=path, *base;
register int n, nbin=0;
static char *path_to_stak __PARAM__((const char *path), (path)) __OTORP__(const char *path;){
const char *cp=path, *base;
int n, nbin=0;
stakseek(0);
while(*cp)
{
@ -250,7 +250,7 @@ static char *path_to_stak __PARAM__((register const char *path), (path)) __OTORP
}
int path_open __PARAM__((const char *name,char *path), (name, path)) __OTORP__(const char *name;char *path;){
register int fd;
int fd;
struct stat statb;
if(strchr(name,'/'))
{
@ -292,9 +292,9 @@ int path_open __PARAM__((const char *name,char *path), (name, path)) __OTORP__(c
*/
static int path_inpath __PARAM__((const char *path, const char *fpath), (path, fpath)) __OTORP__(const char *path; const char *fpath;){
register const char *dp = fpath;
register const char *sp = path;
register int c, match=1;
const char *dp = fpath;
const char *sp = path;
int c, match=1;
if(!dp || !sp || *sp==0)
return(0);
if(*sp==':' || (*sp=='.' && ((c=sp[1])==0 || c==':')))
@ -323,14 +323,14 @@ static int path_inpath __PARAM__((const char *path, const char *fpath), (path, f
* set tracked alias node <np> to value <sp>
*/
void path_alias __PARAM__((register Namval_t *np,register char *sp), (np, sp)) __OTORP__(register Namval_t *np;register char *sp;){
void path_alias __PARAM__((Namval_t *np,char *sp), (np, sp)) __OTORP__(Namval_t *np;char *sp;){
if(!sp)
nv_unset(np);
else
{
register const char *vp = np->nvalue.cp;
register int n = 1;
register int nofree = nv_isattr(np,NV_NOFREE);
const char *vp = np->nvalue.cp;
int n = 1;
int nofree = nv_isattr(np,NV_NOFREE);
nv_offattr(np,NV_NOPRINT);
if(!vp || (n=strcmp(sp,vp))!=0)
{
@ -350,8 +350,8 @@ void path_alias __PARAM__((register Namval_t *np,register char *sp), (np, sp)) _
* given a pathname return the base name
*/
char *path_basename __PARAM__((register const char *name), (name)) __OTORP__(register const char *name;){
register const char *start = name;
char *path_basename __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
const char *start = name;
while (*name)
if ((*name++ == '/') && *name) /* don't trim trailing / */
start = name;
@ -379,9 +379,9 @@ static void funload __PARAM__((int fno, const char *name), (fno, name)) __OTORP_
* If endpath!=NULL, Path search ends when path matches endpath.
*/
int path_search __PARAM__((register const char *name,const char *endpath, int flag), (name, endpath, flag)) __OTORP__(register const char *name;const char *endpath; int flag;){
register Namval_t *np;
register int fno;
int path_search __PARAM__((const char *name,const char *endpath, int flag), (name, endpath, flag)) __OTORP__(const char *name;const char *endpath; int flag;){
Namval_t *np;
int fno;
if(flag)
{
/* if not found on pruned path, rehash and try again */
@ -393,7 +393,7 @@ int path_search __PARAM__((register const char *name,const char *endpath, int fl
}
if(flag==0 || !sh.lastpath)
{
register char *path=0;
char *path=0;
if(strmatch(name,e_alphanum))
path = nv_getval(nv_scoped(FPATHNOD));
if(path && (fno=path_open(name,path))>=0)
@ -425,11 +425,11 @@ int path_search __PARAM__((register const char *name,const char *endpath, int fl
* end search of path matches endpath without checking execute permission
*/
char *path_absolute __PARAM__((register const char *name, const char *endpath), (name, endpath)) __OTORP__(register const char *name; const char *endpath;){
register int f;
register char *path;
register const char *fpath=0;
register int isfun;
char *path_absolute __PARAM__((const char *name, const char *endpath), (name, endpath)) __OTORP__(const char *name; const char *endpath;){
int f;
char *path;
const char *fpath=0;
int isfun;
#ifdef SHOPT_VPIX
char **suffix = 0;
char *top;
@ -501,9 +501,9 @@ char *path_absolute __PARAM__((register const char *name, const char *endpath),
# endif /*S_EXEC */
#endif /* S_IXUSR */
static int canexecute __PARAM__((register char *path, int isfun), (path, isfun)) __OTORP__(register char *path; int isfun;){
static int canexecute __PARAM__((char *path, int isfun), (path, isfun)) __OTORP__(char *path; int isfun;){
struct stat statb;
register int fd=0;
int fd=0;
path = path_relative(path);
if(isfun)
{
@ -542,9 +542,9 @@ err:
* Return path relative to present working directory
*/
char *path_relative __PARAM__((register const char* file), (file)) __OTORP__(register const char* file;){
register const char *pwd;
register const char *fp = file;
char *path_relative __PARAM__((const char* file), (file)) __OTORP__(const char* file;){
const char *pwd;
const char *fp = file;
/* can't relpath when sh.pwd not set */
if(!(pwd=sh.pwd))
return((char*)fp);
@ -564,10 +564,10 @@ char *path_relative __PARAM__((register const char* file), (file)) __OTORP__(reg
return((char*)file);
}
char *path_join __PARAM__((register char *path,const char *name), (path, name)) __OTORP__(register char *path;const char *name;){
char *path_join __PARAM__((char *path,const char *name), (path, name)) __OTORP__(char *path;const char *name;){
/* leaves result on top of stack */
register char *scanp = path;
register int c;
char *scanp = path;
int c;
stakseek(PATH_OFFSET);
if(*scanp=='.')
{
@ -602,8 +602,8 @@ char *path_join __PARAM__((register char *path,const char *name), (path, name))
}
void path_exec __PARAM__((register const char *arg0,register char *argv[],struct argnod *local), (arg0, argv, local)) __OTORP__(register const char *arg0;register char *argv[];struct argnod *local;){
register const char *path = "";
void path_exec __PARAM__((const char *arg0,char *argv[],struct argnod *local), (arg0, argv, local)) __OTORP__(const char *arg0;char *argv[];struct argnod *local;){
const char *path = "";
nv_setlist(local,NV_EXPORT|NV_IDENT|NV_ASSIGN);
xecenv=sh_envgen();
if(strchr(arg0,'/'))
@ -632,9 +632,9 @@ void path_exec __PARAM__((register const char *arg0,register char *argv[],struct
* This routine constructs a short path consisting of all
* Relative directories up to the directory of fullname <name>
*/
static char *prune __PARAM__((register char *path,const char *fullname), (path, fullname)) __OTORP__(register char *path;const char *fullname;){
register char *p = path;
register char *s;
static char *prune __PARAM__((char *path,const char *fullname), (path, fullname)) __OTORP__(char *path;const char *fullname;){
char *p = path;
char *s;
int n = 1;
const char *base;
char *inpath = path;
@ -675,8 +675,8 @@ static char *prune __PARAM__((register char *path,const char *fullname), (path,
}
static char *execs __PARAM__((const char *ap,const char *arg0,register char **argv), (ap, arg0, argv)) __OTORP__(const char *ap;const char *arg0;register char **argv;){
register char *path, *prefix;
static char *execs __PARAM__((const char *ap,const char *arg0,char **argv), (ap, arg0, argv)) __OTORP__(const char *ap;const char *arg0;char **argv;){
char *path, *prefix;
sh_sigcheck();
prefix=path_join((char*)ap,arg0);
xecenv[0] = stakptr(0);
@ -779,8 +779,8 @@ static char *execs __PARAM__((const char *ap,const char *arg0,register char **ar
*/
static void exscript __PARAM__((register char *path,register char *argv[]), (path, argv)) __OTORP__(register char *path;register char *argv[];){
register Sfio_t *sp;
static void exscript __PARAM__((char *path,char *argv[]), (path, argv)) __OTORP__(char *path;char *argv[];){
Sfio_t *sp;
sh.comdiv=0;
sh.bckpid = 0;
sh.st.ioset=0;
@ -801,8 +801,8 @@ static void exscript __PARAM__((register char *path,register char *argv[]), (pat
/* check if file cannot open for read or script is setuid/setgid */
{
static char name[] = "/tmp/euidXXXXXXXXXX";
register int n;
register uid_t euserid;
int n;
uid_t euserid;
char *savet;
struct stat statb;
if((n=sh_open(path,O_RDONLY,0)) >= 0)
@ -933,8 +933,8 @@ static void exscript __PARAM__((register char *path,register char *argv[]), (pat
* Produce a pseudo-floating point representation
* with 3 bits base-8 exponent, 13 bits fraction.
*/
static int compress __PARAM__((register time_t t), (t)) __OTORP__(register time_t t;){
register int exp = 0, rund = 0;
static int compress __PARAM__((time_t t), (t)) __OTORP__(time_t t;){
int exp = 0, rund = 0;
while (t >= 8192)
{

View file

@ -141,7 +141,7 @@ static double seterror __PROTO__((const char[])); /* set error message string *
*/
double strval __PARAM__((const char *s, char** end, double(*conv)(const char**,struct lval*,int,double)), (s, end, conv)) __OTORP__(const char *s; char** end; double(*conv)();){
register double n;
double n;
pushchr(s);
cur.isfloat = 0;
@ -167,9 +167,9 @@ double strval __PARAM__((const char *s, char** end, double(*conv)(const char**,s
* evaluate a subexpression with precedence
*/
static double expr __PARAM__((register int precedence), (precedence)) __OTORP__(register int precedence;){
register int c, op;
register double n, x;
static double expr __PARAM__((int precedence), (precedence)) __OTORP__(int precedence;){
int c, op;
double n, x;
int wasop, incr=0;
struct lval lvalue, assignop;
const char *pos;

View file

@ -106,10 +106,10 @@
* This is only used for small tables and is used to save non-sharable memory
*/
int sh_locate __PARAM__((register const char *sp,const Shtable_t *table,int size), (sp, table, size)) __OTORP__(register const char *sp;const Shtable_t *table;int size;){
register int first;
register const Shtable_t *tp;
register int c;
int sh_locate __PARAM__((const char *sp,const Shtable_t *table,int size), (sp, table, size)) __OTORP__(const char *sp;const Shtable_t *table;int size;){
int first;
const Shtable_t *tp;
int c;
if(sp==0 || (first= *sp)==0)
return(0);
tp=table;
@ -127,8 +127,8 @@ int sh_locate __PARAM__((register const char *sp,const Shtable_t *table,int size
* The new string is put on top of the stack
*/
char *sh_substitute __PARAM__((const char *string,const char *oldsp,char *newsp), (string, oldsp, newsp)) __OTORP__(const char *string;const char *oldsp;char *newsp;){
register const char *sp = string;
register const char *cp;
const char *sp = string;
const char *cp;
const char *savesp = 0;
stakseek(0);
if(*sp==0)
@ -182,9 +182,9 @@ found:
* Remove escape characters from characters in <sp> and eliminate quoted nulls.
*/
void sh_trim __PARAM__((register char *sp), (sp)) __OTORP__(register char *sp;){
register char *dp;
register int c;
void sh_trim __PARAM__((char *sp), (sp)) __OTORP__(char *sp;){
char *dp;
int c;
if(sp)
{
dp = sp;
@ -204,8 +204,8 @@ void sh_trim __PARAM__((register char *sp), (sp)) __OTORP__(register char *sp;){
* puts null terminated result on stack, but doesn't freeze it
*/
char *sh_fmtq __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register const char *cp = string;
register int c, state;
const char *cp = string;
int c, state;
int offset;
if(!cp)
return((char*)0);
@ -303,10 +303,10 @@ char *sh_fmtq __PARAM__((const char *string), (string)) __OTORP__(const char *st
}
#ifdef SHOPT_MULTIBYTE
int sh_strchr __PARAM__((const char *string, register const char *dp), (string, dp)) __OTORP__(const char *string; register const char *dp;){
int sh_strchr __PARAM__((const char *string, const char *dp), (string, dp)) __OTORP__(const char *string; const char *dp;){
wchar_t c,d;
register int m;
register const char *cp=string;
int m;
const char *cp=string;
int n = mbtowc(&d,dp,MB_CUR_MAX);
while((m=mbtowc(&c,cp,MB_CUR_MAX)) && c)
{

View file

@ -132,9 +132,9 @@ static int subenv;
void sh_subtmpfile __PARAM__((void), ()){
if(sfset(sfstdout,0,0)&SF_STRING)
{
register int fd;
register struct checkpt *pp = (struct checkpt*)sh.jmplist;
register struct subshell *sp = subshell_data->pipe;
int fd;
struct checkpt *pp = (struct checkpt*)sh.jmplist;
struct subshell *sp = subshell_data->pipe;
/* save file descriptor 1 if open */
if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0)
{
@ -168,7 +168,7 @@ void sh_subtmpfile __PARAM__((void), ()){
* The child continues possibly with its standard output replaced by temp file
*/
void sh_subfork __PARAM__((void), ()){
register struct subshell *sp = subshell_data;
struct subshell *sp = subshell_data;
pid_t pid;
/* see whether inside $(...) */
if(sp->pipe)
@ -197,8 +197,8 @@ void sh_subfork __PARAM__((void), ()){
* layer created by the most recent subshell_fork if the
* node hasn't already been copied
*/
Namval_t *sh_assignok __PARAM__((register Namval_t *np,int add), (np, add)) __OTORP__(register Namval_t *np;int add;){
register Namval_t *mp;
Namval_t *sh_assignok __PARAM__((Namval_t *np,int add), (np, add)) __OTORP__(Namval_t *np;int add;){
Namval_t *mp;
if(nv_isnull(np) && !add) /* don't bother with this */
return(np);
/* don't bother to save if in newer scope */
@ -226,8 +226,8 @@ Namval_t *sh_assignok __PARAM__((register Namval_t *np,int add), (np, add)) __OT
* restore the variables
*/
static void nv_restore __PARAM__((struct subshell *sp), (sp)) __OTORP__(struct subshell *sp;){
register Namval_t *mp, *np;
register Hashpos_t *pos = hashscan(sp->svar,0);
Namval_t *mp, *np;
Hashpos_t *pos = hashscan(sp->svar,0);
while(np=(Namval_t*)hashnext(pos))
{
if(mp = nv_search((char*)np,sp->var,HASH_BUCKET))
@ -256,7 +256,7 @@ static void nv_restore __PARAM__((struct subshell *sp), (sp)) __OTORP__(struct s
Sfio_t *sh_subshell __PARAM__((union anynode *t, int flags, int comsub), (t, flags, comsub)) __OTORP__(union anynode *t; int flags; int comsub;){
struct subshell sub_data;
register struct subshell *sp = &sub_data;
struct subshell *sp = &sub_data;
int jmpval,nsig;
int savecurenv = sh.curenv;
char *savstak;

View file

@ -130,8 +130,8 @@ static gid_t egroupid;
static struct stat statb;
main __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){
register int m,n;
register char *p;
int m,n;
char *p;
struct stat statx;
int mode;
uid_t effuid;
@ -283,7 +283,7 @@ exec:
* return true of shell ends in sh
*/
static int endsh __PARAM__((register const char *shell), (shell)) __OTORP__(register const char *shell;){
static int endsh __PARAM__((const char *shell), (shell)) __OTORP__(const char *shell;){
while(*shell)
shell++;
if(*--shell != 'h' || *--shell != 's')
@ -296,7 +296,7 @@ static int endsh __PARAM__((register const char *shell), (shell)) __OTORP__(regi
* return true of shell is in <dir> directory
*/
static int in_dir __PARAM__((register const char *dir,register const char *shell), (dir, shell)) __OTORP__(register const char *dir;register const char *shell;){
static int in_dir __PARAM__((const char *dir,const char *shell), (dir, shell)) __OTORP__(const char *dir;const char *shell;){
while(*dir)
{
if(*dir++ != *shell++)
@ -316,7 +316,7 @@ static void error_exit __PARAM__((const char *message), (message)) __OTORP__(con
* This version of access checks against effective uid and effective gid
*/
eaccess __PARAM__((register const char *name, register int mode), (name, mode)) __OTORP__(register const char *name; register int mode;){
eaccess __PARAM__((const char *name, int mode), (name, mode)) __OTORP__(const char *name; int mode;){
struct stat statb;
if (stat(name, &statb) == 0)
{
@ -337,7 +337,7 @@ eaccess __PARAM__((register const char *name, register int mode), (name, mode))
{
static int maxgroups = 0;
gid_t *groups;
register int n;
int n;
if(maxgroups==0)
{
/* first time */
@ -387,7 +387,7 @@ setids __PARAM__((int mode,int owner,int group), (mode, owner, group)) __OTORP__
*/
setids __PARAM__((int mode,uid_t owner,gid_t group), (mode, owner, group)) __OTORP__(int mode;uid_t owner;gid_t group;){
register int n,m;
int n,m;
int pv[2];
/*
@ -497,8 +497,8 @@ setids __PARAM__((int mode,uid_t owner,gid_t group), (mode, owner, group)) __OTO
*/
static void maketemp __PARAM__((char *template), (template)) __OTORP__(char *template;){
register char *cp = template;
register pid_t n = getpid();
char *cp = template;
pid_t n = getpid();
/* skip to end of string */
while(*++cp);
/* convert process id to string */
@ -516,7 +516,7 @@ static void maketemp __PARAM__((char *template), (template)) __OTORP__(char *tem
static int mycopy __PARAM__((int fdi, int fdo), (fdi, fdo)) __OTORP__(int fdi; int fdo;){
char buffer[BLKSIZE];
register int n;
int n;
while((n = read(fdi,buffer,BLKSIZE)) > 0)
if(write(fdo,buffer,n) != n)

View file

@ -114,7 +114,7 @@ int sh_tdump __PARAM__((Sfio_t *out, const union anynode *t), (out, t)) __OTORP_
/*
* print script corresponding to shell tree <t>
*/
static int p_tree __PARAM__((register const union anynode *t), (t)) __OTORP__(register const union anynode *t;){
static int p_tree __PARAM__((const union anynode *t), (t)) __OTORP__(const union anynode *t;){
if(!t)
return(sfputl(outfile,-1));
if(sfputl(outfile,t->tre.tretyp)<0)
@ -197,8 +197,8 @@ static int p_tree __PARAM__((register const union anynode *t), (t)) __OTORP__(re
}
}
static int p_arg __PARAM__((register const struct argnod *arg), (arg)) __OTORP__(register const struct argnod *arg;){
register int n;
static int p_arg __PARAM__((const struct argnod *arg), (arg)) __OTORP__(const struct argnod *arg;){
int n;
struct fornod *fp;
while(arg)
{
@ -221,7 +221,7 @@ static int p_arg __PARAM__((register const struct argnod *arg), (arg)) __OTORP__
return(sfputu(outfile,0));
}
static int p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OTORP__(register const struct ionod *iop;){
static int p_redirect __PARAM__((const struct ionod *iop), (iop)) __OTORP__(const struct ionod *iop;){
while(iop)
{
sfputl(outfile,iop->iofile);
@ -240,7 +240,7 @@ static int p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OTO
return(sfputl(outfile,-1));
}
static int p_comarg __PARAM__((const register struct comnod *com), (com)) __OTORP__(const register struct comnod *com;){
static int p_comarg __PARAM__((const struct comnod *com), (com)) __OTORP__(const struct comnod *com;){
p_redirect(com->comio);
p_arg(com->comset);
if(!com->comarg)
@ -253,8 +253,8 @@ static int p_comarg __PARAM__((const register struct comnod *com), (com)) __OTOR
}
static int p_comlist __PARAM__((const struct dolnod *dol), (dol)) __OTORP__(const struct dolnod *dol;){
register char *cp, *const*argv;
register int n;
char *cp, *const*argv;
int n;
argv = dol->dolval+ARG_SPARE;
while(cp = *argv)
argv++;
@ -266,7 +266,7 @@ static int p_comlist __PARAM__((const struct dolnod *dol), (dol)) __OTORP__(cons
return(sfputu(outfile,0));
}
static int p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTORP__(register const struct regnod *reg;){
static int p_switch __PARAM__((const struct regnod *reg), (reg)) __OTORP__(const struct regnod *reg;){
while(reg)
{
sfputl(outfile,reg->regflag);
@ -277,8 +277,8 @@ static int p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTOR
return(sfputl(outfile,-1));
}
static int p_string __PARAM__((register const char *string), (string)) __OTORP__(register const char *string;){
register size_t n=strlen(string);
static int p_string __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
size_t n=strlen(string);
if(sfputu(outfile,n+1)<0)
return(-1);
return(sfwrite(outfile,string,n));

View file

@ -116,7 +116,7 @@ static Timer_t *tptop, *tpmin;
static char time_state;
static double getnow __PARAM__((void), ()){
register double now;
double now;
#ifdef _lib_gettimeofday
struct timeval tp;
gettimeofday(&tp,(void *)0);
@ -131,7 +131,7 @@ static double getnow __PARAM__((void), ()){
/*
* set an alarm for <t> seconds
*/
static double setalarm __PARAM__((register double t), (t)) __OTORP__(register double t;){
static double setalarm __PARAM__((double t), (t)) __OTORP__(double t;){
#if defined(_lib_setitimer) && defined(ITIMER_REAL)
struct itimerval tnew, told;
tnew.it_value.tv_sec = t;
@ -154,7 +154,7 @@ static double setalarm __PARAM__((register double t), (t)) __OTORP__(register do
/* signal handler for alarm call */
static void sigalrm __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register Timer_t *tp, *tplast, *tpold;
Timer_t *tp, *tplast, *tpold;
double now;
static double left;
NOT_USED(sig);
@ -237,7 +237,7 @@ static void oldalrm __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;)
}
__V_ *kshtimeradd __PARAM__((unsigned long msec,int flags,void (*action)(__V_*),__V_ *handle), (msec, flags, action, handle)) __OTORP__(unsigned long msec;int flags;void (*action)();__V_ *handle;){
register Timer_t *tp;
Timer_t *tp;
double t;
Handler_t fn;
t = ((double)msec)/1000.;
@ -282,7 +282,7 @@ __V_ *kshtimeradd __PARAM__((unsigned long msec,int flags,void (*action)(__V_*),
* delete timer <tp>. If <tp> is NULL, all timers are deleted
*/
void timerdel __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;){
register Timer_t *tp = (Timer_t*)handle;
Timer_t *tp = (Timer_t*)handle;
if(tp)
tp->action = 0;
else

View file

@ -121,8 +121,8 @@ union anynode *sh_trestore __PARAM__((Sfio_t *in), (in)) __OTORP__(Sfio_t *in;){
static union anynode *r_tree()
{
long l = sfgetl(infile);
register int type;
register union anynode *t=0;
int type;
union anynode *t=0;
if(l<0)
return(t);
type = l;
@ -219,8 +219,8 @@ static union anynode *r_tree()
}
static struct argnod *r_arg __PARAM__((void), ()){
register struct argnod *ap=0, *apold, *aptop=0;
register long l;
struct argnod *ap=0, *apold, *aptop=0;
long l;
while((l=sfgetu(infile))>0)
{
ap = (struct argnod*)stakseek((unsigned)l+ARGVAL);
@ -263,8 +263,8 @@ static struct argnod *r_arg __PARAM__((void), ()){
}
static struct ionod *r_redirect __PARAM__((void), ()){
register long l;
register struct ionod *iop=0, *iopold, *ioptop=0;
long l;
struct ionod *iop=0, *iopold, *ioptop=0;
while((l=sfgetl(infile))>=0)
{
iop = (struct ionod*)getnode(ionod);
@ -313,9 +313,9 @@ static void r_comarg __PARAM__((struct comnod *com), (com)) __OTORP__(struct com
}
static struct dolnod *r_comlist __PARAM__((void), ()){
register struct dolnod *dol=0;
register long l;
register char **argv;
struct dolnod *dol=0;
long l;
char **argv;
if((l=sfgetl(infile))>0)
{
dol = (struct dolnod*)stakalloc(sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE));
@ -328,7 +328,7 @@ static struct dolnod *r_comlist __PARAM__((void), ()){
}
static struct regnod *r_switch __PARAM__((void), ()){
register long l;
long l;
struct regnod *reg=0,*regold,*regtop=0;
while((l=sfgetl(infile))>=0)
{
@ -348,9 +348,9 @@ static struct regnod *r_switch __PARAM__((void), ()){
}
static char *r_string __PARAM__((void), ()){
register Sfio_t *in = infile;
register unsigned long l = sfgetu(in);
register char *ptr;
Sfio_t *in = infile;
unsigned long l = sfgetu(in);
char *ptr;
if(l == 0)
return(NIL(char*));
ptr = stakalloc((unsigned)l);

View file

@ -130,7 +130,7 @@ static struct f_save *save_fork; /* most recently saved data */
int sh_vforksave __PARAM__((void), ())
#line 35
{
register struct f_save *fp;
struct f_save *fp;
if(!(fp = new_of(struct f_save,0)))
return(0);
fp->f_save_fork = save_fork;
@ -151,7 +151,7 @@ int sh_vforksave __PARAM__((void), ())
void sh_vforkrestore __PARAM__((void), ())
#line 55
{
register struct f_save *fp = save_fork;
struct f_save *fp = save_fork;
if(!sh_isstate(SH_VFORKED))
return;

View file

@ -132,8 +132,8 @@ static char pipejob;
/*
* Given stream <iop> compile and execute
*/
int sh_eval __PARAM__((register Sfio_t *iop, int mode), (iop, mode)) __OTORP__(register Sfio_t *iop; int mode;){
register union anynode *t;
int sh_eval __PARAM__((Sfio_t *iop, int mode), (iop, mode)) __OTORP__(Sfio_t *iop; int mode;){
union anynode *t;
struct slnod *saveslp = sh.st.staklist;
int jmpval;
struct checkpt *pp = (struct checkpt*)sh.jmplist;
@ -167,7 +167,7 @@ int sh_eval __PARAM__((register Sfio_t *iop, int mode), (iop, mode)) __OTORP__(r
#ifdef SHOPT_FASTPIPE
static int pipe_exec __PARAM__((int pv[], union anynode *t, int errorflg), (pv, t, errorflg)) __OTORP__(int pv[]; union anynode *t; int errorflg;){
struct checkpt buff;
register union anynode *tchild = t->fork.forktre;
union anynode *tchild = t->fork.forktre;
Namval_t *np;
Sfile_t *iop;
int jmpval,r;
@ -209,12 +209,12 @@ static int pipe_exec __PARAM__((int pv[], union anynode *t, int errorflg), (pv,
}
#endif /* SHOPT_FASTPIPE */
sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OTORP__(register const union anynode *t; int flags;){
sh_exec __PARAM__((const union anynode *t, int flags), (t, flags)) __OTORP__(const union anynode *t; int flags;){
sh_sigcheck();
if(t && !sh.st.execbrk && !sh_isoption(SH_NOEXEC))
{
register int type = flags;
register char *com0 = 0;
int type = flags;
char *com0 = 0;
int errorflg = (type&SH_ERREXIT);
int execflg = (type&SH_NOFORK);
int mainloop = (type&SH_INTERACTIVE);
@ -242,7 +242,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
{
case TCOM:
{
register struct argnod *argp;
struct argnod *argp;
char *trap;
Namval_t *np;
struct ionod *io;
@ -258,7 +258,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
com0 = com[0];
if(!(np=(Namval_t*)(t->com.comnamp)) && com0)
{
register char *cp;
char *cp;
Namval_t *nq=0;
/* check for reference to discipline function */
if((cp=strchr(com0,'.')) && cp!=com0)
@ -310,7 +310,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
}
while(np==SYSCOMMAND)
{
register int n = b_command(0,com,0);
int n = b_command(0,com,0);
if(n==0)
break;
command += n;
@ -333,7 +333,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
{
if(argn==0 || (np && !command && nv_isattr(np,BLT_SPC)))
{
register int flags=NV_VARNAME|NV_ASSIGN;
int flags=NV_VARNAME|NV_ASSIGN;
if(np==SYSTYPESET)
{
if(sh.fn_depth)
@ -472,7 +472,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
if(!command && np && nv_isattr(np,NV_FUNCTION))
{
int indx;
register struct slnod *slp;
struct slnod *slp;
if(!np->nvalue.ip)
{
path_search(com0,NIL(char*),0);
@ -502,7 +502,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
}
case TFORK:
{
register pid_t parent;
pid_t parent;
int no_fork,jobid;
int pipes[2];
no_fork = (execflg && !(type&(FAMP|FPOU)) &&
@ -794,9 +794,9 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
case TFOR: /* for and select */
{
register char **args;
register int nargs;
register Namval_t *np;
char **args;
int nargs;
Namval_t *np;
struct dolnod *argsav=0;
struct comnod *tp;
char *cp, *nullptr = 0;
@ -822,7 +822,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
{
char *val;
int save_prompt;
/* reuse register */
/* reuse */
if(refresh)
{
sh_menu(sfstderr,nargs,args);
@ -889,7 +889,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
case TWH: /* while and until */
{
register int r=0;
int r=0;
sh.st.loopcnt++;
while(sh.st.execbrk==0 && (sh_exec(t->wh.whtre,0)==0)==(type==TWH))
{
@ -908,7 +908,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
}
case TARITH: /* (( expression )) */
{
register char *trap;
char *trap;
static char *arg[4]= {"((", 0, "))"};
error_info.line = t->ar.arline-sh.st.firstline;
if(trap=sh.st.trap[SH_DEBUGTRAP])
@ -945,10 +945,10 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
t= (union anynode*)(t->sw.swlst);
while(t)
{
register struct argnod *rex=(struct argnod*)t->reg.regptr;
struct argnod *rex=(struct argnod*)t->reg.regptr;
while(rex)
{
register char *s;
char *s;
if(rex->argflag&ARG_MAC)
{
s = sh_mactrim(rex->argval,1);
@ -1037,11 +1037,11 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
}
case TFUN:
{
register Namval_t *np;
register struct slnod *slp;
register char *fname = ((struct functnod*)t)->functnam;
register char *cp;
register Namval_t *npv=0;
Namval_t *np;
struct slnod *slp;
char *fname = ((struct functnod*)t)->functnam;
char *cp;
Namval_t *npv=0;
/* look for discipline functions */
error_info.line = t->funct.functline-sh.st.firstline;
if(cp = strrchr(fname,'.'))
@ -1098,8 +1098,8 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
/* new test compound command */
case TTST:
{
register int n;
register char *left;
int n;
char *left;
if(type&TTEST)
skipexitset++;
error_info.line = t->tst.tstline-sh.st.firstline;
@ -1110,9 +1110,9 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
}
else
{
register int traceon=0;
register char *right;
register char *trap;
int traceon=0;
char *right;
char *trap;
n = type>>TSHIFT;
left = word_trim(&(t->lst.lstlef->arg),0);
if(type&TBINARY)
@ -1220,8 +1220,8 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
* returns 1 if r == trim(s) otherwise 0
*/
static trim_eq __PARAM__((register const char *r,register const char *s), (r, s)) __OTORP__(register const char *r;register const char *s;){
register char c;
static trim_eq __PARAM__((const char *r,const char *s), (r, s)) __OTORP__(const char *r;const char *s;){
char c;
while(c = *s++)
{
if(c=='\\')
@ -1236,9 +1236,9 @@ static trim_eq __PARAM__((register const char *r,register const char *s), (r, s)
* print out the command line if set -x is on
*/
int sh_trace __PARAM__((register char *argv[], register int nl), (argv, nl)) __OTORP__(register char *argv[]; register int nl;){
register char *cp;
register int bracket = 0;
int sh_trace __PARAM__((char *argv[], int nl), (argv, nl)) __OTORP__(char *argv[]; int nl;){
char *cp;
int bracket = 0;
if(sh_isoption(SH_XTRACE))
{
/* make this trace atomic */
@ -1279,8 +1279,8 @@ int sh_trace __PARAM__((register char *argv[], register int nl), (argv, nl)) __O
}
static char *word_trim __PARAM__((register struct argnod *arg, int flag), (arg, flag)) __OTORP__(register struct argnod *arg; int flag;){
register char *sp = arg->argval;
static char *word_trim __PARAM__((struct argnod *arg, int flag), (arg, flag)) __OTORP__(struct argnod *arg; int flag;){
char *sp = arg->argval;
if((arg->argflag&ARG_RAW))
return(sp);
return(sh_mactrim(sp,flag));
@ -1309,8 +1309,8 @@ static void timed_out __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle
/*
* called by parent and child after fork by sh_fork()
*/
pid_t _sh_fork __PARAM__((register pid_t parent,int flags,int *jobid), (parent, flags, jobid)) __OTORP__(register pid_t parent;int flags;int *jobid;){
register struct checkpt *pp = (struct checkpt*)sh.jmplist;
pid_t _sh_fork __PARAM__((pid_t parent,int flags,int *jobid), (parent, flags, jobid)) __OTORP__(pid_t parent;int flags;int *jobid;){
struct checkpt *pp = (struct checkpt*)sh.jmplist;
static long forkcnt = 1000L;
pid_t curpgid = job.curpgid;
pid_t postid = (flags&FAMP)?0:curpgid;
@ -1407,7 +1407,7 @@ pid_t _sh_fork __PARAM__((register pid_t parent,int flags,int *jobid), (parent,
}
pid_t sh_fork __PARAM__((int flags, int *jobid), (flags, jobid)) __OTORP__(int flags; int *jobid;){
register pid_t parent;
pid_t parent;
#ifdef SHOPT_FASTPIPE
if(sffileno(sfstdin)<0)
{
@ -1430,8 +1430,8 @@ pid_t sh_fork __PARAM__((int flags, int *jobid), (flags, jobid)) __OTORP__(int f
* The environment modification list <envlist> is ignored for posix functions
*/
static void sh_funct __PARAM__((Namval_t *np,int argn, char *argv[],int execflg,struct argnod *envlist), (np, argn, argv, execflg, envlist)) __OTORP__(Namval_t *np;int argn; char *argv[];int execflg;struct argnod *envlist;){
register char *trap;
register int nsig;
char *trap;
int nsig;
struct dolnod *argsav=0,*saveargfor;
struct sh_scoped savst;
Shopt_t savopt;
@ -1526,9 +1526,9 @@ static void sh_funct __PARAM__((Namval_t *np,int argn, char *argv[],int execflg,
*/
int sh_fun __PARAM__((Namval_t *np, Namval_t *nq), (np, nq)) __OTORP__(Namval_t *np; Namval_t *nq;){
char *argv[2];
register Namarr_t *ap;
register int offset;
register char *base;
Namarr_t *ap;
int offset;
char *base;
Fcin_t save;
fcsave(&save);
if((offset=staktell())>0)
@ -1575,9 +1575,9 @@ int sh_fun __PARAM__((Namval_t *np, Namval_t *nq), (np, nq)) __OTORP__(Namval_t
/*
* print a time and a separator
*/
static void p_time __PARAM__((Sfio_t *outfile,register clock_t t,int c), (outfile, t, c)) __OTORP__(Sfio_t *outfile;register clock_t t;int c;){
register int min, sec, frac;
register int hr;
static void p_time __PARAM__((Sfio_t *outfile,clock_t t,int c), (outfile, t, c)) __OTORP__(Sfio_t *outfile;clock_t t;int c;){
int min, sec, frac;
int hr;
frac = t%sh.lim.clk_tck;
frac = (frac*100)/sh.lim.clk_tck;
t /= sh.lim.clk_tck;
@ -1635,8 +1635,8 @@ static void coproc_init __PARAM__((int pipes[]), (pipes)) __OTORP__(int pipes[];
/*
* print out function definition
*/
static void print_fun __PARAM__((register Namval_t* np), (np)) __OTORP__(register Namval_t* np;){
register char *format;
static void print_fun __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
char *format;
if(!is_afunction(np) || !np->nvalue.ip)
return;
if(nv_isattr(np,NV_FPOSIX))
@ -1653,7 +1653,7 @@ static void print_fun __PARAM__((register Namval_t* np), (np)) __OTORP__(registe
*/
static int run_subshell __PARAM__((const union anynode *t,pid_t grp), (t, grp)) __OTORP__(const union anynode *t;pid_t grp;){
static char prolog[] = "set; typeset -p; print .sh.dollar=$$";
register int i, fd, trace = sh_isoption(SH_XTRACE);
int i, fd, trace = sh_isoption(SH_XTRACE);
pid_t pid;
char *arglist[3], devfd[12], *cp;
Sfio_t *sp = sftmp(0);
@ -1717,7 +1717,7 @@ static pid_t sh_ntfork __PARAM__((const union anynode *t,char *argv[],int *jobid
# ifndef _lib_fork
if(!argv)
{
register union anynode *tchild = t->fork.forktre;
union anynode *tchild = t->fork.forktre;
int optimize=0;
otype = t->tre.tretyp;
savetype = otype;

View file

@ -126,9 +126,9 @@
*/
static int
blokread __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(register Archive_t* ap; char* buf; int n;){
register int i;
register int j;
blokread __PARAM__((Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(Archive_t* ap; char* buf; int n;){
int i;
int j;
char c;
static int eof;
@ -170,10 +170,10 @@ blokread __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __O
}
static int
blokwrite __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(register Archive_t* ap; char* buf; int n;){
register char* s;
register int i;
register int j;
blokwrite __PARAM__((Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(Archive_t* ap; char* buf; int n;){
char* s;
int i;
int j;
char blk[9];
if (ap->io.blok)
@ -225,7 +225,7 @@ blokwrite __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __
*/
void
binit __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
binit __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
unsigned long n;
if (ap->delta)
@ -245,7 +245,7 @@ binit __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap
*/
int
bskip __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
bskip __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
long c;
int skip = ap->io.skip;
#ifdef MTIOCTOP
@ -315,8 +315,8 @@ bskip __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap
*/
static int
bfill __PARAM__((register Archive_t* ap, int must), (ap, must)) __OTORP__(register Archive_t* ap; int must;){
register int c;
bfill __PARAM__((Archive_t* ap, int must), (ap, must)) __OTORP__(Archive_t* ap; int must;){
int c;
if (ap->io.eof) return(-1);
if (ap->io.skip) ap->io.skip = bskip(ap);
@ -343,10 +343,10 @@ bfill __PARAM__((register Archive_t* ap, int must), (ap, must)) __OTORP__(regist
*/
int
bread __PARAM__((register Archive_t* ap, __V_* ab, register long n, long m, int must), (ap, ab, n, m, must)) __OTORP__(register Archive_t* ap; __V_* ab; register long n; long m; int must;){
register char* b = (char*)ab;
register int c;
register char* ob;
bread __PARAM__((Archive_t* ap, __V_* ab, long n, long m, int must), (ap, ab, n, m, must)) __OTORP__(Archive_t* ap; __V_* ab; long n; long m; int must;){
char* b = (char*)ab;
int c;
char* ob;
if (ap->io.eof) return(-1);
if (m <= 0) return(0);
@ -465,8 +465,8 @@ bread __PARAM__((register Archive_t* ap, __V_* ab, register long n, long m, int
*/
void
bunread __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n)) __OTORP__(register Archive_t* ap; __V_* ab; register int n;){
register char* b = (char*)ab;
bunread __PARAM__((Archive_t* ap, __V_* ab, int n), (ap, ab, n)) __OTORP__(Archive_t* ap; __V_* ab; int n;){
char* b = (char*)ab;
ap->io.eof = 0;
ap->io.count -= n;
@ -484,8 +484,8 @@ bunread __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n
*/
char*
bget __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(register Archive_t* ap; register int n;){
register char* s;
bget __PARAM__((Archive_t* ap, int n), (ap, n)) __OTORP__(Archive_t* ap; int n;){
char* s;
ap->io.count += n;
s = ap->io.next;
@ -494,9 +494,9 @@ bget __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(regi
{
if (ap->io.last > ap->io.buffer + MAXUNREAD + state.buffersize)
{
register char* b;
register int k;
register int m;
char* b;
int k;
int m;
k = ap->io.last - s;
m = roundof(k, IOALIGN) - k;
@ -534,9 +534,9 @@ bget __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(regi
*/
void
backup __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register long n;
register long m;
backup __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
long n;
long m;
#ifdef MTIOCTOP
struct mtop mt;
#endif
@ -593,7 +593,7 @@ backup __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* a
*/
void
bflushin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
bflushin __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
ap->io.count += ap->io.last - ap->io.next;
ap->io.next = ap->io.last = ap->io.buffer + MAXUNREAD;
if (!ap->io.eof)
@ -608,7 +608,7 @@ bflushin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t*
*/
off_t
bseek __PARAM__((register Archive_t* ap, off_t pos, int op), (ap, pos, op)) __OTORP__(register Archive_t* ap; off_t pos; int op;){
bseek __PARAM__((Archive_t* ap, off_t pos, int op), (ap, pos, op)) __OTORP__(Archive_t* ap; off_t pos; int op;){
ap->io.next = ap->io.last = ap->io.buffer + MAXUNREAD;
if ((pos = lseek(ap->io.fd, pos, op)) >= 0)
{
@ -624,9 +624,9 @@ bseek __PARAM__((register Archive_t* ap, off_t pos, int op), (ap, pos, op)) __OT
*/
void
bflushout __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register int n;
register int c;
bflushout __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
int n;
int c;
if (n = ap->io.next - ap->io.buffer)
{
@ -649,9 +649,9 @@ bflushout __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t
*/
void
bwrite __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n)) __OTORP__(register Archive_t* ap; __V_* ab; register int n;){
register char* b = (char*)ab;
register int c;
bwrite __PARAM__((Archive_t* ap, __V_* ab, int n), (ap, ab, n)) __OTORP__(Archive_t* ap; __V_* ab; int n;){
char* b = (char*)ab;
int c;
if (ap->sum > 0)
ap->memsum = memsum(b, n, ap->memsum);
@ -734,7 +734,7 @@ bwrite __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n)
*/
void
bput __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(register Archive_t* ap; register int n;){
bput __PARAM__((Archive_t* ap, int n), (ap, n)) __OTORP__(Archive_t* ap; int n;){
ap->io.count += n;
message((-7, "bput(%s,%d@%ld): %-.*s%s", ap->name, n, ap->io.count, n > 32 ? 32 : n, ap->io.next, n > 32 ? "..." : ""));
if (ap->sum > 0)
@ -766,7 +766,7 @@ static struct
*/
static int
devpath __PARAM__((register Ftw_t* ftw), (ftw)) __OTORP__(register Ftw_t* ftw;){
devpath __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){
if (ftw->info == FTW_F && ftw->statb.st_dev == dev.st->st_dev && ftw->statb.st_ino == dev.st->st_ino)
{
message((-1, "device name is %s", ftw->path));
@ -802,9 +802,9 @@ interactive __PARAM__((void), ()){
*/
void
newio __PARAM__((register Archive_t* ap, int c, int n), (ap, c, n)) __OTORP__(register Archive_t* ap; int c; int n;){
register char* s;
register char* rw;
newio __PARAM__((Archive_t* ap, int c, int n), (ap, c, n)) __OTORP__(Archive_t* ap; int c; int n;){
char* s;
char* rw;
char* file;
char* io;
char* t;

View file

@ -97,9 +97,9 @@
*/
char*
strlower __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
register int c;
register char* t;
strlower __PARAM__((char* s), (s)) __OTORP__(char* s;){
int c;
char* t;
for (t = s; c = *t; t++)
if (isupper(c))
@ -112,9 +112,9 @@ strlower __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
*/
char*
strupper __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
register int c;
register char* t;
strupper __PARAM__((char* s), (s)) __OTORP__(char* s;){
int c;
char* t;
for (t = s; c = *t; t++)
if (islower(c))
@ -127,7 +127,7 @@ strupper __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
*/
long
cpio_long __PARAM__((register unsigned short* s), (s)) __OTORP__(register unsigned short* s;){
cpio_long __PARAM__((unsigned short* s), (s)) __OTORP__(unsigned short* s;){
Integral_t u;
u.l = 1;
@ -149,7 +149,7 @@ cpio_long __PARAM__((register unsigned short* s), (s)) __OTORP__(register unsign
*/
void
cpio_short __PARAM__((register unsigned short* s, long n), (s, n)) __OTORP__(register unsigned short* s; long n;){
cpio_short __PARAM__((unsigned short* s, long n), (s, n)) __OTORP__(unsigned short* s; long n;){
Integral_t u;
u.l = 1;
@ -173,8 +173,8 @@ cpio_short __PARAM__((register unsigned short* s, long n), (s, n)) __OTORP__(reg
int
tar_checksum __PARAM__((void), ()){
register char* p;
register int n;
char* p;
int n;
p = tar_header.chksum;
while (p < &tar_header.chksum[sizeof(tar_header.chksum)]) *p++ = ' ';
@ -189,9 +189,9 @@ tar_checksum __PARAM__((void), ()){
*/
long
asc_checksum __PARAM__((char* ab, int n, register unsigned long sum), (ab, n, sum)) __OTORP__(char* ab; int n; register unsigned long sum;){
register unsigned char* b = (unsigned char*)ab;
register unsigned char* e;
asc_checksum __PARAM__((char* ab, int n, unsigned long sum), (ab, n, sum)) __OTORP__(char* ab; int n; unsigned long sum;){
unsigned char* b = (unsigned char*)ab;
unsigned char* e;
e = b + n;
while (b < e) sum += *b++;
@ -203,9 +203,9 @@ asc_checksum __PARAM__((char* ab, int n, register unsigned long sum), (ab, n, su
*/
long
getlabnum __PARAM__((register char* p, int byte, int width, int base), (p, byte, width, base)) __OTORP__(register char* p; int byte; int width; int base;){
register char* e;
register int c;
getlabnum __PARAM__((char* p, int byte, int width, int base), (p, byte, width, base)) __OTORP__(char* p; int byte; int width; int base;){
char* e;
int c;
long n;
p += byte - 1;
@ -221,9 +221,9 @@ getlabnum __PARAM__((register char* p, int byte, int width, int base), (p, byte,
*/
char*
getlabstr __PARAM__((register char* p, int byte, int width, register char* s), (p, byte, width, s)) __OTORP__(register char* p; int byte; int width; register char* s;){
getlabstr __PARAM__((char* p, int byte, int width, char* s), (p, byte, width, s)) __OTORP__(char* p; int byte; int width; char* s;){
register char* e;
char* e;
char* v;
v = s;
@ -245,9 +245,9 @@ getlabstr __PARAM__((register char* p, int byte, int width, register char* s), (
#define OHASHLPART(h,c) OHASHPART(31, h, c, 3, 2)
unsigned long
omemsum __PARAM__((const __V_* b, int n, register unsigned long c), (b, n, c)) __OTORP__(const __V_* b; int n; register unsigned long c;){
register unsigned char* p;
register unsigned char* e;
omemsum __PARAM__((const __V_* b, int n, unsigned long c), (b, n, c)) __OTORP__(const __V_* b; int n; unsigned long c;){
unsigned char* p;
unsigned char* e;
p = (unsigned char*)b;
e = p + n;

View file

@ -97,8 +97,8 @@
*/
void
copyin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register File_t* f = &ap->file;
copyin __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
File_t* f = &ap->file;
deltabase(ap);
while (getprologue(ap))
@ -120,9 +120,9 @@ copyin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* a
*/
int
copyout __PARAM__((register Ftw_t* ftw), (ftw)) __OTORP__(register Ftw_t* ftw;){
register Archive_t* ap = state.out;
register File_t* f = &ap->file;
copyout __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){
Archive_t* ap = state.out;
File_t* f = &ap->file;
if (getfile(ap, f, ftw))
{
@ -142,10 +142,10 @@ copyout __PARAM__((register Ftw_t* ftw), (ftw)) __OTORP__(register Ftw_t* ftw;){
static void
recordout __PARAM__((Archive_t* ap, File_t* f, Sfio_t* fp), (ap, f, fp)) __OTORP__(Archive_t* ap; File_t* f; Sfio_t* fp;){
register int c;
register char* p;
register char* recdat;
register char* blkdat;
int c;
char* p;
char* recdat;
char* blkdat;
char* rec;
char* blk;
int span;
@ -326,9 +326,9 @@ recordout __PARAM__((Archive_t* ap, File_t* f, Sfio_t* fp), (ap, f, fp)) __OTORP
*/
void
fileout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register int n;
register long c;
fileout __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
long c;
int err;
Buffer_t* bp;
Sfio_t* rfp;
@ -458,9 +458,9 @@ fileout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/
static void
recordin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap, f, wfd)) __OTORP__(register Archive_t* ap; register File_t* f; int wfd;){
register long n;
register long size;
recordin __PARAM__((Archive_t* ap, File_t* f, int wfd), (ap, f, wfd)) __OTORP__(Archive_t* ap; File_t* f; int wfd;){
long n;
long size;
int c;
int i;
int j;
@ -645,8 +645,8 @@ recordin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap, f
*/
static void
savesetin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap, f, wfd)) __OTORP__(register Archive_t* ap; register File_t* f; int wfd;){
register long c;
savesetin __PARAM__((Archive_t* ap, File_t* f, int wfd), (ap, f, wfd)) __OTORP__(Archive_t* ap; File_t* f; int wfd;){
long c;
int i;
int j;
int k;
@ -736,10 +736,10 @@ savesetin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap,
*/
void
filein __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register long c;
register int n;
register char* s;
filein __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
long c;
int n;
char* s;
int dfd;
int wfd;
long checksum;
@ -845,7 +845,7 @@ filein __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP_
*/
void
fileskip __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
fileskip __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
switch (ap->format)
{
case ALAR:
@ -871,11 +871,11 @@ fileskip __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTOR
int
copyinout __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){
register long c;
register long n;
register int rfd;
register int wfd;
register File_t* f = &state.out->file;
long c;
long n;
int rfd;
int wfd;
File_t* f = &state.out->file;
static char path[PATH_MAX];
@ -932,9 +932,9 @@ cmpftw __PARAM__((Ftw_t* ft1, Ftw_t* ft2), (ft1, ft2)) __OTORP__(Ftw_t* ft1; Ftw
typedef int (*Ftw_cmp_t) __PROTO__((Ftw_t*, Ftw_t*));
void
copy __PARAM__((register Archive_t* ap, register int (*copyfile)(Ftw_t*)), (ap, copyfile)) __OTORP__(register Archive_t* ap; register int (*copyfile)();){
register char* s;
register int n;
copy __PARAM__((Archive_t* ap, int (*copyfile)(Ftw_t*)), (ap, copyfile)) __OTORP__(Archive_t* ap; int (*copyfile)();){
char* s;
int n;
if (ap)
{
@ -966,7 +966,7 @@ copy __PARAM__((register Archive_t* ap, register int (*copyfile)(Ftw_t*)), (ap,
*/
void
append __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
append __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
if (state.update) initdelta(ap);
ap->format = IN_DEFAULT;
copyin(ap);

View file

@ -98,9 +98,9 @@
static void
getdeltaops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s;
register char* e;
register int n;
char* s;
char* e;
int n;
unsigned long x;
char c;
@ -160,8 +160,8 @@ getdeltaops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t*
*/
void
getdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
getdeltaheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
char c;
int n;
unsigned long sum;
@ -218,7 +218,7 @@ getdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/
void
getdeltatrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
getdeltatrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
if (ap->delta && ap->delta->trailer)
{
f->st->st_size += ap->delta->trailer;
@ -232,9 +232,9 @@ getdeltatrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/
void
setdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
register int n;
setdeltaheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
int n;
if (f->delta.op && ap->delta)
{
@ -253,7 +253,7 @@ setdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/
void
putdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
putdeltaheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
if (f->delta.op && ap->delta && (n = ap->delta->hdr - ap->delta->hdrbuf))
@ -278,9 +278,9 @@ putdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/
void
putdeltatrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
register int n;
putdeltatrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
int n;
if (f->delta.op && ap->delta)
{
@ -312,8 +312,8 @@ initdelta __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
*/
void
deltabase __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register Archive_t* bp;
deltabase __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
Archive_t* bp;
struct stat st;
if (!ap->delta)
@ -355,10 +355,10 @@ deltabase __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t
void
deltaverify __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register int wfd;
register Member_t* d;
register long c;
register long n;
int wfd;
Member_t* d;
long c;
long n;
Hash_position_t* pos;
if (!state.list && ap->delta && (pos = hashscan(ap->delta->tab, 0)))
@ -410,9 +410,9 @@ deltaverify __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
*/
static void
deltaprefix __PARAM__((Archive_t* ip, Archive_t* op, register Member_t* d), (ip, op, d)) __OTORP__(Archive_t* ip; Archive_t* op; register Member_t* d;){
register char* s;
register Member_t* m;
deltaprefix __PARAM__((Archive_t* ip, Archive_t* op, Member_t* d), (ip, op, d)) __OTORP__(Archive_t* ip; Archive_t* op; Member_t* d;){
char* s;
Member_t* m;
d->mark = 1;
if (s = strrchr(d->info->path, '/'))
@ -438,8 +438,8 @@ deltaprefix __PARAM__((Archive_t* ip, Archive_t* op, register Member_t* d), (ip,
*/
void
deltaout __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; register File_t* f;){
register Member_t* d;
deltaout __PARAM__((Archive_t* ip, Archive_t* op, File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; File_t* f;){
Member_t* d;
int dfd;
if (d = op->delta && op->delta->tab && f->name ? (Member_t*)hashget(op->delta->tab, f->name) : (Member_t*)0)
@ -489,7 +489,7 @@ deltaout __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op,
}
if (!d || d->mtime != f->st->st_mtime)
{
register char* s;
char* s;
if (ip && ip->delta && ip->delta->tab && f->name && (s = strrchr(f->name, '/')))
{
@ -512,7 +512,7 @@ deltaout __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op,
*/
static void
deltacopy __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; register File_t* f;){
deltacopy __PARAM__((Archive_t* ip, Archive_t* op, File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; File_t* f;){
f->st->st_size = f->delta.base->size;
if (f->delta.base->expand >= 0)
{
@ -537,9 +537,9 @@ deltacopy __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op,
*/
void
deltadelete __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register File_t* f;
register Member_t* d;
deltadelete __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
File_t* f;
Member_t* d;
Hash_position_t* pos;
if (!state.ordered && ap->delta && ap->delta->tab)
@ -572,9 +572,9 @@ deltadelete __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
void
deltapass __PARAM__((Archive_t* ip, Archive_t* op), (ip, op)) __OTORP__(Archive_t* ip; Archive_t* op;){
register File_t* f;
register long c;
register long n;
File_t* f;
long c;
long n;
Member_t* d;
char* p;
Hash_position_t* pos;
@ -764,7 +764,7 @@ typedef struct
static int
delread __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)) __OTORP__(__V_* buf; int n; long off; Vddisc_t* vd;){
register Vdio_t* dp = (Vdio_t*)vd;
Vdio_t* dp = (Vdio_t*)vd;
if (off != dp->offset)
{
@ -800,7 +800,7 @@ delread __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd))
static int
delwrite __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)) __OTORP__(__V_* buf; int n; long off; Vddisc_t* vd;){
register Vdio_t* dp = (Vdio_t*)vd;
Vdio_t* dp = (Vdio_t*)vd;
Buffer_t* bp;
if (dp->op & DELTA_BIO)
@ -836,7 +836,7 @@ delwrite __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)
int
paxdelta __PARAM__((Archive_t* ip, Archive_t* ap, File_t* f, int op, ...), (va_alist)) __OTORP__(va_dcl)
{ __OTORP__(Archive_t* ip; Archive_t* ap; File_t* f; int op; )
register Vdio_t* dp;
Vdio_t* dp;
va_list vp;
long n;
int bufferclash = 0;

View file

@ -117,12 +117,12 @@
*/
char*
fgetline __PARAM__((register FILE* fp, int op), (fp, op)) __OTORP__(register FILE* fp; int op;)
fgetline __PARAM__((FILE* fp, int op), (fp, op)) __OTORP__(FILE* fp; int op;)
#line 29
{
register int c;
register char* s;
register char* end;
int c;
char* s;
char* end;
static char* buf;
static int siz;

View file

@ -97,8 +97,8 @@
*/
int
filter __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register int n;
filter __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
int rfd;
int wfd;
Proc_t* proc;
@ -150,8 +150,8 @@ filter __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP_
*/
int
openin __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register int n;
openin __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
int rfd;
if (f->type != X_IFREG)
@ -185,9 +185,9 @@ openin __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP_
*/
static int
missdir __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
register char* t;
missdir __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
char* t;
long pp;
struct stat* st;
struct stat* sp;
@ -257,8 +257,8 @@ missdir __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/
int
openout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register int fd;
openout __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int fd;
int exists;
struct stat st;
@ -514,8 +514,8 @@ openout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/
int
getfile __PARAM__((register Archive_t* ap, register File_t* f, register Ftw_t* ftw), (ap, f, ftw)) __OTORP__(register Archive_t* ap; register File_t* f; register Ftw_t* ftw;){
register char* name;
getfile __PARAM__((Archive_t* ap, File_t* f, Ftw_t* ftw), (ap, f, ftw)) __OTORP__(Archive_t* ap; File_t* f; Ftw_t* ftw;){
char* name;
static struct stat st;
static char pathbuffer[PATH_MAX];
@ -599,8 +599,8 @@ getfile __PARAM__((register Archive_t* ap, register File_t* f, register Ftw_t* f
*/
int
validout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
validout __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
static char linkbuffer[PATH_MAX];
static char idbuffer[ALAR_NAMESIZE + 1];
@ -697,9 +697,9 @@ validout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTOR
*/
int
addlink __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register Link_t* p;
register char* s;
addlink __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
Link_t* p;
char* s;
Fileid_t id;
unsigned short us;
@ -827,7 +827,7 @@ addlink __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/
void
getidnames __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
getidnames __PARAM__((File_t* f), (f)) __OTORP__(File_t* f;){
if (!f->uidname) f->uidname = fmtuid(f->st->st_uid);
if (!f->gidname) f->gidname = fmtgid(f->st->st_gid);
}
@ -837,8 +837,8 @@ getidnames __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
*/
void
setidnames __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
register int id;
setidnames __PARAM__((File_t* f), (f)) __OTORP__(File_t* f;){
int id;
if (f->uidname)
{
@ -898,7 +898,7 @@ getarchive __PARAM__((int op), (op)) __OTORP__(int op;){
*/
void
initfile __PARAM__((register Archive_t* ap, register File_t* f, register char* name, int mode), (ap, f, name, mode)) __OTORP__(register Archive_t* ap; register File_t* f; register char* name; int mode;){
initfile __PARAM__((Archive_t* ap, File_t* f, char* name, int mode), (ap, f, name, mode)) __OTORP__(Archive_t* ap; File_t* f; char* name; int mode;){
static struct stat st;
memzero(f, sizeof(*f));
@ -918,8 +918,8 @@ initfile __PARAM__((register Archive_t* ap, register File_t* f, register char* n
*/
void
setfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register Post_t* p;
setfile __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
Post_t* p;
Post_t post;
if (!ap->pass) switch (f->type)
@ -967,8 +967,8 @@ settime __PARAM__((const char* name, time_t atime, time_t mtime), (name, atime,
*/
int
restore __PARAM__((register const char* name, char* ap, __V_* handle), (name, ap, handle)) __OTORP__(register const char* name; char* ap; __V_* handle;){
register Post_t* p = (Post_t*)ap;
restore __PARAM__((const char* name, char* ap, __V_* handle), (name, ap, handle)) __OTORP__(const char* name; char* ap; __V_* handle;){
Post_t* p = (Post_t*)ap;
int m;
struct stat st;
@ -1004,7 +1004,7 @@ restore __PARAM__((register const char* name, char* ap, __V_* handle), (name, ap
*/
int
prune __PARAM__((register Archive_t* ap, register File_t* f, register struct stat* st), (ap, f, st)) __OTORP__(register Archive_t* ap; register File_t* f; register struct stat* st;){
prune __PARAM__((Archive_t* ap, File_t* f, struct stat* st), (ap, f, st)) __OTORP__(Archive_t* ap; File_t* f; struct stat* st;){
if (st->st_mode == f->st->st_mode && (ap->delta && f->st->st_mtime == st->st_mtime || state.update && (unsigned long)f->st->st_mtime <= (unsigned long)st->st_mtime))
return(1);
return(0);
@ -1017,10 +1017,10 @@ prune __PARAM__((register Archive_t* ap, register File_t* f, register struct sta
ssize_t
holewrite __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(int fd; __V_* buf; size_t siz;){
register char* t = (char*)buf;
register char* e = t + siz;
register char* b = 0;
register char* s;
char* t = (char*)buf;
char* e = t + siz;
char* b = 0;
char* s;
ssize_t i;
ssize_t n = 0;

View file

@ -123,7 +123,7 @@ delta_hi __PARAM__((long x), (x)) __OTORP__(long x;){
*/
static int
isalar __PARAM__((Archive_t* ap, register char* hdr), (ap, hdr)) __OTORP__(Archive_t* ap; register char* hdr;){
isalar __PARAM__((Archive_t* ap, char* hdr), (ap, hdr)) __OTORP__(Archive_t* ap; char* hdr;){
char buf[4];
if (!strneq(hdr, "VOL1", 4))
@ -147,7 +147,7 @@ isalar __PARAM__((Archive_t* ap, register char* hdr), (ap, hdr)) __OTORP__(Archi
*/
int
getprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
getprologue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
int n;
long size;
@ -297,7 +297,7 @@ getprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
*/
static void
setinfo __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
setinfo __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
long n;
if (ap->delta)
@ -318,8 +318,8 @@ setinfo __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/
static void
putinfo __PARAM__((register Archive_t* ap, char* file, unsigned long mtime, unsigned long checksum), (ap, file, mtime, checksum)) __OTORP__(register Archive_t* ap; char* file; unsigned long mtime; unsigned long checksum;){
register File_t* f = &ap->file;
putinfo __PARAM__((Archive_t* ap, char* file, unsigned long mtime, unsigned long checksum), (ap, file, mtime, checksum)) __OTORP__(Archive_t* ap; char* file; unsigned long mtime; unsigned long checksum;){
File_t* f = &ap->file;
Sfio_t* np = 0;
if (!file)
@ -350,7 +350,7 @@ putinfo __PARAM__((register Archive_t* ap, char* file, unsigned long mtime, unsi
*/
void
putprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
putprologue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
if (ap->delta && ap->delta->version == DELTA_88)
ap->checksum = ap->old.checksum;
switch (ap->format)
@ -413,10 +413,10 @@ putprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
*/
void
getepilogue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register char* s;
register long n;
register long i;
getepilogue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
char* s;
long n;
long i;
if (ap->delta && ap->delta->epilogue < 0)
error(3, "%s: corrupt archive: missing epilogue", ap->name);
@ -491,9 +491,9 @@ getepilogue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
*/
void
putepilogue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){
register long n;
register unsigned long boundary;
putepilogue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
long n;
unsigned long boundary;
static int selected;
@ -571,10 +571,10 @@ static char* ops = opsbuf; /* opsbuf output pointer */
*/
static void
getxops __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* p;
register char* s;
register int c;
getxops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* p;
char* s;
int c;
long n;
if (f->namesize > (n = strlen(f->name) + 1)) for (p = f->name + n; c = *p++;)
@ -613,8 +613,8 @@ getxops __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/
static void
setxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive_t* ap; register File_t* f;){
register int n;
setxops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
NoP(ap);
if (n = ops - opsbuf)
@ -630,8 +630,8 @@ setxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archiv
*/
static void
putxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive_t* ap; register File_t* f;){
register int n;
putxops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
n = ops - opsbuf;
bwrite(ap, f->name, f->namesize -= n);
@ -644,9 +644,9 @@ putxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archiv
*/
static void
addxopstr __PARAM__((Archive_t* ap, int op, register char* s), (ap, op, s)) __OTORP__(Archive_t* ap; int op; register char* s;){
register char* p = ops;
register char* e = opsbuf + sizeof(opsbuf) - 3;
addxopstr __PARAM__((Archive_t* ap, int op, char* s), (ap, op, s)) __OTORP__(Archive_t* ap; int op; char* s;){
char* p = ops;
char* e = opsbuf + sizeof(opsbuf) - 3;
NoP(ap);
if (p < e)
@ -681,7 +681,7 @@ addxopnum __PARAM__((Archive_t* ap, int op, long n), (ap, op, n)) __OTORP__(Arch
static void
getkeyname __PARAM__((Archive_t* ap, File_t* f, int index, char** nm), (ap, f, index, nm)) __OTORP__(Archive_t* ap; File_t* f; int index; char** nm;){
register Option_t* op;
Option_t* op;
static int uinit;
static int ginit;
@ -725,7 +725,7 @@ getkeyname __PARAM__((Archive_t* ap, File_t* f, int index, char** nm), (ap, f, i
static void
getkeytime __PARAM__((Archive_t* ap, File_t* f, int index, time_t* tm), (ap, f, index, tm)) __OTORP__(Archive_t* ap; File_t* f; int index; time_t* tm;){
register Option_t* op;
Option_t* op;
NoP(f);
op = &options[index];
@ -745,10 +745,10 @@ getkeytime __PARAM__((Archive_t* ap, File_t* f, int index, time_t* tm), (ap, f,
*/
int
getheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
register int i;
register long n;
getheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
int i;
long n;
char* t;
long num;
int warned;
@ -1587,9 +1587,9 @@ getheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTO
static void
putkey __PARAM__((Sfio_t* sp, Sfio_t* tp, const char* name, int op, const char* value), (sp, tp, name, op, value)) __OTORP__(Sfio_t* sp; Sfio_t* tp; const char* name; int op; const char* value;){
register const char* s;
register int c;
register int n;
const char* s;
int c;
int n;
sfprintf(tp, " %s", name);
if (op) sfputc(tp, op);
@ -1651,9 +1651,9 @@ putkey __PARAM__((Sfio_t* sp, Sfio_t* tp, const char* name, int op, const char*
*/
void
putheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register char* s;
register int n;
putheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* s;
int n;
int c;
setdeltaheader(ap, f);
@ -2059,8 +2059,8 @@ putheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTO
*/
void
gettrailer __PARAM__((register Archive_t* ap, File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; File_t* f;){
register long n;
gettrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
long n;
NoP(f);
if (ap->sum-- > 0)
@ -2080,8 +2080,8 @@ gettrailer __PARAM__((register Archive_t* ap, File_t* f), (ap, f)) __OTORP__(reg
*/
void
puttrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register int n;
puttrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n;
putdeltatrailer(ap, f);
switch (ap->format)
@ -2112,9 +2112,9 @@ puttrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OT
*/
int
getlabel __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register int c;
register int n;
getlabel __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int c;
int n;
static char last[5];
static int done;
@ -2151,7 +2151,7 @@ getlabel __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTOR
*/
void
putlabels __PARAM__((register Archive_t* ap, register File_t* f, char* type), (ap, f, type)) __OTORP__(register Archive_t* ap; register File_t* f; char* type;){
putlabels __PARAM__((Archive_t* ap, File_t* f, char* type), (ap, f, type)) __OTORP__(Archive_t* ap; File_t* f; char* type;){
struct tm* tm;
static int section = 1;
@ -2192,9 +2192,9 @@ putlabels __PARAM__((register Archive_t* ap, register File_t* f, char* type), (a
*/
int
getsaveset __PARAM__((register Archive_t* ap, register File_t* f, int header), (ap, f, header)) __OTORP__(register Archive_t* ap; register File_t* f; int header;){
register char* p;
register char* s;
getsaveset __PARAM__((Archive_t* ap, File_t* f, int header), (ap, f, header)) __OTORP__(Archive_t* ap; File_t* f; int header;){
char* p;
char* s;
char* t;
int i;
long n;

View file

@ -100,8 +100,8 @@
*/
int
getformat __PARAM__((register char* name), (name)) __OTORP__(register char* name;){
register int i;
getformat __PARAM__((char* name), (name)) __OTORP__(char* name;){
int i;
strlower(name);
for (i = 0; format[i].name; i++)
@ -115,9 +115,9 @@ getformat __PARAM__((register char* name), (name)) __OTORP__(register char* name
*/
static int
pathcmp __PARAM__((register const char* s, register const char* t), (s, t)) __OTORP__(register const char* s; register const char* t;){
register int sc;
register int tc;
pathcmp __PARAM__((const char* s, const char* t), (s, t)) __OTORP__(const char* s; const char* t;){
int sc;
int tc;
for (;;)
{
@ -150,9 +150,9 @@ ordered __PARAM__((Archive_t* ap, const char* prv, const char* cur), (ap, prv, c
*/
int
selectfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){
register Archive_t* bp;
register Member_t* d;
selectfile __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
Archive_t* bp;
Member_t* d;
int linked = 0;
if (f->skip || f->namesize <= 1)
@ -200,8 +200,8 @@ selectfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OT
addlink(ap, f);
if (state.ordered && ap->delta && ap->delta->format != COMPRESS && (bp = ap->delta->base))
{
register int n;
register int m;
int n;
int m;
for (;;)
{
@ -266,9 +266,9 @@ selectfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OT
*/
int
verify __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive_t* ap; register File_t* f;){
register char* prompt;
register char* name;
verify __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
char* prompt;
char* name;
NoP(ap);
if (state.yesno) switch (state.operation)
@ -313,8 +313,8 @@ verify __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive
*/
char*
map __PARAM__((register char* name), (name)) __OTORP__(register char* name;){
register Map_t* mp;
map __PARAM__((char* name), (name)) __OTORP__(char* name;){
Map_t* mp;
char* to;
char* from;
@ -347,12 +347,12 @@ typedef struct
*/
static int
listlookup __PARAM__((__V_* handle, register const char* name, const char* arg, int cc, char** ps, long* pn), (handle, name, arg, cc, ps, pn)) __OTORP__(__V_* handle; register const char* name; const char* arg; int cc; char** ps; long* pn;){
listlookup __PARAM__((__V_* handle, const char* name, const char* arg, int cc, char** ps, long* pn), (handle, name, arg, cc, ps, pn)) __OTORP__(__V_* handle; const char* name; const char* arg; int cc; char** ps; long* pn;){
List_handle_t* gp = (List_handle_t*)handle;
register File_t* f = gp->file;
register struct stat* st = f->st;
register char* s = 0;
register long n = 0;
File_t* f = gp->file;
struct stat* st = f->st;
char* s = 0;
long n = 0;
Option_t* op;
static Sfio_t* mp;
@ -573,7 +573,7 @@ listprintf __PARAM__((Sfio_t* sp, Archive_t* ap, File_t* f, const char* format),
*/
void
listentry __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
listentry __PARAM__((File_t* f), (f)) __OTORP__(File_t* f;){
if (!f->extended && !f->skip && (state.drop || state.list || state.verbose))
{
if (state.drop)
@ -599,7 +599,7 @@ listentry __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
char**
initmatch __PARAM__((char** p), (p)) __OTORP__(char** p;){
register char** a;
char** a;
a = p;
while (*a)
@ -612,9 +612,9 @@ initmatch __PARAM__((char** p), (p)) __OTORP__(char** p;){
*/
int
match __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
register char** p;
register char* t;
match __PARAM__((char* s), (s)) __OTORP__(char* s;){
char** p;
char* t;
int n;
if (!(p = state.patterns)) return(state.matchsense);
@ -646,7 +646,7 @@ match __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
*/
int
dirprefix __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(register char* p; register char* s;){
dirprefix __PARAM__((char* p, char* s), (p, s)) __OTORP__(char* p; char* s;){
if (*p == '.' && !*(p + 1) && *s != '/' && (*s != '.' || *(s + 1) != '.' || *(s + 2) && *(s + 2) != '/'))
return(1);
if (*p == '/' && !*(p + 1))
@ -663,8 +663,8 @@ dirprefix __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(regi
int
portable __PARAM__((const char* s), (s)) __OTORP__(const char* s;){
register unsigned char* u = (unsigned char*)s;
register int c;
unsigned char* u = (unsigned char*)s;
int c;
while (c = *s++)
if (c > 0177)

View file

@ -117,10 +117,10 @@ static const char id[] = "\n@(#)nocom (AT&T Bell Laboratories) 08/11/94\0\n";
*/
static void
nocom __PARAM__((register Sfio_t* sp, char* file), (sp, file)) __OTORP__(register Sfio_t* sp; char* file;){
register int c = 0;
register int p;
register int data = 0;
nocom __PARAM__((Sfio_t* sp, char* file), (sp, file)) __OTORP__(Sfio_t* sp; char* file;){
int c = 0;
int p;
int data = 0;
int sync = 0;
unsigned long line = 0;
unsigned long prev = 0;
@ -403,9 +403,9 @@ nocom __PARAM__((register Sfio_t* sp, char* file), (sp, file)) __OTORP__(registe
}
main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){
register int c;
register char* s;
register Sfio_t* sp;
int c;
char* s;
Sfio_t* sp;
NoP(argc);
error_info.id = "nocom";

View file

@ -777,9 +777,9 @@ interrupt __PARAM__((int sig), (sig)) __OTORP__(int sig;){
*/
static void
substitute __PARAM__((Map_t** lastmap, register char* s), (lastmap, s)) __OTORP__(Map_t** lastmap; register char* s;){
register Map_t* mp;
register int n;
substitute __PARAM__((Map_t** lastmap, char* s), (lastmap, s)) __OTORP__(Map_t** lastmap; char* s;){
Map_t* mp;
int n;
char* p;
for (;;)
@ -845,9 +845,9 @@ substitute __PARAM__((Map_t** lastmap, register char* s), (lastmap, s)) __OTORP_
static void
help __PARAM__((void), ()){
register char* s;
register char* e;
register Sfio_t* sp;
char* s;
char* e;
Sfio_t* sp;
int n;
sp = sfstropen();
@ -880,7 +880,7 @@ help __PARAM__((void), ()){
*/
int
setoption __PARAM__((__V_* a, const __V_* p, register int n, register const char* v), (a, p, n, v)) __OTORP__(__V_* a; const __V_* p; register int n; register const char* v;){
setoption __PARAM__((__V_* a, const __V_* p, int n, const char* v), (a, p, n, v)) __OTORP__(__V_* a; const __V_* p; int n; const char* v;){
int c;
char* e;
char* s;
@ -1358,7 +1358,7 @@ setoption __PARAM__((__V_* a, const __V_* p, register int n, register const char
static void
ignore __PARAM__((void), ()){
register Option_t* op;
Option_t* op;
Hash_position_t* pos;
char* all;
char* ext;
@ -1383,9 +1383,9 @@ ignore __PARAM__((void), ()){
int
main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){
register int i;
register char* s;
register Archive_t* ap;
int i;
char* s;
Archive_t* ap;
char* p;
Hash_position_t* pos;
Option_t* op;
@ -1845,10 +1845,10 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
void
finish __PARAM__((int code), (code)) __OTORP__(int code;){
register Archive_t* ap;
register char* x1 = &state.tmp.buffer[0];
register char* x2 = &state.tmp.buffer[state.buffersize / 2];
register unsigned long n;
Archive_t* ap;
char* x1 = &state.tmp.buffer[0];
char* x2 = &state.tmp.buffer[state.buffersize / 2];
unsigned long n;
while (state.proc)
{

View file

@ -123,9 +123,9 @@ do case $info in
cat > $tmp.c <<!
main()
{
register unsigned long i;
register unsigned long j;
register unsigned long k = 0;
unsigned long i;
unsigned long j;
unsigned long k = 0;
for (i = 0; i < 5000; i++)
for (j = 0; j < 50000; j++)
k += j;

View file

@ -125,7 +125,7 @@ extern __MANGLE__ void _exit __PROTO__((int));
int
atexit __PARAM__((void (*func)(void)), (func)) __OTORP__(void (*func)();){
register struct list* p;
struct list* p;
if (!(p = newof(0, struct list, 1, 0))) return(-1);
p->func = func;
@ -136,7 +136,7 @@ atexit __PARAM__((void (*func)(void)), (func)) __OTORP__(void (*func)();){
void
_ast_atexit __PARAM__((void), ()){
register struct list* p;
struct list* p;
while (p = funclist)
{

View file

@ -116,7 +116,7 @@ ast_getgroups __PARAM__((int len, gid_t* set), (len, set)) __OTORP__(int len; gi
#undef NGROUPS_MAX
#define NGROUPS_MAX 1
#endif
register int i;
int i;
int big[NGROUPS_MAX];
#else
#undef NGROUPS_MAX

View file

@ -105,10 +105,10 @@ NoN(memccpy)
*/
__V_*
memccpy __PARAM__((__V_* as1, const __V_* as2, register int c, size_t n), (as1, as2, c, n)) __OTORP__(__V_* as1; const __V_* as2; register int c; size_t n;){
register char* s1 = (char*)as1;
register const char* s2 = (char*)as2;
register const char* ep = s2 + n;
memccpy __PARAM__((__V_* as1, const __V_* as2, int c, size_t n), (as1, as2, c, n)) __OTORP__(__V_* as1; const __V_* as2; int c; size_t n;){
char* s1 = (char*)as1;
const char* s2 = (char*)as2;
const char* ep = s2 + n;
while (s2 < ep)
if ((*s1++ = *s2++) == c)

View file

@ -104,9 +104,9 @@ NoN(memchr)
*/
__V_*
memchr __PARAM__((const __V_* asp, register int c, size_t n), (asp, c, n)) __OTORP__(const __V_* asp; register int c; size_t n;){
register const char* sp = (char*)asp;
register const char* ep = sp + n;
memchr __PARAM__((const __V_* asp, int c, size_t n), (asp, c, n)) __OTORP__(const __V_* asp; int c; size_t n;){
const char* sp = (char*)asp;
const char* ep = sp + n;
while (sp < ep)
if (*sp++ == c)

View file

@ -100,9 +100,9 @@ NoN(memcmp)
int
memcmp __PARAM__((const __V_* ab1, const __V_* ab2, size_t n), (ab1, ab2, n)) __OTORP__(const __V_* ab1; const __V_* ab2; size_t n;){
register const unsigned char* b1 = (const unsigned char*)ab1;
register const unsigned char* b2 = (const unsigned char*)ab2;
register const unsigned char* e = b1 + n;
const unsigned char* b1 = (const unsigned char*)ab1;
const unsigned char* b2 = (const unsigned char*)ab2;
const unsigned char* e = b1 + n;
while (b1 < e)
if (*b1++ != *b2++)

View file

@ -113,9 +113,9 @@ memcpy __PARAM__((__V_* s1, __V_* s2, size_t n), (s1, s2, n)) __OTORP__(__V_* s1
#else
__V_*
memcpy __PARAM__((__V_* as1, const __V_* as2, register size_t n), (as1, as2, n)) __OTORP__(__V_* as1; const __V_* as2; register size_t n;){
register char* s1 = (char*)as1;
register const char* s2 = (const char*)as2;
memcpy __PARAM__((__V_* as1, const __V_* as2, size_t n), (as1, as2, n)) __OTORP__(__V_* as1; const __V_* as2; size_t n;){
char* s1 = (char*)as1;
const char* s2 = (const char*)as2;
while (n-- > 0)
*s1++ = *s2++;

View file

@ -99,9 +99,9 @@ NoN(memmove)
#else
__V_*
memmove __PARAM__((__V_* to, const __V_* from, register size_t n), (to, from, n)) __OTORP__(__V_* to; const __V_* from; register size_t n;){
register char* out = (char*)to;
register char* in = (char*)from;
memmove __PARAM__((__V_* to, const __V_* from, size_t n), (to, from, n)) __OTORP__(__V_* to; const __V_* from; size_t n;){
char* out = (char*)to;
char* in = (char*)from;
if (n <= 0) /* works if size_t is signed or not */
;

View file

@ -99,8 +99,8 @@ NoN(memset)
#else
__V_*
memset __PARAM__((__V_* asp, register int c, register size_t n), (asp, c, n)) __OTORP__(__V_* asp; register int c; register size_t n;){
register char* sp = (char*)asp;
memset __PARAM__((__V_* asp, int c, size_t n), (asp, c, n)) __OTORP__(__V_* asp; int c; size_t n;){
char* sp = (char*)asp;
while (n-- > 0)
*sp++ = c;

View file

@ -104,7 +104,7 @@ NoN(mkdir)
int
mkdir __PARAM__((const char* path, mode_t mode), (path, mode)) __OTORP__(const char* path; mode_t mode;){
register int n;
int n;
char* av[3];
static char* cmd[] = { "/bin/mkdir", "/usr/5bin/mkdir", 0 };

View file

@ -103,7 +103,7 @@ NoN(rmdir)
int
rmdir __PARAM__((const char* path), (path)) __OTORP__(const char* path;){
register int n;
int n;
struct stat st;
char* av[3];

View file

@ -104,10 +104,10 @@ typedef struct
} Locale_t;
char*
_ast_setlocale __PARAM__((register int category, const char* locale), (category, locale)) __OTORP__(register int category; const char* locale;){
_ast_setlocale __PARAM__((int category, const char* locale), (category, locale)) __OTORP__(int category; const char* locale;){
#if _hdr_locale && _lib_setlocale
register Locale_t* lc;
register char* p;
Locale_t* lc;
char* p;
static Locale_t def[] =
{

View file

@ -176,9 +176,9 @@ spawnveg __PARAM__((const char* cmd, char* const argv[], char* const envv[], pid
execve(cmd, argv, envv);
if (errno == ENOEXEC)
{
register char** o;
register char** p;
register char** v;
char** o;
char** p;
char** v;
for (p = o = (char**)argv; *p; p++);
if (v = newof(0, char*, p - o + 2, 0))

View file

@ -126,7 +126,7 @@ NoN(statvfs)
#endif
static void
us2v __PARAM__((register struct statfs* ufs, register struct stat* st, register struct statvfs* vfs), (ufs, st, vfs)) __OTORP__(register struct statfs* ufs; register struct stat* st; register struct statvfs* vfs;){
us2v __PARAM__((struct statfs* ufs, struct stat* st, struct statvfs* vfs), (ufs, st, vfs)) __OTORP__(struct statfs* ufs; struct stat* st; struct statvfs* vfs;){
memset(vfs, 0, sizeof(*vfs));
vfs->f_bsize = vfs->f_frsize = ufs->f_bsize;
vfs->f_blocks = ufs->f_blocks;
@ -171,7 +171,7 @@ statvfs __PARAM__((const char* path, struct statvfs* vfs), (path, vfs)) __OTORP_
#else
static void
s2v __PARAM__((register struct stat* st, register struct statvfs* vfs), (st, vfs)) __OTORP__(register struct stat* st; register struct statvfs* vfs;){
s2v __PARAM__((struct stat* st, struct statvfs* vfs), (st, vfs)) __OTORP__(struct stat* st; struct statvfs* vfs;){
memset(vfs, 0, sizeof(*vfs));
vfs->f_bsize = vfs->f_frsize =
#if _mem_st_blksize_stat

View file

@ -114,7 +114,7 @@ strchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c;
#else
char*
strchr __PARAM__((register const char* s, register int c), (s, c)) __OTORP__(register const char* s; register int c;){
strchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c;){
do if (*s == c) return((char*)s); while(*s++);
return(0);
}

View file

@ -114,8 +114,8 @@ strrchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c
#else
char*
strrchr __PARAM__((register const char* s, register int c), (s, c)) __OTORP__(register const char* s; register int c;){
register const char* r;
strrchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c;){
const char* r;
r = 0;
do if (*s == c) r = s; while(*s++);

View file

@ -103,7 +103,7 @@ NoN(strtod)
extern __MANGLE__ double atof __PROTO__((const char*));
double
strtod __PARAM__((register const char* s, char** e), (s, e)) __OTORP__(register const char* s; char** e;){
strtod __PARAM__((const char* s, char** e), (s, e)) __OTORP__(const char* s; char** e;){
double n;
n = atof(s);

View file

@ -106,9 +106,9 @@ NoN(strtol)
#define MBASE ('z' - 'a' + 1 + 10)
long
strtol __PARAM__((register const char* str, char** ptr, register int base), (str, ptr, base)) __OTORP__(register const char* str; char** ptr; register int base;){
register long val;
register int c;
strtol __PARAM__((const char* str, char** ptr, int base), (str, ptr, base)) __OTORP__(const char* str; char** ptr; int base;){
long val;
int c;
int xx, neg = 0;
if (ptr)

View file

@ -112,8 +112,8 @@ static char buf[L_tmpnam];
static char seed[] = { 'a', 'a', 'a', 0 };
char*
tmpnam __PARAM__((register char* p), (p)) __OTORP__(register char* p;){
register char* q;
tmpnam __PARAM__((char* p), (p)) __OTORP__(char* p;){
char* q;
if (!p) p = buf;
strcopy(strcopy(strcopy(p, P_tmpdir), seed), "XXXXXX");

View file

@ -157,9 +157,9 @@ struct zombie
pid_t
waitpid __PARAM__((pid_t pid, int* status, int flags), (pid, status, flags)) __OTORP__(pid_t pid; int* status; int flags;){
register struct zombie* zp;
register struct zombie* pp;
register int p;
struct zombie* zp;
struct zombie* pp;
int p;
int s;
#if !_lib_wait2 && !_lib_wait3
#if !defined(SIGCLD)

View file

@ -144,8 +144,8 @@ getdents __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(in
#else
#if _lib_dirread
{
register char* sp; /* system */
register struct dirent* up; /* user */
char* sp; /* system */
struct dirent* up; /* user */
char* u;
int n;
int m;
@ -187,10 +187,10 @@ getdents __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(in
#define MAXREC roundof(sizeof(*up)-sizeof(up->d_name)+sizeof(sp->d_name)+1,8)
register struct direct* sp; /* system */
register struct dirent* up; /* user */
register char* s;
register char* u;
struct direct* sp; /* system */
struct dirent* up; /* user */
char* s;
char* u;
int n;
int m;
char tmp[sizeof(sp->d_name) + 1];

View file

@ -103,9 +103,9 @@ static const char id_dir[] = "\n@(#)directory (AT&T Bell Laboratories) 04/01/93\
static DIR* freedirp; /* always keep one dirp */
DIR*
opendir __PARAM__((register const char* path), (path)) __OTORP__(register const char* path;){
register DIR* dirp = 0;
register int fd;
opendir __PARAM__((const char* path), (path)) __OTORP__(const char* path;){
DIR* dirp = 0;
int fd;
struct stat st;
if ((fd = open(path, 0)) < 0) return(0);
@ -138,7 +138,7 @@ opendir __PARAM__((register const char* path), (path)) __OTORP__(register const
}
void
closedir __PARAM__((register DIR* dirp), (dirp)) __OTORP__(register DIR* dirp;){
closedir __PARAM__((DIR* dirp), (dirp)) __OTORP__(DIR* dirp;){
if (dirp)
{
close(dirp->dd_fd);

View file

@ -99,8 +99,8 @@ NoN(readdir)
#else
struct dirent*
readdir __PARAM__((register DIR* dirp), (dirp)) __OTORP__(register DIR* dirp;){
register struct dirent* dp;
readdir __PARAM__((DIR* dirp), (dirp)) __OTORP__(DIR* dirp;){
struct dirent* dp;
for (;;)
{

View file

@ -99,7 +99,7 @@ NoN(seekdir)
#else
void
seekdir __PARAM__((register DIR* dirp, long loc), (dirp, loc)) __OTORP__(register DIR* dirp; long loc;){
seekdir __PARAM__((DIR* dirp, long loc), (dirp, loc)) __OTORP__(DIR* dirp; long loc;){
off_t base; /* file location of block */
off_t offset; /* offset within block */

View file

@ -134,12 +134,12 @@ typedef union
#define initfield(f,s) ((f)->first = (f)->delimiter = *((f)->next = (s)))
static char*
getfield __PARAM__((register Field_t* f, int restore), (f, restore)) __OTORP__(register Field_t* f; int restore;){
register char* s;
register int n;
register int c;
register int lp;
register int rp;
getfield __PARAM__((Field_t* f, int restore), (f, restore)) __OTORP__(Field_t* f; int restore;){
char* s;
int n;
int c;
int lp;
int rp;
char* b;
if (!f->delimiter)
@ -414,7 +414,7 @@ int aha = *f.next;
int
sfkeyprintf __PARAM__((Sfio_t* sp, __V_* handle, const char* format, Sf_key_lookup_t lookup, Sf_key_convert_t convert), (sp, handle, format, lookup, convert)) __OTORP__(Sfio_t* sp; __V_* handle; const char* format; Sf_key_lookup_t lookup; Sf_key_convert_t convert;){
register int i;
int i;
for (i = 0; i < elementsof(state.tmp); i++)
if (!state.tmp[i] && !(state.tmp[i] = sfstropen()))

View file

@ -118,9 +118,9 @@ extern __MANGLE__ int printf __PROTO__((const char*, ...));
main()
{
register int i;
register int j;
register int k;
int i;
int j;
int k;
int align0;
int align1;

View file

@ -111,7 +111,7 @@ main()
#if _lib_getgroups
if (sizeof(gid_t) < sizeof(int))
{
register int n;
int n;
gid_t groups[32 * sizeof(int) / sizeof(gid_t)];
for (n = 0; n < sizeof(int) / sizeof(gid_t); n++)

View file

@ -132,9 +132,9 @@ static int size[] = { 1, 2, 4, 8 };
main()
{
register int t;
register int s;
register int m = 1;
int t;
int s;
int m = 1;
for (s = 0; s < elementsof(size); s++)
{

View file

@ -154,8 +154,8 @@ static char* cmd[] = { "/bin/echo", 0 };
main()
{
register int i;
register int n;
int i;
int n;
char c;
unsigned char uc;

View file

@ -258,9 +258,9 @@ extern __MANGLE__ int printf __PROTO__((const char*, ...));
main()
{
register int i;
register int j;
register int k;
int i;
int j;
int k;
k = 0;
for (i = 0; map[i].name; i++)

View file

@ -110,9 +110,9 @@ extern __MANGLE__ int printf __PROTO__((const char*, ...));
main()
{
register int i;
register int j;
register int k;
int i;
int j;
int k;
int align0;
int align1;

View file

@ -103,7 +103,7 @@ main()
#if _lib_getgroups
if (sizeof(gid_t) < sizeof(int))
{
register int n;
int n;
gid_t groups[32 * sizeof(int) / sizeof(gid_t)];
for (n = 0; n < sizeof(int) / sizeof(gid_t); n++)

View file

@ -124,9 +124,9 @@ static int size[] = { 1, 2, 4, 8 };
main()
{
register int t;
register int s;
register int m = 1;
int t;
int s;
int m = 1;
for (s = 0; s < elementsof(size); s++)
{

Some files were not shown because too many files have changed in this diff Show more