fix gcc 4.7 warnings (thanks Tuncer Ayaz)

R=rsc
http://codereview.appspot.com/6744053
This commit is contained in:
Russ Cox 2012-10-20 13:36:52 -04:00
parent 53527a6e78
commit 220c15d2b7
14 changed files with 9 additions and 40 deletions

View file

@ -603,14 +603,13 @@ int
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 @@ stabs2acid(Stab *stabs, Biobuf *b)
if(sym.name){
if(sym.name[0] && sym.name[strlen(sym.name)-1] == '/')
dir = sym.name;
else
file = sym.name;
}
denumber();
fstack = nil;

View file

@ -102,12 +102,10 @@ rowadd(Row *row, Column *c, int x)
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;

View file

@ -181,7 +181,7 @@ wintaglines(Window *w, Rectangle r)
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 @@ winresize(Window *w, Rectangle r, int safe, int keepextra)
/* 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);

View file

@ -14,11 +14,9 @@ void
main(int argc, char **argv)
{
char *s;
int bits;
char *tag;
DSApriv *key;
bits = 1024;
tag = nil;
key = nil;
fmtinstall('B', mpfmt);

View file

@ -156,7 +156,6 @@ p9crserver(Conv *c)
astype = AuthChal;
challen = NETCHLEN;
}else if(c->proto == &vnc){
astype = AuthVNC;
challen = MAXCHAL;
}else{
werrstr("bad proto");

View file

@ -56,7 +56,7 @@ _xgetxdata(Memimage *m, Rectangle r)
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 @@ _xputxdata(Memimage *m, Rectangle r)
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);

View file

@ -462,8 +462,6 @@ getactivity(Request *req)
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 @@ putactivity(void)
dnageall(0);
/* let others back in */
lastclean = now;
needrefresh = 0;
dnvars.mutex = 0;
}

View file

@ -85,21 +85,18 @@ void
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;

View file

@ -20,7 +20,7 @@ obj *linegen(int type)
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 @@ obj *linegen(int type)
else
chop2 = ap->a_val.f;
}
chop_ap[chop++] = ap;
break;
case FILL:
battr |= FILLBIT;

View file

@ -7,8 +7,6 @@ obj *textgen(void)
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 @@ obj *textgen(void)
cury = y1;
else
cury = y0;
prevh = h;
prevw = w;
return(p);
}

View file

@ -63,7 +63,7 @@ enum
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 @@ setstatus(int bits)
}
lastbits = bits;
startindx = tagindx;
endindx = tagindx;
startname = tagname;
endname = tagname;
} else {
endindx = tagindx;
endname = tagname;
}
if(bits < 0) {
startindx = -1;
endindx = -1;
return;
}
}

View file

@ -78,7 +78,7 @@ nfs3statusstr(Nfs3Status x)
}
static struct {
SunStatus status;
Nfs3Status status;
char *msg;
} etab[] = {
Nfs3ErrNotOwner, "not owner",

View file

@ -82,13 +82,11 @@ sunudpread(void *v)
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");

View file

@ -164,12 +164,11 @@ _ioread9pmsg(va_list *arg)
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