made to work; contained too many dependencies on word/pointer size

This commit is contained in:
ceriel
1988-07-18 16:41:04 +00:00
parent 5c508b566f
commit ca51618fe9
8 changed files with 52 additions and 40 deletions

View File

@@ -10,6 +10,7 @@
static void rvalue(), assignable(), inputable(), outputable(), subscriptable();
static void assigned();
char *Malloc();
/* The new_* functions make use of the used() and assinged() functions to
* make known what is done to a variable.
@@ -89,7 +90,7 @@ struct expr *new_node(op, left, right, byte)
subscriptable(left, right, byte, &type, &arr_siz);
break;
}
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
pe->kind=E_NODE;
pe->type=type;
@@ -110,7 +111,7 @@ struct expr *new_var(var)
{
register struct expr *pe;
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
pe->kind=E_VAR;
@@ -133,7 +134,7 @@ struct expr *new_const(const)
{
register struct expr *pe;
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
pe->kind=E_CONST;
pe->type=T_VALUE;
@@ -152,7 +153,7 @@ struct expr *new_table(kind, tab)
{
register struct expr *pe;
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
pe->kind=kind;
pe->type=T_VALUE|T_ARR;
@@ -167,7 +168,7 @@ struct expr *new_table(kind, tab)
tab=tab->next;
pe->arr_siz++;
free(junk);
free((char *)junk);
}
return pe;
@@ -180,7 +181,7 @@ struct expr *copy_const(e) struct expr *e;
{
register struct expr *c;
c= (struct expr *) malloc(sizeof *c);
c= (struct expr *) Malloc(sizeof *c);
*c= *e;
return c;
@@ -191,7 +192,7 @@ struct expr *new_now()
{
register struct expr *pe;
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
pe->kind=E_NOW;
pe->type=T_VALUE;
@@ -213,7 +214,7 @@ struct expr *new_io(out, chan, args)
report("channel variable expected");
used(chan);
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
pe->kind=E_IO;
pe->type=T_VOID;
@@ -234,7 +235,7 @@ struct expr *new_call(proc, args)
{
register struct expr *pe;
pe= (struct expr *) malloc(sizeof *pe);
pe= (struct expr *) Malloc(sizeof *pe);
used(proc);
@@ -253,7 +254,7 @@ void table_add(aapt, val) register struct table ***aapt; long val;
{
register struct table *pt;
pt= (struct table *) malloc(sizeof *pt);
pt= (struct table *) Malloc(sizeof *pt);
pt->val=val;
pt->next= **aapt;
@@ -269,7 +270,7 @@ void expr_list_add(aaelp, arg)
{
register struct expr_list *elp;
elp= (struct expr_list *) malloc(sizeof *elp);
elp= (struct expr_list *) Malloc(sizeof *elp);
elp->arg=arg;
elp->next= **aaelp;
@@ -466,11 +467,11 @@ void destroy(e) register struct expr *e;
destroy(elp->arg);
junk=elp;
elp=elp->next;
free(junk);
free((char *)junk);
}
}
break;
}
free(e);
free((char *)e);
}
}