LDFLAGS=-i
CPPFLAGS=-DVERBOSE -DNOTCOMPACT
CFLAGS=$(CPPFLAGS) -O
-LINTFLAGS=-hbac
+LINTFLAGS=-hbu
+CFILES=\
+debug.c global.c files.c go.c map.c aux.c get.c put.c alloc.c lset.c\
+cset.c parser.c stack_chg.c locals.c init_glob.c
SRC=\
-types.h def.h debug.h debug.c global.h global.c files.h files.c go.h go.c\
-map.h map.c aux.h aux.c get.h get.c put.h put.c alloc.h alloc.c lset.h lset.c\
-cset.h cset.c parser.h parser.c stack_chg.h stack_chg.c locals.h locals.c\
-init_glob.h init_glob.c
+types.h def.h debug.h global.h files.h go.h map.h aux.h get.h put.h alloc.h\
+lset.h cset.h parser.h stack_chg.h locals.h init_glob.h $(CFILES)
PRFILES=$(SRC)
#include "alloc.h"
-short * myalloc();
-short * malloc();
+char * myalloc();
+char * calloc();
#ifdef DEBUG
STATIC unsigned maxuse, curruse;
-short *newcore(size)
+char *newcore(size)
int size;
{
if ((curruse += (unsigned) (size+2)) > maxuse) maxuse = curruse;
}
oldcore(p,size)
- short *p;
+ char *p;
int size;
{
curruse -= (size+2);
if (kind == OPLIST)
oldargs(ARG(lnp));
- oldcore((short *) lnp,lsizetab[kind]);
+ oldcore((char *) lnp,lsizetab[kind]);
}
arg_p newarg(kind) int kind; {
oldargb(ap->a_a.a_con.ac_con.ab_next);
break;
}
- oldcore((short *) ap,asizetab[ap->a_type]);
+ oldcore((char *) ap,asizetab[ap->a_type]);
ap = next;
}
}
while (abp != (argb_p) 0) {
next = abp->ab_next;
- oldcore((short *) abp,sizeof (argb_t));
+ oldcore((char *) abp,sizeof (argb_t));
abp = next;
}
}
while (op != (obj_p) 0) {
next = op->o_next;
- oldcore((short *) op, sizeof(struct obj));
+ oldcore((char *) op, sizeof(struct obj));
op = next;
}
}
olddblock(dbl) dblock_p dbl; {
oldobjects(dbl->d_objlist);
oldargs(dbl->d_values);
- oldcore((short *) dbl, sizeof(struct dblock));
+ oldcore((char *) dbl, sizeof(struct dblock));
}
return((short **) newcore((length+1) * sizeof(short *)));
}
+/*ARGSUSED1*/
oldmap(mp,length) short **mp, length; {
- oldcore((short *) mp, (length+1) * sizeof(short *));
+ oldcore((char *) mp, (length+1) * sizeof(short *));
}
*/
}
+/*ARGSUSED1*/
oldbitvect(s,n) cset s; short n; {
- oldcore((short *) s, (n-1)*sizeof(int) + sizeof(struct bitvector));
+ oldcore((char *) s, (n-1)*sizeof(int) + sizeof(struct bitvector));
}
return((short *) newcore((length+1) * sizeof(short)));
}
+/*ARGSUSED1*/
oldtable(mp,length) short **mp, length; {
- oldcore((short *) mp, (length+1) * sizeof(short));
+ oldcore((char *) mp, (length+1) * sizeof(short));
}
cond_p newcondtab(l) int l;
{
int i;
for (i = 0; tab[i].mc_cond != DEFAULT; i++);
- oldcore((short *) tab,((i+1) * sizeof (struct cond_tab)));
+ oldcore((char *) tab,((i+1) * sizeof (struct cond_tab)));
}
-short *myalloc(size) register size; {
- register short *p,*q;
+char *myalloc(size) register size; {
+ register char *p;
- p = malloc(size);
+ p = calloc((unsigned) size, 1);
if (p == 0)
error("out of memory");
- for(q=p;size>0;size -= sizeof(short))
- *q++ = 0;
return(p);
}
*/
#ifdef DEBUG
-extern short *newcore();
+extern char *newcore();
extern oldcore();
#else
-extern short *myalloc();
+extern char *myalloc();
#define newcore(size) myalloc(size)
-#define oldcore(p,size) free(p)
+#define oldcore(p,size) free((char *)p)
#endif
-#define newstruct(t) (newcore (sizeof (struct t)))
-#define oldstruct(t,p) oldcore((short *) p,sizeof (struct t))
+#define newstruct(t) ((struct t *) newcore (sizeof (struct t)))
+#define oldstruct(t,p) oldcore((char *) p,sizeof (struct t))
extern line_p newline(); /* (byte optype) */
extern arg_p newarg(); /* (byte argtype) */
case ms_reg:
if (ARG(lnp)->a_next != (arg_p) 0) {
/* take only "mes 3" with further arguments */
- Ladd(lnp,&mesregs);
+ Ladd((Lelem_t) lnp,&mesregs);
}
break;
case ms_err:
lp->lp_level = getshort(); /* nesting level */
lp->lp_entry = getblock(getshort()); /* entry block of the loop */
lp->lp_end = getblock(getshort()); /* tail of back edge of loop */
- Ladd(lp,&curproc->p_loops);
+ Ladd((Lelem_t)lp,&curproc->p_loops);
}
*g_out = head;
return TRUE;
}
+/*ARGSUSED1*/
Lindex Lnext(i,s)
Lindex i;
lset s;
outshort(i);
} else {
assert (sizeof(int) == sizeof(offset));
- outoff(i);
+ outoff((offset) i);
}
}
}
fclose(curoutp);
if (omap != (obj_p *) 0) {
- oldmap(omap,olength); /* release memory for omap */
+ oldmap((short **) omap,olength); /* release memory for omap */
}
}
}
fclose(curoutp);
if (pmap != (proc_p *) 0) {
- oldmap(pmap,plength); /* release memory for pmap */
+ oldmap((short **) pmap,plength); /* release memory for pmap */
}
}
oldbblock(b);
}
/* Release the memory for the lmap, lbmap, bmap, lpmap tables */
- if (lmap != (line_p *) 0) oldmap(lmap,llength);
- if (lbmap != (bblock_p *) 0) oldmap(lbmap,llength);
- if (bmap != (bblock_p *) 0) oldmap(bmap,blength);
- if (lpmap != (loop_p *) 0) oldmap(lpmap,lplength);
+ if (lmap != (line_p *) 0) oldmap((short **) lmap,llength);
+ if (lbmap != (bblock_p *) 0) oldmap((short **) lbmap,llength);
+ if (bmap != (bblock_p *) 0) oldmap((short **) bmap,blength);
+ if (lpmap != (loop_p *) 0) oldmap((short **) lpmap,lplength);
curoutp = lf;
}
fprintf(stderr,": ");
fprintf(stderr,s,a);
fprintf(stderr,"\n");
- abort();
exit(-1);
}
#define IS_CALLED_IN_LOOP(p) (p->p_flags1 & PF_CALINLOOP)
#define IS_ENTERED_WITH_GTO(p) (p->p_flags1 & PF_GTO)
#define ENTERED_WITH_GTO(p) p->p_flags1 |= PF_GTO
+#define BODY_KNOWN(p) (p->p_flags1 & (byte) PF_BODYSEEN)
/* LOOPS */
#define CF_INDIR 01
#define UF_INDIR 01
+#define CHANGE_INDIR(p) (p->p_change->c_flags & CF_INDIR)
/* SETS */