-Wall -Werror -W -pedantic clean
This commit is contained in:
68
tree.c
68
tree.c
@ -1,4 +1,4 @@
|
||||
/** $MirBSD: tree.c,v 1.3 2004/09/21 11:57:16 tg Exp $ */
|
||||
/** $MirBSD: tree.c,v 1.4 2004/10/28 11:03:24 tg Exp $ */
|
||||
/* $OpenBSD: tree.c,v 1.10 2002/02/27 19:37:09 dhartmei Exp $ */
|
||||
|
||||
/*
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirBSD: tree.c,v 1.4 2004/10/28 11:03:24 tg Exp $");
|
||||
|
||||
#define INDENT 4
|
||||
|
||||
#define tputc(c, shf) shf_putchar(c, shf);
|
||||
@ -24,11 +26,11 @@ static void iofree ARGS((struct ioword **iow, Area *ap));
|
||||
|
||||
static void
|
||||
ptree(t, indent, shf)
|
||||
register struct op *t;
|
||||
struct op *t;
|
||||
int indent;
|
||||
register struct shf *shf;
|
||||
struct shf *shf;
|
||||
{
|
||||
register char **w;
|
||||
char **w;
|
||||
struct ioword **ioact;
|
||||
struct op *t1;
|
||||
|
||||
@ -211,9 +213,9 @@ ptree(t, indent, shf)
|
||||
|
||||
static void
|
||||
pioact(shf, indent, iop)
|
||||
register struct shf *shf;
|
||||
struct shf *shf;
|
||||
int indent;
|
||||
register struct ioword *iop;
|
||||
struct ioword *iop;
|
||||
{
|
||||
int flag = iop->flag;
|
||||
int type = flag & IOTYPE;
|
||||
@ -272,8 +274,8 @@ pioact(shf, indent, iop)
|
||||
|
||||
static void
|
||||
tputC(c, shf)
|
||||
register int c;
|
||||
register struct shf *shf;
|
||||
int c;
|
||||
struct shf *shf;
|
||||
{
|
||||
if ((c&0x60) == 0) { /* C0|C1 */
|
||||
tputc((c&0x80) ? '$' : '^', shf);
|
||||
@ -287,10 +289,10 @@ tputC(c, shf)
|
||||
|
||||
static void
|
||||
tputS(wp, shf)
|
||||
register char *wp;
|
||||
register struct shf *shf;
|
||||
char *wp;
|
||||
struct shf *shf;
|
||||
{
|
||||
register int c, quoted=0;
|
||||
int c, quoted=0;
|
||||
|
||||
/* problems:
|
||||
* `...` -> $(...)
|
||||
@ -415,17 +417,17 @@ snptreef(s, n, fmt, va_alist)
|
||||
|
||||
static void
|
||||
vfptreef(shf, indent, fmt, va)
|
||||
register struct shf *shf;
|
||||
struct shf *shf;
|
||||
int indent;
|
||||
const char *fmt;
|
||||
register va_list va;
|
||||
va_list va;
|
||||
{
|
||||
register int c;
|
||||
int c;
|
||||
|
||||
while ((c = *fmt++))
|
||||
if (c == '%') {
|
||||
register long n;
|
||||
register char *p;
|
||||
long n;
|
||||
char *p;
|
||||
int neg;
|
||||
|
||||
switch ((c = *fmt++)) {
|
||||
@ -442,9 +444,9 @@ vfptreef(shf, indent, fmt, va)
|
||||
tputS(p, shf);
|
||||
break;
|
||||
case 'd': case 'u': /* decimal */
|
||||
n = (c == 'd') ? va_arg(va, int)
|
||||
: va_arg(va, unsigned int);
|
||||
neg = c=='d' && n<0;
|
||||
n = (c == 'd') ? (long)(va_arg(va, int))
|
||||
: (long)(va_arg(va, unsigned int));
|
||||
neg = (c == 'd') && (n < 0);
|
||||
p = ulton((neg) ? -n : n, 10);
|
||||
if (neg)
|
||||
*--p = '-';
|
||||
@ -487,11 +489,11 @@ vfptreef(shf, indent, fmt, va)
|
||||
|
||||
struct op *
|
||||
tcopy(t, ap)
|
||||
register struct op *t;
|
||||
struct op *t;
|
||||
Area *ap;
|
||||
{
|
||||
register struct op *r;
|
||||
register char **tw, **rw;
|
||||
struct op *r;
|
||||
char **tw, **rw;
|
||||
|
||||
if (t == NULL)
|
||||
return NULL;
|
||||
@ -548,10 +550,10 @@ wdcopy(wp, ap)
|
||||
/* return the position of prefix c in wp plus 1 */
|
||||
char *
|
||||
wdscan(wp, c)
|
||||
register const char *wp;
|
||||
register int c;
|
||||
const char *wp;
|
||||
int c;
|
||||
{
|
||||
register int nest = 0;
|
||||
int nest = 0;
|
||||
|
||||
while (1)
|
||||
switch (*wp++) {
|
||||
@ -674,18 +676,18 @@ wdstrip(wp)
|
||||
|
||||
static struct ioword **
|
||||
iocopy(iow, ap)
|
||||
register struct ioword **iow;
|
||||
struct ioword **iow;
|
||||
Area *ap;
|
||||
{
|
||||
register struct ioword **ior;
|
||||
register int i;
|
||||
struct ioword **ior;
|
||||
int i;
|
||||
|
||||
for (ior = iow; *ior++ != NULL; )
|
||||
;
|
||||
ior = (struct ioword **) alloc((ior - iow + 1) * sizeof(*ior), ap);
|
||||
|
||||
for (i = 0; iow[i] != NULL; i++) {
|
||||
register struct ioword *p, *q;
|
||||
struct ioword *p, *q;
|
||||
|
||||
p = iow[i];
|
||||
q = (struct ioword *) alloc(sizeof(*p), ap);
|
||||
@ -709,10 +711,10 @@ iocopy(iow, ap)
|
||||
|
||||
void
|
||||
tfree(t, ap)
|
||||
register struct op *t;
|
||||
struct op *t;
|
||||
Area *ap;
|
||||
{
|
||||
register char **w;
|
||||
char **w;
|
||||
|
||||
if (t == NULL)
|
||||
return;
|
||||
@ -746,8 +748,8 @@ iofree(iow, ap)
|
||||
struct ioword **iow;
|
||||
Area *ap;
|
||||
{
|
||||
register struct ioword **iop;
|
||||
register struct ioword *p;
|
||||
struct ioword **iop;
|
||||
struct ioword *p;
|
||||
|
||||
for (iop = iow; (p = *iop++) != NULL; ) {
|
||||
if (p->name != NULL)
|
||||
|
Reference in New Issue
Block a user