fix gcc 4.7 warnings (thanks Tuncer Ayaz)

R=rsc
http://codereview.appspot.com/6744053
diff --git a/src/cmd/acidtypes/stabs.c b/src/cmd/acidtypes/stabs.c
index 862f943..f86c99e 100644
--- a/src/cmd/acidtypes/stabs.c
+++ b/src/cmd/acidtypes/stabs.c
@@ -603,14 +603,13 @@
 stabs2acid(Stab *stabs, Biobuf *b)
 {
 	volatile int fno, i;
-	char c, *file, *desc, *p;
+	char c, *desc, *p;
 	char *volatile dir, *volatile fn, *volatile name;
 	Ftypes *f;
 	Type *t, *tt;
 	StabSym sym;
 
 	dir = nil;
-	file = nil;
 	fno = 0;
 	fn = nil;
 	for(i=0; stabsym(stabs, i, &sym)>=0; i++){
@@ -621,8 +620,6 @@
 			if(sym.name){
 				if(sym.name[0] && sym.name[strlen(sym.name)-1] == '/')
 					dir = sym.name;
-				else
-					file = sym.name;
 			}
 			denumber();
 			fstack = nil;
diff --git a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c
index c57a41b..4f111ec 100644
--- a/src/cmd/acme/rows.c
+++ b/src/cmd/acme/rows.c
@@ -102,12 +102,10 @@
 void
 rowresize(Row *row, Rectangle r)
 {
-	int i, dx, odx, deltax;
+	int i, deltax;
 	Rectangle or, r1, r2;
 	Column *c;
 
-	dx = Dx(r);
-	odx = Dx(row->r);
 	or = row->r;
 	deltax = r.min.x - or.min.x;
 	row->r = r;
diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
index 378c3cc..1022154 100644
--- a/src/cmd/acme/wind.c
+++ b/src/cmd/acme/wind.c
@@ -181,7 +181,7 @@
 int
 winresize(Window *w, Rectangle r, int safe, int keepextra)
 {
-	int oy, y, mouseintag, mouseinbody, tagresized;
+	int oy, y, mouseintag, mouseinbody;
 	Point p;
 	Rectangle r1;
 
@@ -203,9 +203,7 @@
 
 	/* If needed, resize & redraw tag. */
 	y = r1.max.y;
-	tagresized = 0;
 	if(!safe || !w->tagsafe || !eqrect(w->tag.all, r1)){
-		tagresized = 1;
 		textresize(&w->tag, r1, TRUE);
 		y = w->tag.fr.r.max.y;
 		windrawbutton(w);
diff --git a/src/cmd/auth/dsagen.c b/src/cmd/auth/dsagen.c
index 58d5924..cb618ed 100644
--- a/src/cmd/auth/dsagen.c
+++ b/src/cmd/auth/dsagen.c
@@ -14,11 +14,9 @@
 main(int argc, char **argv)
 {
 	char *s;
-	int bits;
 	char *tag;
 	DSApriv *key;
 
-	bits = 1024;
 	tag = nil;
 	key = nil;
 	fmtinstall('B', mpfmt);
diff --git a/src/cmd/auth/factotum/p9cr.c b/src/cmd/auth/factotum/p9cr.c
index 85fa158..0d9c487 100644
--- a/src/cmd/auth/factotum/p9cr.c
+++ b/src/cmd/auth/factotum/p9cr.c
@@ -156,7 +156,6 @@
 		astype = AuthChal;
 		challen = NETCHLEN;
 	}else if(c->proto == &vnc){
-		astype = AuthVNC;
 		challen = MAXCHAL;
 	}else{
 		werrstr("bad proto");
diff --git a/src/cmd/devdraw/x11-get.c b/src/cmd/devdraw/x11-get.c
index 395f455..1a47be0 100644
--- a/src/cmd/devdraw/x11-get.c
+++ b/src/cmd/devdraw/x11-get.c
@@ -56,7 +56,7 @@
 void
 _xputxdata(Memimage *m, Rectangle r)
 {
-	int offset, x, y;
+	int x, y;
 	uchar *p;
 	Point tp, xdelta, delta;
 	Xmem *xm;
@@ -69,10 +69,6 @@
 
 	xi = xm->xi;
 	gc = m->chan==GREY1 ? _x.gccopy0 : _x.gccopy;
-	if(m->depth == 24)
-		offset = r.min.x & 3;
-	else
-		offset = r.min.x & (31/m->depth);
 
 	delta = subpt(r.min, m->r.min);
 
diff --git a/src/cmd/ndb/dn.c b/src/cmd/ndb/dn.c
index c9356b5..8b87403 100755
--- a/src/cmd/ndb/dn.c
+++ b/src/cmd/ndb/dn.c
@@ -462,8 +462,6 @@
 void
 putactivity(void)
 {
-	static ulong lastclean;
-
 	if(traceactivity) syslog(0, "dns", "put %d by %d.%d", dnvars.active, getpid(), threadid());
 	lock(&dnvars.lk);
 	dnvars.active--;
@@ -490,7 +488,6 @@
 	dnageall(0);
 
 	/* let others back in */
-	lastclean = now;
 	needrefresh = 0;
 	dnvars.mutex = 0;
 }
diff --git a/src/cmd/page/rotate.c b/src/cmd/page/rotate.c
index 4808734..3ac83a1 100644
--- a/src/cmd/page/rotate.c
+++ b/src/cmd/page/rotate.c
@@ -85,21 +85,18 @@
 interlace(Image *im, Image *tmp, int axis, int n, Image *mask, int gran)
 {
 	Point p0, p1;
-	Rectangle r0, r1;
+	Rectangle r0;
 
 	r0 = im->r;
-	r1 = im->r;
 	switch(axis) {
 	case Xaxis:
 		r0.max.x = n;
-		r1.min.x = n;
 		p0 = (Point){gran, 0};
 		p1 = (Point){-gran, 0};
 		break;
 	case Yaxis:
 	default:
 		r0.max.y = n;
-		r1.min.y = n;
 		p0 = (Point){0, gran};
 		p1 = (Point){0, -gran};
 		break;
diff --git a/src/cmd/pic/linegen.c b/src/cmd/pic/linegen.c
index eab268f..e0db5fc 100644
--- a/src/cmd/pic/linegen.c
+++ b/src/cmd/pic/linegen.c
@@ -20,7 +20,7 @@
 	double dx[500], dy[500];
 	int ndxy;
 	double nx, ny;
-	Attr *ap, *chop_ap[4];
+	Attr *ap;
 
 	nx = curx;
 	ny = cury;
@@ -133,7 +133,6 @@
 				else
 					chop2 = ap->a_val.f;
 			}
-			chop_ap[chop++] = ap;
 			break;
 		case FILL:
 			battr |= FILLBIT;
diff --git a/src/cmd/pic/textgen.c b/src/cmd/pic/textgen.c
index 98dfbb5..082f8ee 100644
--- a/src/cmd/pic/textgen.c
+++ b/src/cmd/pic/textgen.c
@@ -7,8 +7,6 @@
 	int i, sub, nstr, at, with, hset, invis;
 	double xwith, ywith, h, w, x0, y0, x1, y1;
 	obj *p, *ppos;
-	static double prevh = 0;
-	static double prevw = 0;
 	Attr *ap;
 
 	at = with = nstr = hset = invis = 0;
@@ -93,8 +91,6 @@
 		cury = y1;
 	else
 		cury = y0;
-	prevh = h;
-	prevw = w;
 	return(p);
 }
 
diff --git a/src/cmd/venti/srv/mirrorarenas.c b/src/cmd/venti/srv/mirrorarenas.c
index fd3e59b..c0d02e6 100644
--- a/src/cmd/venti/srv/mirrorarenas.c
+++ b/src/cmd/venti/srv/mirrorarenas.c
@@ -63,7 +63,7 @@
 void
 setstatus(int bits)
 {
-	static int startindx = -1, endindx;
+	static int startindx = -1;
 	static char *startname, *endname;
 	static int lastbits;
 	char buf[100];
@@ -91,16 +91,13 @@
 		}
 		lastbits = bits;
 		startindx = tagindx;
-		endindx = tagindx;
 		startname = tagname;
 		endname = tagname;
 	} else {
-		endindx = tagindx;
 		endname = tagname;
 	}
 	if(bits < 0) {
 		startindx = -1;
-		endindx = -1;
 		return;
 	}	
 }
diff --git a/src/libsunrpc/nfs3.c b/src/libsunrpc/nfs3.c
index ff11b59..7a65b3a 100644
--- a/src/libsunrpc/nfs3.c
+++ b/src/libsunrpc/nfs3.c
@@ -78,7 +78,7 @@
 }
 
 static struct {
-	SunStatus status;
+	Nfs3Status status;
 	char *msg;
 } etab[] = {
 	Nfs3ErrNotOwner,	"not owner",
diff --git a/src/libsunrpc/udp.c b/src/libsunrpc/udp.c
index 4a30003..48b6a2c 100644
--- a/src/libsunrpc/udp.c
+++ b/src/libsunrpc/udp.c
@@ -82,13 +82,11 @@
 static void
 sunudpwrite(void *v)
 {
-	uchar *buf;
 	Arg arg = *(Arg*)v;
 	SunMsgUdp *msg;
 
 	sendp(arg.csync, 0);
 
-	buf = emalloc(UdpMaxRead);
 	while((msg = recvp(arg.creply)) != nil){
 		if(udpwrite(arg.fd, &msg->udp, msg->msg.data, msg->msg.count) != msg->msg.count)
 			fprint(2, "udpwrite: %r\n");
diff --git a/src/libthread/iorw.c b/src/libthread/iorw.c
index ce86d14..b69f9ec 100644
--- a/src/libthread/iorw.c
+++ b/src/libthread/iorw.c
@@ -164,12 +164,11 @@
 	int fd;
 	void *a;
 	int n;
-	int r;
 
 	fd = va_arg(*arg, int);
 	a = va_arg(*arg, void*);
 	n = va_arg(*arg, int);
-	r = read9pmsg(fd, a, n);
+	read9pmsg(fd, a, n);
 	return n;
 }
 int