1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:07:57 -07:00

for GCC4.6: fix a bunch of set-and-not-used errors.

R=rsc
CC=golang-dev
https://golang.org/cl/4406048
This commit is contained in:
Rob Pike 2011-04-14 13:31:37 -07:00
parent ceef10c222
commit a89c0ff39e
12 changed files with 7 additions and 34 deletions

View File

@ -1193,7 +1193,6 @@ void
paint1(Reg *r, int bn) paint1(Reg *r, int bn)
{ {
Reg *r1; Reg *r1;
Prog *p;
int z; int z;
uint32 bb; uint32 bb;
@ -1219,7 +1218,6 @@ paint1(Reg *r, int bn)
} }
for(;;) { for(;;) {
r->act.b[z] |= bb; r->act.b[z] |= bb;
p = r->prog;
if(r->use1.b[z] & bb) { if(r->use1.b[z] & bb) {
change += CREF * r->loop; change += CREF * r->loop;

View File

@ -681,7 +681,7 @@ asmb(void)
{ {
int32 magic; int32 magic;
int a, dynsym; int a, dynsym;
vlong vl, va, startva, fo, w, symo, elfsymo, elfstro, elfsymsize, machlink; vlong vl, startva, fo, symo, elfsymo, elfstro, elfsymsize, machlink;
ElfEhdr *eh; ElfEhdr *eh;
ElfPhdr *ph, *pph; ElfPhdr *ph, *pph;
ElfShdr *sh; ElfShdr *sh;
@ -848,8 +848,6 @@ asmb(void)
eh = getElfEhdr(); eh = getElfEhdr();
fo = HEADR; fo = HEADR;
startva = INITTEXT - HEADR; startva = INITTEXT - HEADR;
va = startva + fo;
w = segtext.filelen;
/* This null SHdr must appear before all others */ /* This null SHdr must appear before all others */
sh = newElfShdr(elfstr[ElfStrEmpty]); sh = newElfShdr(elfstr[ElfStrEmpty]);

View File

@ -389,7 +389,7 @@ ldobj1(Biobuf *f, char *pkg, int64 len, char *pn)
vlong ipc; vlong ipc;
Prog *p; Prog *p;
int v, o, r, skip, mode; int v, o, r, skip, mode;
Sym *h[NSYM], *s, *di; Sym *h[NSYM], *s;
uint32 sig; uint32 sig;
char *name, *x; char *name, *x;
int ntext; int ntext;
@ -400,7 +400,6 @@ ldobj1(Biobuf *f, char *pkg, int64 len, char *pn)
lastp = nil; lastp = nil;
ntext = 0; ntext = 0;
eof = Boffset(f) + len; eof = Boffset(f) + len;
di = S;
src[0] = 0; src[0] = 0;
newloop: newloop:

View File

@ -697,12 +697,10 @@ stotype(NodeList *l, int et, Type **t, int funarg)
Type *f, *t1, *t2, **t0; Type *f, *t1, *t2, **t0;
Strlit *note; Strlit *note;
int lno; int lno;
NodeList *init;
Node *n, *left; Node *n, *left;
char *what; char *what;
t0 = t; t0 = t;
init = nil;
lno = lineno; lno = lineno;
what = "field"; what = "field";
if(et == TINTER) if(et == TINTER)

View File

@ -137,7 +137,6 @@ methodfunc(Type *f, Type *receiver)
static Sig* static Sig*
methods(Type *t) methods(Type *t)
{ {
int o;
Type *f, *mt, *it, *this; Type *f, *mt, *it, *this;
Sig *a, *b; Sig *a, *b;
Sym *method; Sym *method;
@ -157,7 +156,6 @@ methods(Type *t)
// make list of methods for t, // make list of methods for t,
// generating code if necessary. // generating code if necessary.
a = nil; a = nil;
o = 0;
oldlist = nil; oldlist = nil;
for(f=mt->xmethod; f; f=f->down) { for(f=mt->xmethod; f; f=f->down) {
if(f->type->etype != TFUNC) if(f->type->etype != TFUNC)
@ -240,14 +238,12 @@ static Sig*
imethods(Type *t) imethods(Type *t)
{ {
Sig *a, *all, *last; Sig *a, *all, *last;
int o;
Type *f; Type *f;
Sym *method, *isym; Sym *method, *isym;
Prog *oldlist; Prog *oldlist;
all = nil; all = nil;
last = nil; last = nil;
o = 0;
oldlist = nil; oldlist = nil;
for(f=t->type; f; f=f->down) { for(f=t->type; f; f=f->down) {
if(f->etype != TFIELD) if(f->etype != TFIELD)

View File

@ -660,12 +660,10 @@ nodbool(int b)
Type* Type*
aindex(Node *b, Type *t) aindex(Node *b, Type *t)
{ {
NodeList *init;
Type *r; Type *r;
int bound; int bound;
bound = -1; // open bound bound = -1; // open bound
init = nil;
typecheck(&b, Erv); typecheck(&b, Erv);
if(b != nil) { if(b != nil) {
switch(consttype(b)) { switch(consttype(b)) {
@ -1728,17 +1726,13 @@ isideal(Type *t)
Type* Type*
methtype(Type *t) methtype(Type *t)
{ {
int ptr;
if(t == T) if(t == T)
return T; return T;
// strip away pointer if it's there // strip away pointer if it's there
ptr = 0;
if(isptr[t->etype]) { if(isptr[t->etype]) {
if(t->sym != S) if(t->sym != S)
return T; return T;
ptr = 1;
t = t->type; t = t->type;
if(t == T) if(t == T)
return T; return T;

View File

@ -250,7 +250,7 @@ newlabel(void)
static void static void
casebody(Node *sw, Node *typeswvar) casebody(Node *sw, Node *typeswvar)
{ {
Node *os, *oc, *n, *c, *last; Node *n, *c, *last;
Node *def; Node *def;
NodeList *cas, *stat, *l, *lc; NodeList *cas, *stat, *l, *lc;
Node *go, *br; Node *go, *br;
@ -263,8 +263,6 @@ casebody(Node *sw, Node *typeswvar)
cas = nil; // cases cas = nil; // cases
stat = nil; // statements stat = nil; // statements
def = N; // defaults def = N; // defaults
os = N; // last statement
oc = N; // last case
br = nod(OBREAK, N, N); br = nod(OBREAK, N, N);
for(l=sw->list; l; l=l->next) { for(l=sw->list; l; l=l->next) {

View File

@ -197,7 +197,6 @@ Node*
walkdef(Node *n) walkdef(Node *n)
{ {
int lno; int lno;
NodeList *init;
Node *e; Node *e;
Type *t; Type *t;
NodeList *l; NodeList *l;
@ -236,7 +235,6 @@ walkdef(Node *n)
if(n->type != T || n->sym == S) // builtin or no name if(n->type != T || n->sym == S) // builtin or no name
goto ret; goto ret;
init = nil;
switch(n->op) { switch(n->op) {
default: default:
fatal("walkdef %O", n->op); fatal("walkdef %O", n->op);
@ -380,14 +378,13 @@ walkstmt(Node **np)
{ {
NodeList *init; NodeList *init;
NodeList *ll, *rl; NodeList *ll, *rl;
int cl, lno; int cl;
Node *n, *f; Node *n, *f;
n = *np; n = *np;
if(n == N) if(n == N)
return; return;
lno = lineno;
setlineno(n); setlineno(n);
switch(n->op) { switch(n->op) {

View File

@ -878,7 +878,7 @@ textaddress(void)
void void
address(void) address(void)
{ {
Section *s, *text, *data, *rodata, *bss; Section *s, *text, *data, *rodata;
Sym *sym, *sub; Sym *sym, *sub;
uvlong va; uvlong va;
@ -913,7 +913,6 @@ address(void)
text = segtext.sect; text = segtext.sect;
rodata = segtext.sect->next; rodata = segtext.sect->next;
data = segdata.sect; data = segdata.sect;
bss = segdata.sect->next;
for(sym = datap; sym != nil; sym = sym->next) { for(sym = datap; sym != nil; sym = sym->next) {
cursym = sym; cursym = sym;

View File

@ -319,7 +319,7 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
char *name; char *name;
int i, j, rela, is64, n; int i, j, rela, is64, n;
uchar hdrbuf[64]; uchar hdrbuf[64];
uchar *p, *dp; uchar *p;
ElfHdrBytes *hdr; ElfHdrBytes *hdr;
ElfObj *obj; ElfObj *obj;
ElfSect *sect, *rsect; ElfSect *sect, *rsect;
@ -561,7 +561,6 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
n = rsect->size/(4+4*is64)/(2+rela); n = rsect->size/(4+4*is64)/(2+rela);
r = mal(n*sizeof r[0]); r = mal(n*sizeof r[0]);
p = rsect->base; p = rsect->base;
dp = sect->base;
for(j=0; j<n; j++) { for(j=0; j<n; j++) {
add = 0; add = 0;
rp = &r[j]; rp = &r[j];

View File

@ -1033,7 +1033,7 @@ mkfwd(void)
Prog *p; Prog *p;
int i; int i;
int32 dwn[LOG], cnt[LOG]; int32 dwn[LOG], cnt[LOG];
Prog *lst[LOG], *last; Prog *lst[LOG];
for(i=0; i<LOG; i++) { for(i=0; i<LOG; i++) {
if(i == 0) if(i == 0)
@ -1044,7 +1044,6 @@ mkfwd(void)
lst[i] = P; lst[i] = P;
} }
i = 0; i = 0;
last = nil;
for(cursym = textp; cursym != nil; cursym = cursym->next) { for(cursym = textp; cursym != nil; cursym = cursym->next) {
for(p = cursym->text; p != P; p = p->link) { for(p = cursym->text; p != P; p = p->link) {
if(p->link == P) { if(p->link == P) {

View File

@ -991,7 +991,6 @@ machdotout(int fd, Fhdr *fp, ExecHdr *hp)
{ {
uvlong (*swav)(uvlong); uvlong (*swav)(uvlong);
uint32 (*swal)(uint32); uint32 (*swal)(uint32);
ushort (*swab)(ushort);
Machhdr *mp; Machhdr *mp;
MachCmd **cmd; MachCmd **cmd;
MachSymSeg *symtab; MachSymSeg *symtab;
@ -1012,7 +1011,6 @@ machdotout(int fd, Fhdr *fp, ExecHdr *hp)
return 0; return 0;
} }
swab = leswab;
swal = leswal; swal = leswal;
swav = leswav; swav = leswav;