Commit 7a87a3e0 authored by Kai Backman's avatar Kai Backman

slashed warnings

R=rsc
APPROVED=rsc
DELTA=35  (2 added, 1 deleted, 32 changed)
OCL=33436
CL=33453
parent e7acb5df
......@@ -53,7 +53,7 @@ void
main(int argc, char *argv[])
{
char *p;
int nout, nproc, status, i, c;
int nout, nproc, i, c;
thechar = '5';
thestring = "arm";
......
......@@ -111,7 +111,7 @@ void
ginscall(Node *f, int proc)
{
Prog *p;
Node reg, con;
// Node reg, con;
switch(proc) {
default:
......@@ -340,7 +340,7 @@ cgen_asop(Node *n)
{
Node n1, n2, n3, n4;
Node *nl, *nr;
Prog *p1;
// Prog *p1;
Addr addr;
int a;
......
......@@ -83,7 +83,7 @@ void
zaddr(Biobuf *b, Addr *a, int s)
{
int32 l;
Ieee e;
// Ieee e;
int i;
char *n;
......@@ -142,18 +142,19 @@ zaddr(Biobuf *b, Addr *a, int s)
break;
case D_FCONST:
ieeedtod(&e, a->dval);
l = e.l;
Bputc(b, l);
Bputc(b, l>>8);
Bputc(b, l>>16);
Bputc(b, l>>24);
l = e.h;
Bputc(b, l);
Bputc(b, l>>8);
Bputc(b, l>>16);
Bputc(b, l>>24);
break;
fatal("zaddr D_FCONST not implemented");
//ieeedtod(&e, a->dval);
//l = e.l;
//Bputc(b, l);
//Bputc(b, l>>8);
//Bputc(b, l>>16);
//Bputc(b, l>>24);
//l = e.h;
//Bputc(b, l);
//Bputc(b, l>>8);
//Bputc(b, l>>16);
//Bputc(b, l>>24);
//break;
}
}
......
......@@ -420,8 +420,9 @@ gmove(Node *f, Node *t)
{
int a, ft, tt;
Type *cvt;
Node r1, r2, t1, t2, flo, fhi, tlo, thi, con, f0, f1, ax, dx, cx;
Prog *p1, *p2, *p3;
Node r1, con;
// Node r1, r2, t1, t2, flo, fhi, tlo, thi, con, f0, f1, ax, dx, cx;
// Prog *p1, *p2, *p3;
if(debug['M'])
print("gmove %N -> %N\n", f, t);
......@@ -948,7 +949,7 @@ gmove(Node *f, Node *t)
gins(a, f, t);
return;
rdst:
//rdst:
// requires register destination
regalloc(&r1, t->type, t);
gins(a, f, &r1);
......@@ -964,7 +965,7 @@ hard:
regfree(&r1);
return;
hardmem:
//hardmem:
// requires memory intermediate
tempalloc(&r1, cvt);
gmove(f, &r1);
......@@ -1000,8 +1001,8 @@ samaddr(Node *f, Node *t)
Prog*
gins(int as, Node *f, Node *t)
{
Node nod;
int32 v;
// Node nod;
// int32 v;
Prog *p;
if(f != N && f->op == OINDEX) {
......@@ -1775,13 +1776,13 @@ lit:
// break;
// }
// cleani += 2;
// reg = &clean[cleani-1];
// reg1 = &clean[cleani-2];
// reg->op = OEMPTY;
// reg1->op = OEMPTY;
// naddr(n, a);
// goto yes;
cleani += 2;
reg = &clean[cleani-1];
reg1 = &clean[cleani-2];
reg->op = OEMPTY;
reg1->op = OEMPTY;
naddr(n, a);
goto yes;
odot:
o = dotoffset(n, oary, &nn);
......
......@@ -76,10 +76,10 @@ Pconv(Fmt *fp)
int
Dconv(Fmt *fp)
{
char str[100], s[100];
char str[100]; //, s[100];
Addr *a;
int i;
uint32 d1, d2;
// uint32 d1, d2;
a = va_arg(fp->args, Addr*);
i = a->type;
......@@ -128,7 +128,7 @@ Dconv(Fmt *fp)
// a->type = D_ADDR;
// goto conv;
}
conv:
//conv:
return fmtstrcpy(fp, str);
}
......
......@@ -79,7 +79,6 @@ main(int argc, char *argv[])
char *a;
Binit(&bso, 1, OWRITE);
srand(time(0));
cout = -1;
listinit();
outfile = 0;
......@@ -556,23 +555,13 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
break;
case D_SCONST:
while(nhunk < NSNAME)
gethunk();
a->sval = (char*)hunk;
nhunk -= NSNAME;
hunk += NSNAME;
a->sval = mal(NSNAME);
Bread(f, a->sval, NSNAME);
c += NSNAME;
break;
case D_FCONST:
while(nhunk < sizeof(Ieee))
gethunk();
a->ieee = (Ieee*)hunk;
nhunk -= NSNAME;
hunk += NSNAME;
a->ieee = mal(sizeof(Ieee));
a->ieee->l = Bget4(f);
a->ieee->h = Bget4(f);
break;
......@@ -593,12 +582,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
return;
}
while(nhunk < sizeof(Auto))
gethunk();
u = (Auto*)hunk;
nhunk -= sizeof(Auto);
hunk += sizeof(Auto);
u = mal(sizeof(Auto));
u->link = curauto;
curauto = u;
u->asym = s;
......@@ -888,12 +872,7 @@ loop:
goto loop;
}
if(nhunk < sizeof(Prog))
gethunk();
p = (Prog*)hunk;
nhunk -= sizeof(Prog);
hunk += sizeof(Prog);
p = mal(sizeof(Prog));
p->as = o;
p->scond = Bgetc(f);
p->reg = Bgetc(f);
......@@ -1229,12 +1208,7 @@ lookup(char *symb, int v)
if(memcmp(s->name, symb, l) == 0)
return s;
while(nhunk < sizeof(Sym))
gethunk();
s = (Sym*)hunk;
nhunk -= sizeof(Sym);
hunk += sizeof(Sym);
s = mal(sizeof(Sym));
s->name = malloc(l);
memmove(s->name, symb, l);
......@@ -1254,38 +1228,11 @@ prg(void)
{
Prog *p;
while(nhunk < sizeof(Prog))
gethunk();
p = (Prog*)hunk;
nhunk -= sizeof(Prog);
hunk += sizeof(Prog);
p = mal(sizeof(Prog));
*p = zprg;
return p;
}
void
gethunk(void)
{
char *h;
int32 nh;
nh = NHUNK;
if(thunk >= 5L*NHUNK) {
nh = 5L*NHUNK;
if(thunk >= 25L*NHUNK)
nh = 25L*NHUNK;
}
h = mysbrk(nh);
if(h == (char*)-1) {
diag("out of memory");
errorexit();
}
hunk = h;
nhunk = nh;
thunk += nh;
}
void
doprof1(void)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment