aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-11-18 03:54:06 +0100
committerDuncaen <mail@duncano.de>2017-11-18 03:54:06 +0100
commitb4d9b85f62cd7552610de698f0589b9c8f0c156b (patch)
tree477bc7098266be9c6a5aedc9a5c4da3894e13213
parent37af89734012f9b891b24194554f7bbe6dd29192 (diff)
downloadlobase-b4d9b85f62cd7552610de698f0589b9c8f0c156b.tar.gz
usr.bin/awk: update to OPENBSD_6_2
-rw-r--r--usr.bin/awk/Makefile5
-rw-r--r--usr.bin/awk/awk.h8
-rw-r--r--usr.bin/awk/b.c6
-rw-r--r--usr.bin/awk/lib.c30
-rw-r--r--usr.bin/awk/main.c10
-rw-r--r--usr.bin/awk/parse.c4
-rw-r--r--usr.bin/awk/proto.h2
-rw-r--r--usr.bin/awk/run.c34
-rw-r--r--usr.bin/awk/tran.c20
9 files changed, 61 insertions, 58 deletions
diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile
index 0b3503b..85a4d8d 100644
--- a/usr.bin/awk/Makefile
+++ b/usr.bin/awk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.14 2013/08/18 22:06:44 miod Exp $
+# $OpenBSD: Makefile,v 1.16 2017/07/10 21:30:37 espie Exp $
.TOPDIR?=../..
@@ -13,6 +13,9 @@ HOSTCFLAGS+=-I. -I${.CURDIR} -DHAS_ISBLANK -DNDEBUG
# XXX: replace with make depends
lex.o b.o main.o tran.o run.o parse.o lib.o : ytab.h
+# XXX: add BUILDFIRST to mk/prog.bsd.mk
+BUILDFIRST = ytab.h
+
ytab.c: awkgram.y
@echo ${YACC} -d awkgram.y
@${YACC} -d ${.CURDIR}/awkgram.y
diff --git a/usr.bin/awk/awk.h b/usr.bin/awk/awk.h
index 49fbcbe..4f535f6 100644
--- a/usr.bin/awk/awk.h
+++ b/usr.bin/awk/awk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: awk.h,v 1.13 2008/10/06 20:38:33 millert Exp $ */
+/* $OpenBSD: awk.h,v 1.14 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -33,14 +33,14 @@ typedef unsigned char uschar;
#define xfree(a) { if ((a) != NULL) { free((void *) (a)); (a) = NULL; } }
-#define NN(p) ((p) ? (p) : "(null)") /* guaranteed non-null for dprintf
+#define NN(p) ((p) ? (p) : "(null)") /* guaranteed non-null for DPRINTF
*/
#define DEBUG
#ifdef DEBUG
/* uses have to be doubly parenthesized */
-# define dprintf(x) if (dbg) printf x
+# define DPRINTF(x) if (dbg) printf x
#else
-# define dprintf(x)
+# define DPRINTF(x)
#endif
extern int compile_time; /* 1 if compiling, 0 if running */
diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c
index 28ac2d6..cfc0a57 100644
--- a/usr.bin/awk/b.c
+++ b/usr.bin/awk/b.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: b.c,v 1.18 2014/12/19 19:28:55 deraadt Exp $ */
+/* $OpenBSD: b.c,v 1.19 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -327,7 +327,7 @@ char *cclenter(const char *argp) /* add a character class */
i++;
}
*bp = 0;
- dprintf( ("cclenter: in = |%s|, out = |%s|\n", op, buf) );
+ DPRINTF( ("cclenter: in = |%s|, out = |%s|\n", op, buf) );
xfree(op);
return (char *) tostring((char *) buf);
}
@@ -611,7 +611,7 @@ Node *reparse(const char *p) /* parses regular expression pointed to by p */
{ /* uses relex() to scan regular expression */
Node *np;
- dprintf( ("reparse <%s>\n", p) );
+ DPRINTF( ("reparse <%s>\n", p) );
lastre = prestr = (uschar *) p; /* prestr points to string to be parsed */
rtok = relex();
/* GNU compatibility: an empty regexp matches anything */
diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c
index 9d2b28b..2a40a02 100644
--- a/usr.bin/awk/lib.c
+++ b/usr.bin/awk/lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib.c,v 1.22 2016/04/12 19:43:38 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.24 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -120,7 +120,7 @@ int getrec(char **pbuf, int *pbufsize, int isrecord) /* get next input record */
firsttime = 0;
initgetrec();
}
- dprintf( ("RS=<%s>, FS=<%s>, ARGC=%g, FILENAME=%s\n",
+ DPRINTF( ("RS=<%s>, FS=<%s>, ARGC=%g, FILENAME=%s\n",
*RS, *FS, *ARGC, *FILENAME) );
if (isrecord) {
donefld = 0;
@@ -129,7 +129,7 @@ int getrec(char **pbuf, int *pbufsize, int isrecord) /* get next input record */
saveb0 = buf[0];
buf[0] = 0;
while (argno < *ARGC || infile == stdin) {
- dprintf( ("argno=%d, file=|%s|\n", argno, file) );
+ DPRINTF( ("argno=%d, file=|%s|\n", argno, file) );
if (infile == NULL) { /* have to open a new file */
file = getargv(argno);
if (file == NULL || *file == '\0') { /* deleted or zapped */
@@ -142,7 +142,7 @@ int getrec(char **pbuf, int *pbufsize, int isrecord) /* get next input record */
continue;
}
*FILENAME = file;
- dprintf( ("opening file %s\n", file) );
+ DPRINTF( ("opening file %s\n", file) );
if (*file == '-' && *(file+1) == '\0')
infile = stdin;
else if ((infile = fopen(file, "r")) == NULL)
@@ -223,7 +223,7 @@ int readrec(char **pbuf, int *pbufsize, FILE *inf) /* read one record into buf *
if (!adjbuf(&buf, &bufsize, 1+rr-buf, recsize, &rr, "readrec 3"))
FATAL("input record `%.30s...' too long", buf);
*rr = 0;
- dprintf( ("readrec saw <%s>, returns %d\n", buf, c == EOF && rr == buf ? 0 : 1) );
+ DPRINTF( ("readrec saw <%s>, returns %d\n", buf, c == EOF && rr == buf ? 0 : 1) );
*pbuf = buf;
*pbufsize = bufsize;
return c == EOF && rr == buf ? 0 : 1;
@@ -240,7 +240,7 @@ char *getargv(int n) /* get ARGV[n] */
return NULL;
x = setsymtab(temp, "", 0.0, STR, ARGVtab);
s = getsval(x);
- dprintf( ("getargv(%d) returns |%s|\n", n, s) );
+ DPRINTF( ("getargv(%d) returns |%s|\n", n, s) );
return s;
}
@@ -259,7 +259,7 @@ void setclvar(char *s) /* set var=value from s */
q->fval = atof(q->sval);
q->tval |= NUM;
}
- dprintf( ("command line set %s to |%s|\n", s, p) );
+ DPRINTF( ("command line set %s to |%s|\n", s, p) );
}
@@ -437,7 +437,7 @@ int refldbld(const char *rec, const char *fs) /* build fields from reg expr in F
if (*rec == '\0')
return 0;
pfa = makedfa(fs, 1);
- dprintf( ("into refldbld, rec = <%s>, pat = <%s>\n", rec, fs) );
+ DPRINTF( ("into refldbld, rec = <%s>, pat = <%s>\n", rec, fs) );
tempstat = pfa->initstat;
for (i = 1; ; i++) {
if (i > nfields)
@@ -446,16 +446,16 @@ int refldbld(const char *rec, const char *fs) /* build fields from reg expr in F
xfree(fldtab[i]->sval);
fldtab[i]->tval = FLD | STR | DONTFREE;
fldtab[i]->sval = fr;
- dprintf( ("refldbld: i=%d\n", i) );
+ DPRINTF( ("refldbld: i=%d\n", i) );
if (nematch(pfa, rec)) {
pfa->initstat = 2; /* horrible coupling to b.c */
- dprintf( ("match %s (%d chars)\n", patbeg, patlen) );
+ DPRINTF( ("match %s (%d chars)\n", patbeg, patlen) );
strncpy(fr, rec, patbeg-rec);
fr += patbeg - rec + 1;
*(fr-1) = '\0';
rec = patbeg + patlen;
} else {
- dprintf( ("no match %s\n", rec) );
+ DPRINTF( ("no match %s\n", rec) );
strlcpy(fr, rec, fields + fieldssize - fr);
pfa->initstat = tempstat;
break;
@@ -488,15 +488,15 @@ void recbld(void) /* create $0 from $1..$NF if necessary */
if (!adjbuf(&record, &recsize, 2+r-record, recsize, &r, "recbld 3"))
FATAL("built giant record `%.30s...'", record);
*r = '\0';
- dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) );
+ DPRINTF( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) );
if (freeable(fldtab[0]))
xfree(fldtab[0]->sval);
fldtab[0]->tval = REC | STR | DONTFREE;
fldtab[0]->sval = record;
- dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) );
- dprintf( ("recbld = |%s|\n", record) );
+ DPRINTF( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) );
+ DPRINTF( ("recbld = |%s|\n", record) );
donerec = 1;
}
@@ -592,7 +592,7 @@ void bcheck2(int n, int c1, int c2)
fprintf(stderr, "\t%d extra %c's\n", -n, c2);
}
-void FATAL(const char *fmt, ...)
+__dead void FATAL(const char *fmt, ...)
{
extern char *cmdname;
va_list varg;
diff --git a/usr.bin/awk/main.c b/usr.bin/awk/main.c
index 82996bc..2ff881b 100644
--- a/usr.bin/awk/main.c
+++ b/usr.bin/awk/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.19 2015/10/22 04:08:17 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.21 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -64,13 +64,13 @@ int main(int argc, char *argv[])
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */
+ cmdname = __progname;
if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) {
fprintf(stderr, "%s: pledge: incorrect arguments\n",
cmdname);
exit(1);
}
- cmdname = __progname;
if (argc == 1) {
fprintf(stderr, "usage: %s [-safe] [-V] [-d[n]] [-F fs] "
"[-v var=value] [prog | -f progfile]\n\tfile ...\n",
@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
exit(0);
FATAL("no program given");
}
- dprintf( ("program = |%s|\n", argv[1]) );
+ DPRINTF( ("program = |%s|\n", argv[1]) );
lexprog = argv[1];
argc--;
argv++;
@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
syminit();
compile_time = 1;
argv[0] = cmdname; /* put prog name at front of arglist */
- dprintf( ("argc=%d, argv[0]=%s\n", argc, argv[0]) );
+ DPRINTF( ("argc=%d, argv[0]=%s\n", argc, argv[0]) );
arginit(argc, argv);
if (!safe)
envinit(environ);
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
setlocale(LC_NUMERIC, ""); /* back to whatever it is locally */
if (fs)
*FS = qstring(fs, '\0');
- dprintf( ("errorflag=%d\n", errorflag) );
+ DPRINTF( ("errorflag=%d\n", errorflag) );
if (errorflag == 0) {
compile_time = 0;
run(winner);
diff --git a/usr.bin/awk/parse.c b/usr.bin/awk/parse.c
index c10aa44..8720d13 100644
--- a/usr.bin/awk/parse.c
+++ b/usr.bin/awk/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.6 2002/12/19 21:24:28 millert Exp $ */
+/* $OpenBSD: parse.c,v 1.7 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -251,7 +251,7 @@ void defn(Cell *v, Node *vl, Node *st) /* turn on FCN bit in definition, */
for (p = vl; p; p = p->nnext)
n++;
v->fval = n;
- dprintf( ("defining func %s (%d args)\n", v->nval, n) );
+ DPRINTF( ("defining func %s (%d args)\n", v->nval, n) );
}
int isarg(const char *s) /* is s in argument list for current function? */
diff --git a/usr.bin/awk/proto.h b/usr.bin/awk/proto.h
index 9058bdd..87c500e 100644
--- a/usr.bin/awk/proto.h
+++ b/usr.bin/awk/proto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proto.h,v 1.9 2011/09/28 19:27:18 millert Exp $ */
+/* $OpenBSD: proto.h,v 1.10 2017/09/25 17:36:35 krw Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c
index 26825fd..17dcf0c 100644
--- a/usr.bin/awk/run.c
+++ b/usr.bin/awk/run.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: run.c,v 1.40 2015/12/16 19:44:42 tb Exp $ */
+/* $OpenBSD: run.c,v 1.42 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -116,7 +116,7 @@ int adjbuf(char **pbuf, int *psiz, int minlen, int quantum, char **pbptr,
if (rminlen)
minlen += quantum - rminlen;
tbuf = (char *) realloc(*pbuf, minlen);
- dprintf( ("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, *pbuf, tbuf) );
+ DPRINTF( ("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, *pbuf, tbuf) );
if (tbuf == NULL) {
if (whatrtn)
FATAL("out of memory in %s", whatrtn);
@@ -243,17 +243,17 @@ Cell *call(Node **a, int n) /* function call. very kludgy and fragile */
for (ncall = 0, x = a[1]; x != NULL; x = x->nnext) /* args in call */
ncall++;
ndef = (int) fcn->fval; /* args in defn */
- dprintf( ("calling %s, %d args (%d in defn), fp=%d\n", s, ncall, ndef, (int) (fp-frame)) );
+ DPRINTF( ("calling %s, %d args (%d in defn), fp=%d\n", s, ncall, ndef, (int) (fp-frame)) );
if (ncall > ndef)
WARNING("function %s called with %d args, uses only %d",
s, ncall, ndef);
if (ncall + ndef > NARGS)
FATAL("function %s has %d arguments, limit %d", s, ncall+ndef, NARGS);
for (i = 0, x = a[1]; x != NULL; i++, x = x->nnext) { /* get call args */
- dprintf( ("evaluate args[%d], fp=%d:\n", i, (int) (fp-frame)) );
+ DPRINTF( ("evaluate args[%d], fp=%d:\n", i, (int) (fp-frame)) );
y = execute(x);
oargs[i] = y;
- dprintf( ("args[%d]: %s %f <%s>, t=%o\n",
+ DPRINTF( ("args[%d]: %s %f <%s>, t=%o\n",
i, NN(y->nval), y->fval, isarr(y) ? "(array)" : NN(y->sval), y->tval) );
if (isfcn(y))
FATAL("can't use function %s as argument in %s", y->nval, s);
@@ -281,9 +281,9 @@ Cell *call(Node **a, int n) /* function call. very kludgy and fragile */
fp->nargs = ndef; /* number defined with (excess are locals) */
fp->retval = gettemp();
- dprintf( ("start exec of %s, fp=%d\n", s, (int) (fp-frame)) );
+ DPRINTF( ("start exec of %s, fp=%d\n", s, (int) (fp-frame)) );
y = execute((Node *)(fcn->sval)); /* execute body */
- dprintf( ("finished exec of %s, fp=%d\n", s, (int) (fp-frame)) );
+ DPRINTF( ("finished exec of %s, fp=%d\n", s, (int) (fp-frame)) );
for (i = 0; i < ndef; i++) {
Cell *t = fp->args[i];
@@ -316,7 +316,7 @@ Cell *call(Node **a, int n) /* function call. very kludgy and fragile */
tempfree(y); /* don't free twice! */
}
z = fp->retval; /* return value */
- dprintf( ("%s returns %g |%s| %o\n", s, getfval(z), getsval(z), z->tval) );
+ DPRINTF( ("%s returns %g |%s| %o\n", s, getfval(z), getsval(z), z->tval) );
fp--;
return(z);
}
@@ -340,7 +340,7 @@ Cell *arg(Node **a, int n) /* nth argument of a function */
{
n = ptoi(a[0]); /* argument number, counting from 0 */
- dprintf( ("arg(%d), fp->nargs=%d\n", n, fp->nargs) );
+ DPRINTF( ("arg(%d), fp->nargs=%d\n", n, fp->nargs) );
if (n+1 > fp->nargs)
FATAL("argument #%d of function %s was not supplied",
n+1, fp->fcncell->nval);
@@ -476,7 +476,7 @@ Cell *array(Node **a, int n) /* a[0] is symtab, a[1] is list of subscripts */
tempfree(y);
}
if (!isarr(x)) {
- dprintf( ("making %s into an array\n", NN(x->nval)) );
+ DPRINTF( ("making %s into an array\n", NN(x->nval)) );
if (freeable(x))
xfree(x->sval);
x->tval &= ~(STR|NUM|DONTFREE);
@@ -540,7 +540,7 @@ Cell *intest(Node **a, int n) /* a[0] is index (list), a[1] is symtab */
ap = execute(a[1]); /* array name */
if (!isarr(ap)) {
- dprintf( ("making %s into an array\n", ap->nval) );
+ DPRINTF( ("making %s into an array\n", ap->nval) );
if (freeable(ap))
xfree(ap->sval);
ap->tval &= ~(STR|NUM|DONTFREE);
@@ -682,7 +682,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[1], etc. */
void tfree(Cell *a) /* free a tempcell */
{
if (freeable(a)) {
- dprintf( ("freeing %s %s %o\n", NN(a->nval), NN(a->sval), a->tval) );
+ DPRINTF( ("freeing %s %s %o\n", NN(a->nval), NN(a->sval), a->tval) );
xfree(a->sval);
}
if (a == tmps)
@@ -769,7 +769,7 @@ Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], a[2]) */
n = 0;
else if (n > k - m)
n = k - m;
- dprintf( ("substr: m=%d, n=%d, s=%s\n", m, n, s) );
+ DPRINTF( ("substr: m=%d, n=%d, s=%s\n", m, n, s) );
y = gettemp();
temp = s[n+m-1]; /* with thanks to John Linderman */
s[n+m-1] = '\0';
@@ -1237,7 +1237,7 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */
sep = *fs;
ap = execute(a[1]); /* array name */
freesymtab(ap);
- dprintf( ("split: s=|%s|, a=%s, sep=|%s|\n", s, NN(ap->nval), fs) );
+ DPRINTF( ("split: s=|%s|, a=%s, sep=|%s|\n", s, NN(ap->nval), fs) );
ap->tval &= ~STR;
ap->tval |= ARR;
ap->sval = (char *) makesymtab(NSYMTAB);
@@ -1545,7 +1545,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis
break;
case FXOR:
if (nextarg == 0) {
- WARNING("or requires two arguments; returning 0");
+ WARNING("xor requires two arguments; returning 0");
u = 0;
break;
}
@@ -1556,7 +1556,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis
break;
case FLSHIFT:
if (nextarg == 0) {
- WARNING("or requires two arguments; returning 0");
+ WARNING("lshift requires two arguments; returning 0");
u = 0;
break;
}
@@ -1567,7 +1567,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis
break;
case FRSHIFT:
if (nextarg == 0) {
- WARNING("or requires two arguments; returning 0");
+ WARNING("rshift requires two arguments; returning 0");
u = 0;
break;
}
diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c
index 6cc4c63..f9a72c0 100644
--- a/usr.bin/awk/tran.c
+++ b/usr.bin/awk/tran.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tran.c,v 1.15 2011/09/28 19:27:18 millert Exp $ */
+/* $OpenBSD: tran.c,v 1.16 2017/10/09 14:51:31 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -214,7 +214,7 @@ Cell *setsymtab(const char *n, const char *s, Awkfloat f, unsigned t, Array *tp)
Cell *p;
if (n != NULL && (p = lookup(n, tp)) != NULL) {
- dprintf( ("setsymtab found %p: n=%s s=\"%s\" f=%g t=%o\n",
+ DPRINTF( ("setsymtab found %p: n=%s s=\"%s\" f=%g t=%o\n",
(void*)p, NN(p->nval), NN(p->sval), p->fval, p->tval) );
return(p);
}
@@ -233,7 +233,7 @@ Cell *setsymtab(const char *n, const char *s, Awkfloat f, unsigned t, Array *tp)
h = hash(n, tp->size);
p->cnext = tp->tab[h];
tp->tab[h] = p;
- dprintf( ("setsymtab set %p: n=%s s=\"%s\" f=%g t=%o\n",
+ DPRINTF( ("setsymtab set %p: n=%s s=\"%s\" f=%g t=%o\n",
(void*)p, p->nval, p->sval, p->fval, p->tval) );
return(p);
}
@@ -292,7 +292,7 @@ Awkfloat setfval(Cell *vp, Awkfloat f) /* set float val of a Cell */
fldno = atoi(vp->nval);
if (fldno > *NF)
newfld(fldno);
- dprintf( ("setting field %d to %g\n", fldno, f) );
+ DPRINTF( ("setting field %d to %g\n", fldno, f) );
} else if (isrec(vp)) {
donefld = 0; /* mark $1... invalid */
donerec = 1;
@@ -301,7 +301,7 @@ Awkfloat setfval(Cell *vp, Awkfloat f) /* set float val of a Cell */
xfree(vp->sval); /* free any previous string */
vp->tval &= ~STR; /* mark string invalid */
vp->tval |= NUM; /* mark number ok */
- dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) );
+ DPRINTF( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) );
return vp->fval = f;
}
@@ -320,7 +320,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */
char *t;
int fldno;
- dprintf( ("starting setsval %p: %s = \"%s\", t=%o, r,f=%d,%d\n",
+ DPRINTF( ("starting setsval %p: %s = \"%s\", t=%o, r,f=%d,%d\n",
(void*)vp, NN(vp->nval), s, vp->tval, donerec, donefld) );
if ((vp->tval & (NUM | STR)) == 0)
funnyvar(vp, "assign to");
@@ -329,7 +329,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */
fldno = atoi(vp->nval);
if (fldno > *NF)
newfld(fldno);
- dprintf( ("setting field %d to %s (%p)\n", fldno, s, s) );
+ DPRINTF( ("setting field %d to %s (%p)\n", fldno, s, s) );
} else if (isrec(vp)) {
donefld = 0; /* mark $1... invalid */
donerec = 1;
@@ -340,7 +340,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */
vp->tval &= ~NUM;
vp->tval |= STR;
vp->tval &= ~DONTFREE;
- dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n",
+ DPRINTF( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n",
(void*)vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) );
return(vp->sval = t);
}
@@ -358,7 +358,7 @@ Awkfloat getfval(Cell *vp) /* get float val of a Cell */
if (is_number(vp->sval) && !(vp->tval&CON))
vp->tval |= NUM; /* make NUM only sparingly */
}
- dprintf( ("getfval %p: %s = %g, t=%o\n",
+ DPRINTF( ("getfval %p: %s = %g, t=%o\n",
(void*)vp, NN(vp->nval), vp->fval, vp->tval) );
return(vp->fval);
}
@@ -386,7 +386,7 @@ static char *get_str_val(Cell *vp, char **fmt) /* get string val of a Cel
vp->tval &= ~DONTFREE;
vp->tval |= STR;
}
- dprintf( ("getsval %p: %s = \"%s (%p)\", t=%o\n",
+ DPRINTF( ("getsval %p: %s = \"%s (%p)\", t=%o\n",
(void*)vp, NN(vp->nval), vp->sval, vp->sval, vp->tval) );
return(vp->sval);
}