fix clang warnings reported by Tuncer Ayaz

R=rsc
http://codereview.appspot.com/6744054
This commit is contained in:
Russ Cox 2012-10-21 11:25:08 -04:00
parent 34d629c857
commit 0cfb376070
24 changed files with 586 additions and 588 deletions

View file

@ -52,7 +52,7 @@ suncallfmt(Fmt *f)
p = fmtProg[i];
if(p->prog == c->rpc.prog && p->vers == c->rpc.vers){
runlock(&fmtLock);
if(c->type < 0 || c->type >= p->nproc || (fmt=p->proc[c->type].fmt) == nil)
if((int32)c->type < 0 || c->type >= p->nproc || (fmt=p->proc[c->type].fmt) == nil)
return fmtprint(f, "unknown proc %c%d", "TR"[c->type&1], c->type>>1);
(*fmt)(f, c);
return 0;

View file

@ -131,7 +131,6 @@ nfsmount3rmntsize(NfsMount3RMnt *x)
a = a + 4 + 4 * x->nauth;
break;
}
a = a;
return a;
}
uint

View file

@ -11,7 +11,7 @@ suncallpack(SunProg *prog, uchar *a, uchar *ea, uchar **pa, SunCall *c)
if(pa == nil)
pa = &x;
if(c->type < 0 || c->type >= prog->nproc || (pack=prog->proc[c->type].pack) == nil)
if((int32)c->type < 0 || c->type >= prog->nproc || (pack=prog->proc[c->type].pack) == nil)
return SunProcUnavail;
if((*pack)(a, ea, pa, c) < 0)
return SunGarbageArgs;
@ -26,7 +26,7 @@ suncallunpack(SunProg *prog, uchar *a, uchar *ea, uchar **pa, SunCall *c)
if(pa == nil)
pa = &x;
if(c->type < 0 || c->type >= prog->nproc || (unpack=prog->proc[c->type].unpack) == nil)
if((int32)c->type < 0 || c->type >= prog->nproc || (unpack=prog->proc[c->type].unpack) == nil)
return SunProcUnavail;
if((*unpack)(a, ea, pa, c) < 0){
fprint(2, "%ud %d: '%.*H' unpack failed\n", prog->prog, c->type, (int)(ea-a), a);
@ -45,7 +45,7 @@ suncallunpackalloc(SunProg *prog, SunCallType type, uchar *a, uchar *ea, uchar *
if(pa == nil)
pa = &x;
if(type < 0 || type >= prog->nproc || (unpack=prog->proc[type].unpack) == nil)
if((int32)type < 0 || type >= prog->nproc || (unpack=prog->proc[type].unpack) == nil)
return SunProcUnavail;
size = prog->proc[type].sizeoftype;
if(size == 0)
@ -68,7 +68,7 @@ suncallsize(SunProg *prog, SunCall *c)
{
uint (*size)(SunCall*);
if(c->type < 0 || c->type >= prog->nproc || (size=prog->proc[c->type].size) == nil)
if((int32)c->type < 0 || c->type >= prog->nproc || (size=prog->proc[c->type].size) == nil)
return ~0;
return (*size)(c);
}

View file

@ -216,7 +216,7 @@ sunmsgreplyerror(SunMsg *m, SunStatus error)
bp = emalloc(n);
ep = bp+n;
p = bp;
if(sunrpcpack(p, ep, &p, &m->rpc) < 0){
if((int32)sunrpcpack(p, ep, &p, &m->rpc) < 0){
fprint(2, "sunrpcpack failed\n");
sunmsgdrop(m);
return 0;