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