Commit dbec4210 authored by Anthony Martin's avatar Anthony Martin

gc, 8g, 8l: fix a handful of warnings

8g/cgen.c
        print format type mismatch

8l/asm.c
        resoff set and not used

gc/pgen.c
        misleading comparison INT > 0x80000000

gc/reflect.c
        dalgsym must be static to match forward declaration

gc/subr.c
        assumed_equal set and not used
        hashmem's second argument is not used

gc/walk.c
        duplicated (unreachable) code

R=rsc
CC=golang-dev
https://golang.org/cl/5651079
parent c53b7345
......@@ -1146,7 +1146,7 @@ sgen(Node *n, Node *res, int64 w)
int32 c, q, odst, osrc;
if(debug['g']) {
print("\nsgen w=%ld\n", w);
print("\nsgen w=%lld\n", w);
dump("r", n);
dump("res", res);
}
......
......@@ -1004,6 +1004,9 @@ asmb(void)
phsh(ph, sh);
}
// Additions to the reserved area must be above this line.
USED(resoff);
elfphload(&segtext);
elfphload(&segdata);
......
......@@ -124,7 +124,7 @@ compile(Node *fn)
print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize);
setlineno(curfn);
if(stksize+maxarg > (1ULL<<31))
if((int64)stksize+maxarg > (1ULL<<31))
yyerror("stack frame too large (>2GB)");
defframe(ptxt);
......
......@@ -907,7 +907,7 @@ dumptypestructs(void)
}
}
Sym*
static Sym*
dalgsym(Type *t)
{
int ot;
......
......@@ -1108,11 +1108,9 @@ eqtype1(Type *t1, Type *t2, TypePairList *assumed_equal)
goto no;
yes:
assumed_equal = l.next;
return 1;
no:
assumed_equal = l.next;
return 0;
}
......@@ -2491,7 +2489,7 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface)
}
static Node*
hashmem(Type *t, vlong width)
hashmem(Type *t)
{
Node *tfn, *n;
Sym *sym;
......@@ -2519,7 +2517,7 @@ hashfor(Type *t)
a = algtype1(t, nil);
switch(a) {
case AMEM:
return hashmem(t, t->width);
return hashmem(t);
case AINTER:
sym = pkglookup("interhash", runtimepkg);
break;
......@@ -2667,7 +2665,7 @@ genhash(Sym *sym, Type *t)
size = t->width - first->width; // first->width is offset
else
size = t1->width - first->width; // both are offsets
hashel = hashmem(first->type, size);
hashel = hashmem(first->type);
// hashel(h, size, &p.first)
call = nod(OCALL, hashel, N);
call->list = list(call->list, nh);
......
......@@ -1194,10 +1194,6 @@ walkexpr(Node **np, NodeList **init)
n = r;
goto ret;
n = r;
goto ret;
case OARRAYLIT:
case OMAPLIT:
case OSTRUCTLIT:
......
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