summaryrefslogtreecommitdiff
path: root/sys/src/cmd/awk/parse.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-04-28 20:53:53 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-04-28 20:53:53 +0200
commit4c21da2ededfb5fc628dbee0d75b0aa5263ef97b (patch)
tree1d3e8ab7c177b55c74e03c5f4c26f31b523abfbc /sys/src/cmd/awk/parse.c
parentca5b491753ad363da8d9deb5978b56231ec27bf5 (diff)
parenteb168924840977fe0941d4fc90e56db0d484a6e4 (diff)
merge
Diffstat (limited to 'sys/src/cmd/awk/parse.c')
-rw-r--r--sys/src/cmd/awk/parse.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/src/cmd/awk/parse.c b/sys/src/cmd/awk/parse.c
index 2ee6eca62..3e42d2ba7 100644
--- a/sys/src/cmd/awk/parse.c
+++ b/sys/src/cmd/awk/parse.c
@@ -22,10 +22,9 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-#define DEBUG
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
#include "awk.h"
#include "y.tab.h"
@@ -34,9 +33,9 @@ Node *nodealloc(int n)
Node *x;
x = (Node *) malloc(sizeof(Node) + (n-1)*sizeof(Node *));
- if (x == NULL)
+ if (x == nil)
FATAL("out of space in nodealloc");
- x->nnext = NULL;
+ x->nnext = nil;
x->lineno = lineno;
return(x);
}
@@ -220,11 +219,11 @@ Node *linkum(Node *a, Node *b)
if (errorflag) /* don't link things that are wrong */
return a;
- if (a == NULL)
+ if (a == nil)
return(b);
- else if (b == NULL)
+ else if (b == nil)
return(a);
- for (c = a; c->nnext != NULL; c = c->nnext)
+ for (c = a; c->nnext != nil; c = c->nnext)
;
c->nnext = b;
return(a);
@@ -245,7 +244,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) );
+ dprint( ("defining func %s (%d args)\n", v->nval, n) );
}
int isarg(char *s) /* is s in argument list for current function? */
@@ -262,7 +261,7 @@ int isarg(char *s) /* is s in argument list for current function? */
int ptoi(void *p) /* convert pointer to integer */
{
- return (int) (long) p; /* swearing that p fits, of course */
+ return (int) (vlong) p; /* swearing that p fits, of course */
}
Node *itonp(int i) /* and vice versa */