]> Cypherpunks repositories - gostls13.git/commitdiff
slashed warnings
authorKai Backman <kaib@golang.org>
Tue, 18 Aug 2009 14:16:10 +0000 (07:16 -0700)
committerKai Backman <kaib@golang.org>
Tue, 18 Aug 2009 14:16:10 +0000 (07:16 -0700)
R=rsc
APPROVED=rsc
DELTA=35  (2 added, 1 deleted, 32 changed)
OCL=33436
CL=33453

src/cmd/5a/lex.c
src/cmd/5g/ggen.c
src/cmd/5g/gobj.c
src/cmd/5g/gsubr.c
src/cmd/5g/list.c
src/cmd/5l/obj.c

index 8a28c7d55591b6ed8a58d5a17008ed9ca86f0c52..c5e9a3e78659c569ca6f7c951175ea0d5e7a1e66 100644 (file)
@@ -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";
index 13083c3d862f655e3b38ba0d30c6fa69e9f60489..3d04ca7f7936813545d9aff031a8b55cfd9de7ba 100644 (file)
@@ -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;
 
index 7c22780d3481f11b1e75f9b401dcdd540193ca1a..5da9e03cea2d3c79af654611487177933d892211 100644 (file)
@@ -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;
        }
 }
 
index 5d94604466f6b41accb653804cd5f52f02fde94e..305fd56f5a4d35f843ca8c55348800f5a29e1199 100644 (file)
@@ -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);
index 82d0825b2612da8f65d9466f78577e4a7974497a..d1437733d2c0d5324655f0dd5fabf8fde7d84283 100644 (file)
@@ -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);
 }
 
index 7c9cb1ae24d11669ea66b7a869ffa76748282498..ff9e667708111ad54b44693ad3b230c437a411c4 100644 (file)
@@ -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)
 {