removed some lint complaints

This commit is contained in:
ceriel 1988-06-28 14:41:02 +00:00
parent 2f7e414d42
commit e64951e1d3
16 changed files with 34 additions and 20 deletions

View file

@ -4,7 +4,7 @@ PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-bx
CDIR=$(EMHOME)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o

View file

@ -4,7 +4,7 @@ PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-bx
CDIR=$(EMHOME)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o

View file

@ -4,7 +4,7 @@ PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-bx
CDIR=$(EMHOME)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o

View file

@ -4,7 +4,7 @@ PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-bx
CDIR=$(EMHOME)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o

View file

@ -354,7 +354,7 @@ if(Debug>1) fprintf(stderr,"Pattern too long, %d with only %d items on stack\n",
cp = findcoerc((token_p) 0, &machsets[tokexp[i]]); cp = findcoerc((token_p) 0, &machsets[tokexp[i]]);
if (cp==0) { if (cp==0) {
for (j=0;j<nregneeded;j++) for (j=0;j<nregneeded;j++)
myfree(regls[j]); myfree((string) (regls[j]));
#ifndef ALLOW_NEXTEM #ifndef ALLOW_NEXTEM
assert(!toplevel); assert(!toplevel);
BROKE(); BROKE();
@ -416,15 +416,15 @@ if (Debug > 1) fprintf(stderr, "cost after coercions: %u\n", t);
mincost = t; mincost = t;
besttup = tup; besttup = tup;
} else } else
myfree(tup); myfree((string) tup);
RESTST; RESTST;
} }
FREEST; FREEST;
for (i=0;i<nregneeded;i++) for (i=0;i<nregneeded;i++)
myfree(regls[i]); myfree((string)(regls[i]));
if (totalcost+mincost>costlimit) { if (totalcost+mincost>costlimit) {
if (besttup) if (besttup)
myfree(besttup); myfree((string)besttup);
normalfailed: if (stackpad!=tokpatlen) { normalfailed: if (stackpad!=tokpatlen) {
if (stackpad) { if (stackpad) {
if (costlimit<MAXINT) if (costlimit<MAXINT)
@ -443,7 +443,7 @@ normalfailed: if (stackpad!=tokpatlen) {
} }
for (i=0;i<nregneeded;i++) for (i=0;i<nregneeded;i++)
totalcost += docoerc(regtp[i],regcp[i],ply,toplevel,besttup->p_rar[i]); totalcost += docoerc(regtp[i],regcp[i],ply,toplevel,besttup->p_rar[i]);
myfree(besttup); myfree((string)besttup);
break; break;
} }
case DO_TOSTACK: case DO_TOSTACK:

View file

@ -19,6 +19,8 @@ static char rcsid[] = "$Header$";
* Author: Hans van Staveren * Author: Hans van Staveren
*/ */
extern char *sprintf();
#define LLEAF 01 #define LLEAF 01
#define LDEF 02 #define LDEF 02
#define RLEAF 04 #define RLEAF 04
@ -101,9 +103,9 @@ string tostring(n) register word n; {
char buf[25]; char buf[25];
if (n>=-20 && n<=20 && (n&1)==0) { if (n>=-20 && n<=20 && (n&1)==0) {
if (digstr[(n>>1)+10][0]==0) if (digstr[((int)n>>1)+10][0]==0)
sprintf(digstr[(n>>1)+10],WRD_FMT,n); sprintf(digstr[((int)n>>1)+10],WRD_FMT,n);
return(digstr[(n>>1)+10]); return(digstr[((int)n>>1)+10]);
} }
sprintf(buf,WRD_FMT,n); sprintf(buf,WRD_FMT,n);
return(mystrcpy(buf)); return(mystrcpy(buf));

View file

@ -29,6 +29,8 @@ static char rcsid2[] = "$Header$";
* Author: Hans van Staveren * Author: Hans van Staveren
*/ */
extern char *sprintf();
#ifndef newplb /* retrofit for older mach.h */ #ifndef newplb /* retrofit for older mach.h */
#define newplb newilb #define newplb newilb
#endif #endif
@ -197,7 +199,7 @@ dopseudo() {
word romcont[MAXROM+1]; word romcont[MAXROM+1];
int nromwords; int nromwords;
int rombit,rommask; int rombit,rommask;
unsigned dummy,stackupto(); unsigned stackupto();
if (nextispseu==0 || nemlines>0) if (nextispseu==0 || nemlines>0)
error("No table entry for %d",emlines[0].em_instr); error("No table entry for %d",emlines[0].em_instr);
@ -206,7 +208,7 @@ dopseudo() {
case sp_ilb1: case sp_ilb1:
case sp_ilb2: case sp_ilb2:
swtxt(); swtxt();
dummy = stackupto(&fakestack[stackheight-1],maxply,TRUE); /* dummy = */stackupto(&fakestack[stackheight-1],maxply,TRUE);
cleanregs(); cleanregs();
strarg(savetab1); strarg(savetab1);
newilb(argstr); newilb(argstr);

View file

@ -19,6 +19,8 @@ static char rcsid[] = "$Header$";
* Author: Hans van Staveren * Author: Hans van Staveren
*/ */
extern char *sprintf();
string mystrcpy(); string mystrcpy();
FILE *codefile; FILE *codefile;

View file

@ -15,6 +15,7 @@ static char rcsid[] = "$Header$";
*/ */
extern string myalloc(); extern string myalloc();
extern char *strcpy();
glosym_p glolist= (glosym_p) 0; glosym_p glolist= (glosym_p) 0;

View file

@ -14,6 +14,7 @@ static char rcsid[] = "$Header$";
char *progname; char *progname;
extern char startupcode[]; extern char startupcode[];
extern unsigned codegen();
int maxply=1; int maxply=1;
#ifndef NDEBUG #ifndef NDEBUG
int Debug=0; int Debug=0;

View file

@ -133,7 +133,7 @@ unlinkregs() {
for(rvlp=rvlist;rvlp!=0;rvlp=t) { for(rvlp=rvlist;rvlp!=0;rvlp=t) {
t=rvlp->rv_next; t=rvlp->rv_next;
myfree(rvlp); myfree((string)rvlp);
} }
rvlist=0; rvlist=0;
for (rvtyp=reg_any;rvtyp<=reg_float;rvtyp++) { for (rvtyp=reg_any;rvtyp<=reg_float;rvtyp++) {

View file

@ -34,7 +34,7 @@ string malloc();
string myalloc(size) { string myalloc(size) {
register string p; register string p;
p = (string) malloc(size); p = (string) malloc((unsigned)size);
if (p==0) if (p==0)
fatal("Out of memory"); fatal("Out of memory");
return(p); return(p);
@ -82,7 +82,7 @@ garbage_collect() {
if (nstab<THRESHOLD) if (nstab<THRESHOLD)
return; return;
qsort(stab,nstab,sizeof (char *),compar); qsort((char *)stab,nstab,sizeof (char *),compar);
for (i=0;i<nstab;i++) for (i=0;i<nstab;i++)
used[i]= FALSE; used[i]= FALSE;
for(emlp=emlines;emlp<emlines+nemlines;emlp++) for(emlp=emlines;emlp<emlines+nemlines;emlp++)

View file

@ -600,7 +600,7 @@ c3_p findcoerc(tp,tep) token_p tp; set_p tep; {
} }
if (curreglist->rl_n != 0) if (curreglist->rl_n != 0)
return(cp); return(cp);
myfree(curreglist); myfree((string)curreglist);
} }
} }
return(0); /* nothing found */ return(0); /* nothing found */
@ -613,6 +613,7 @@ itokcost() {
tdp->t_cost.ct_space = costcalc(tdp->t_cost); tdp->t_cost.ct_space = costcalc(tdp->t_cost);
} }
/*VARARGS1*/
error(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; { error(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; {
fprintf(stderr,"Error: "); fprintf(stderr,"Error: ");
@ -625,6 +626,7 @@ error(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; {
exit(-1); exit(-1);
} }
/*VARARGS1*/
fatal(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; { fatal(s,a1,a2,a3,a4,a5,a6,a7,a8) char *s; {
fprintf(stderr,"Fatal: "); fprintf(stderr,"Fatal: ");

View file

@ -4,7 +4,7 @@ PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-bx
CDIR=$(EMHOME)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o

View file

@ -15,6 +15,10 @@ extern instr_p newinstr();
extern instr_p read_instr(); extern instr_p read_instr();
extern instr_p gen_instr(); extern instr_p gen_instr();
extern char * malloc(); extern char * malloc();
extern char *strcat();
extern char *strcpy();
extern char *sprintf();
extern char *strncpy();
struct variable var[NRVARS+1]; struct variable var[NRVARS+1];
struct variable ANY; /* ANY symbol matching any instruction */ struct variable ANY; /* ANY symbol matching any instruction */

View file

@ -4,7 +4,7 @@ PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-bx
CDIR=$(EMHOME)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o