Browse Source

Clean up the rest of the warnings.

This brings us to zero (well, except for some shift/reduce
conflicts out of yacc for hoc(1) ... but those aren't at all
the same thing) with the current settings.

Next up: remove the rest of the -Wno... flags from the various
.json files and clean up the residuals and the kernel.

Signed-off-by: Dan Cross <cross@gajendra.net>
Dan Cross 7 years ago
parent
commit
c421070f39
46 changed files with 303 additions and 299 deletions
  1. 1 2
      acme/bin/source/acd/acd.h
  2. 2 2
      acme/bin/source/adict/adict.c
  3. 2 2
      acme/bin/source/win/main.c
  4. 1 1
      acme/bin/source/win/pipe.c
  5. 16 16
      acme/mail/src/mesg.c
  6. 11 11
      acme/news/src/news.c
  7. 4 4
      acme/wiki/src/wiki.c
  8. 3 3
      sys/src/cmd/grep/comp.c
  9. 1 1
      sys/src/cmd/grep/sub.c
  10. 0 2
      sys/src/cmd/ndb/cs.c
  11. 3 2
      sys/src/cmd/ndb/dnsdebug.c
  12. 3 2
      sys/src/cmd/ndb/dnsquery.c
  13. 2 1
      sys/src/cmd/ndb/dnudpserver.c
  14. 2 1
      sys/src/cmd/ndb/inform.c
  15. 1 1
      sys/src/cmd/ndb/mkdb.c
  16. 3 3
      sys/src/cmd/ndb/mkhash.c
  17. 2 2
      sys/src/cmd/ndb/mkhosts.c
  18. 6 6
      sys/src/cmd/plumb/fsys.c
  19. 1 1
      sys/src/cmd/rc/exec.c
  20. 1 1
      sys/src/cmd/rc/glob.c
  21. 2 2
      sys/src/cmd/rc/lex.c
  22. 46 46
      sys/src/cmd/rc/pfnc.c
  23. 12 12
      sys/src/cmd/rc/plan9.c
  24. 1 1
      sys/src/cmd/rio/util.c
  25. 1 1
      sys/src/cmd/sam/address.c
  26. 36 36
      sys/src/cmd/sam/cmd.c
  27. 1 1
      sys/src/cmd/sam/moveto.c
  28. 4 3
      sys/src/cmd/sam/regexp.c
  29. 1 1
      sys/src/cmd/sam/shell.c
  30. 1 1
      sys/src/cmd/sam/string.c
  31. 2 2
      sys/src/cmd/sam/xec.c
  32. 2 1
      sys/src/cmd/samterm/main.c
  33. 3 3
      sys/src/cmd/samterm/menu.c
  34. 1 1
      sys/src/cmd/samterm/rasp.c
  35. 1 1
      sys/src/cmd/usb/audio.c
  36. 6 5
      sys/src/cmd/usb/usbd/dev.c
  37. 1 1
      sys/src/cmd/venti/srv/arenas.c
  38. 5 5
      sys/src/cmd/venti/srv/conv.c
  39. 76 76
      sys/src/cmd/venti/srv/fixarenas.c
  40. 2 2
      sys/src/cmd/venti/srv/hproc.c
  41. 20 20
      sys/src/cmd/venti/srv/httpd.c
  42. 1 1
      sys/src/cmd/venti/srv/ifile.c
  43. 1 1
      sys/src/cmd/venti/srv/utils.c
  44. 3 3
      sys/src/cmd/venti/srv/whack.c
  45. 7 7
      sys/src/games/catclock.c
  46. 2 2
      sys/src/games/festoon.c

+ 1 - 2
acme/bin/source/acd/acd.h

@@ -152,6 +152,7 @@ struct Drive {
 };
 
 int gettoc(Scsi*, Toc*);
+void freetoc(Toc *);
 void drawtoc(Window*, Drive*, Toc*);
 void redrawtoc(Window*, Toc*);
 void tocproc(void*);	/* Drive* */
@@ -173,5 +174,3 @@ int ingest(Drive*);
 int markplay(Window*, uint32_t);
 int setplaytime(Window*, char*);
 void advancetrack(Drive*, Window*);
-
-

+ 2 - 2
acme/bin/source/adict/adict.c

@@ -349,7 +349,7 @@ vopenwin(void *v)
 	name = arg[0];
 	buttons = arg[1];
 	twin = arg[2];
-	wintype = (int)arg[3];
+	wintype = (int)((intptr_t)arg[3]);
 	sendul(arg[4], 0);
 
 	openwin(name, buttons, twin, wintype);
@@ -366,7 +366,7 @@ procopenwin(char *name, char *buttons, Win *twin, int wintype)
 	arg[0] = name;
 	arg[1] = buttons;
 	arg[2] = twin;
-	arg[3] = (void*)wintype;
+	arg[3] = (void*)((intptr_t)wintype);
 	arg[4] = c;
 	proccreate(vopenwin, arg, STACK);
 	recvul(c);

+ 2 - 2
acme/bin/source/win/main.c

@@ -283,12 +283,12 @@ fsloop(void* _)
 		case 'r':
 			*eq = r;
 			r->aux = nil;
-			eq = &r->aux;
+			eq = (Req **)&r->aux;
 			/* call sendinput with hostpt and endpt */
 			sendp(win->cevent, &esendinput);
 			break;
 		case 'f':
-			for(l=&q; *l; l=&(*l)->aux){
+			for(l=&q; *l; l=(Req **)&(*l)->aux){
 				if(*l == r->oldreq){
 					*l = (*l)->aux;
 					if(*l == nil)

+ 1 - 1
acme/bin/source/win/pipe.c

@@ -171,7 +171,7 @@ newpipethread(void* _)
 {
 	Window *w;
 
-	while(w = recvp(newpipechan))
+	while((w = recvp(newpipechan)) != nil)
 		threadcreate(pipectl, w, STACK);
 }
 

+ 16 - 16
acme/mail/src/mesg.c

@@ -31,19 +31,19 @@ struct{
 	char	*port;
 	char *suffix;
 } ports[] = {
-	"text/",			"edit",		".txt",
+	{"text/",			"edit",		".txt"},
 	/* text must be first for plumbport() */
-	"image/gif",			"image",	".gif",
-	"image/jpeg",			"image",	".jpg",
-	"image/jpeg",			"image",	".jpeg",
-	"image/png",			"image",	".png",
-	"image/tiff",			"image",	".tif",
-	"application/postscript",	"postscript",	".ps",
-	"application/pdf",		"postscript",	".pdf",
-	"application/msword",		"msword",	".doc",
-	"application/rtf",		"msword",	".rtf",
-	"audio/x-wav",			"wav",		".wav",
-	nil,	nil
+	{"image/gif",			"image",	".gif"},
+	{"image/jpeg",			"image",	".jpg"},
+	{"image/jpeg",			"image",	".jpeg"},
+	{"image/png",			"image",	".png"},
+	{"image/tiff",			"image",	".tif"},
+	{"application/postscript",	"postscript",	".ps"},
+	{"application/pdf",		"postscript",	".pdf"},
+	{"application/msword",		"msword",	".doc"},
+	{"application/rtf",		"msword",	".rtf"},
+	{"audio/x-wav",			"wav",		".wav"},
+	{nil,				nil,		nil}
 };
 
 char *goodtypes[] = {
@@ -61,9 +61,9 @@ struct{
 	char *type;
 	char	*ext;
 } exts[] = {
-	"image/gif",	".gif",
-	"image/jpeg",	".jpg",
-	nil, nil
+	{"image/gif",	".gif"},
+	{"image/jpeg",	".jpg"},
+	{nil, nil}
 };
 
 char *okheaders[] =
@@ -967,7 +967,7 @@ mimedisplay(Message *m, char *name, char *rootdir, Window *w, int fileonly)
 			dest[strlen(dest)-1] = '\0';
 		}else
 			dest = estrdup(m->filename);
-		if(maildest = getenv("maildest")){
+		if((maildest = getenv("maildest")) != nil){
 			maildest = eappend(maildest, "/", dest);
 			Bprint(w->body, "\tcp %s%sbody%s %q\n", rootdir, name, ext(m->type), maildest);
 			free(maildest);

+ 11 - 11
acme/news/src/news.c

@@ -29,7 +29,7 @@ char *from;
 
 typedef struct Article Article;
 struct Article {
-	Ref;
+	Ref ref;
 	Article *prev;
 	Article *next;
 	Window *w;
@@ -154,7 +154,7 @@ msgheadline(Biobuf *bin, int n, Biobuf *bout)
 	date = nil;
 	from = nil;
 	subject = nil;
-	while(p = Brdline(bin, '\n')){
+	while((p = Brdline(bin, '\n')) != nil){
 		p[Blinelen(bin)-1] = '\0';
 		if((q = strchr(p, ':')) == nil)
 			continue;
@@ -283,7 +283,7 @@ acmetimer(Article *m, Window *w)
 
 	assert(m==nil && w==root);
 
-	if((d = dirstat(dir))==nil | hi==d->qid.vers){
+	if((d = dirstat(dir))==nil || hi==d->qid.vers){
 		free(d);
 		return;
 	}
@@ -350,7 +350,7 @@ acmecmd(Article *m, Window *w, char *s)
 	}
 	if(m==nil && iscmd(s, "More")){
 		s = skip(s, "More");
-		if(n = atoi(s))
+		if((n = atoi(s)) != 0)
 			nshow = n;
 
 		if(w->data < 0)
@@ -511,7 +511,7 @@ dirthread(void *v)
 	Window *w;
 
 	w = v;
-	while(e = recvp(w->cevent))
+	while((e = recvp(w->cevent)) != nil)
 		acmeevent(nil, w, e);
 
 	threadexitsall(nil);
@@ -606,7 +606,7 @@ fillmesgwindow(int fd, Article *m)
 
 	inhdr = 1;
 	copy = 1;
-	while(p = Brdline(b, '\n')){
+	while((p = Brdline(b, '\n')) != nil){
 		if(Blinelen(b)==1)
 			inhdr = 0, copy=1;
 		if(inhdr && !isspace(p[0])){
@@ -684,7 +684,7 @@ replywindow(Article *m)
 	b = emalloc(sizeof(*b));
 	Binit(b, fd, OREAD);
 	copy = 0;
-	while(p = Brdline(b, '\n')){
+	while((p = Brdline(b, '\n')) != nil){
 		if(Blinelen(b)==1)
 			break;
 		ep = p+Blinelen(b);
@@ -783,7 +783,7 @@ mesgpost(Article *m)
 	ishdr = 1;
 	isfirst = 1;
 	havegroup = havefrom = 0;
-	while(p = Brdline(m->w->body, '\n')){
+	while((p = Brdline(m->w->body, '\n')) != nil){
 		ep = p+Blinelen(m->w->body);
 		if(ishdr && p+1==ep){
 			if(!havegroup)
@@ -928,7 +928,7 @@ findfrom(void)
 	b = Bopen(p, OREAD);
 	free(p);
 	if(b){
-		while(p = Brdline(b, '\n')){
+		while((p = Brdline(b, '\n')) != nil){
 			p[Blinelen(b)-1] = '\0';
 			if(cistrncmp(p, "from:", 5)==0){
 				p = estrdup(skip(p, "from:"));
@@ -967,11 +967,11 @@ threadmain(int argc, char **argv)
 	from = findfrom();
 
 	group = estrdup(argv[0]);	/* someone will be cute */
-	while(q=strchr(group, '/'))
+	while((q=strchr(group, '/')) != nil)
 		*q = '.';
 
 	p = estrdup(argv[0]);
-	while(q=strchr(p, '.'))
+	while((q=strchr(p, '.')) != nil)
 		*q = '/';
 	p = estrstrstrdup(dir, "/", p);
 	cleanname(p);

+ 4 - 4
acme/wiki/src/wiki.c

@@ -172,7 +172,7 @@ wikiget(Wiki *w)
 	if(!normal)
 		Bprint(w->win->body, "%s\n\n", p);
 
-	while(p = Brdline(bin, '\n')){
+	while((p = Brdline(bin, '\n')) != nil){
 		p[Blinelen(bin)-1] = '\0';
 		if(normal)
 			Bprint(w->win->body, "%s\n", p);
@@ -218,7 +218,7 @@ wikiload(Wiki *w, char *arg)
 	else{
 		p = emalloc(strlen(w->arg)+1+strlen(arg)+1);
 		strcpy(p, w->arg);
-		if(q = strrchr(p, '/')){
+		if((q = strrchr(p, '/')) != nil){
 			++q;
 			*q = '\0';
 		}else
@@ -227,7 +227,7 @@ wikiload(Wiki *w, char *arg)
 		cleanname(p);
 		path = p;
 	}
-	if(addr=strchr(path, ':'))
+	if((addr=strchr(path, ':')) != nil)
 		*addr++ = '\0';
 
 	rv = wikiopen(path, addr)==0;
@@ -589,7 +589,7 @@ wikidiff(Wiki *w)
 
 	p = emalloc(strlen(w->arg)+10);
 	strcpy(p, w->arg);
-	if(q = strchr(p, '/'))
+	if((q = strchr(p, '/')) != nil)
 		*q = '\0';
 	r = estrdup(p);
 	strcat(p, "/+Diff");

+ 3 - 3
sys/src/cmd/grep/comp.c

@@ -27,7 +27,7 @@ increment(State * s, int c)
 	for (i = 0; i < s->count; i++)
 		fol1(s->re[i], c);
 	qsort(follow, nfollow, sizeof(*follow), fcmp);
-	for (tt = &state0; t = *tt;) {
+	for (tt = &state0; (t = *tt) != nil;) {
 		if (t->count > nfollow) {
 			tt = &t->linkleft;
 			goto cont;
@@ -103,9 +103,9 @@ loop:
 
 		case Tcase:
 			if (c >= 0 && c < 256)
-				if (r1 = r->cases[c])
+				if ((r1 = r->cases[c]) != nil)
 					follow[nfollow++] = r1;
-			if (r = r->next)
+			if ((r = r->next) != nil)
 				goto loop;
 			break;
 

+ 1 - 1
sys/src/cmd/grep/sub.c

@@ -184,7 +184,7 @@ appendnext(Re * a, Re * b)
 {
 	Re *n;
 
-	while (n = a->next)
+	while ((n = a->next) != nil)
 		a = n;
 	a->next = b;
 }

+ 0 - 2
sys/src/cmd/ndb/cs.c

@@ -1264,7 +1264,6 @@ ipserv(Network *np, char *name, char *buf, int blen)
 	char *p;
 	int alpha = 0;
 	int restr = 0;
-	char port[10];
 	Ndbtuple *t, *nt;
 	Ndbs s;
 
@@ -1275,7 +1274,6 @@ ipserv(Network *np, char *name, char *buf, int blen)
 	}
 
 	/*  see if it's numeric or symbolic */
-	port[0] = 0;
 	for(p = name; *p; p++){
 		if(isdigit(*p))
 			{}

+ 3 - 2
sys/src/cmd/ndb/dnsdebug.c

@@ -97,7 +97,7 @@ main(int argc, char *argv[])
 	}
 
 	Binit(&in, 0, OREAD);
-	for(print("> "); p = Brdline(&in, '\n'); print("> ")){
+	for(print("> "); (p = Brdline(&in, '\n')) != nil; print("> ")){
 		p[Blinelen(&in)-1] = 0;
 		n = tokenize(p, f, 3);
 		if(n>=1) {
@@ -393,11 +393,12 @@ doquery(char *name, char *tstr)
 		preloadserveraddrs();
 
 	/* default to an "ip" request if alpha, "ptr" if numeric */
-	if(tstr == nil || *tstr == 0)
+	if(tstr == nil || *tstr == 0) {
 		if(strcmp(ipattr(name), "ip") == 0)
 			tstr = "ptr";
 		else
 			tstr = "ip";
+	}
 
 	/* if name end in '.', remove it */
 	len = strlen(name);

+ 3 - 2
sys/src/cmd/ndb/dnsquery.c

@@ -71,7 +71,7 @@ query(int fd)
 	Biobuf in;
 
 	Binit(&in, 0, OREAD);
-	for(print("> "); lp = Brdline(&in, '\n'); print("> ")){
+	for(print("> "); (lp = Brdline(&in, '\n')) != nil; print("> ")){
 		n = Blinelen(&in) -1;
 		while(isspace(lp[n]))
 			lp[n--] = 0;
@@ -85,7 +85,7 @@ query(int fd)
 		strcpy(line, lp);
 
 		/* default to an "ip" request if alpha, "ptr" if numeric */
-		if(strchr(line, ' ') == nil)
+		if(strchr(line, ' ') == nil){
 			if(strcmp(ipattr(line), "ip") == 0) {
 				strcat(line, " ptr");
 				n += 4;
@@ -93,6 +93,7 @@ query(int fd)
 				strcat(line, " ip");
 				n += 3;
 			}
+		}
 
 		/* inverse queries may need to be permuted */
 		if(n > 4 && strcmp(" ptr", &line[n-4]) == 0 &&

+ 2 - 1
sys/src/cmd/ndb/dnudpserver.c

@@ -212,7 +212,7 @@ restart:
 			free(err);
 			goto freereq;
 		}
-		if (rcode == 0)
+		if(rcode == 0){
 			if(reqmsg.qdcount < 1){
 				dnslog("server: no questions from %I", buf);
 				goto freereq;
@@ -220,6 +220,7 @@ restart:
 				dnslog("server: reply not request from %I", buf);
 				goto freereq;
 			}
+		}
 		op = reqmsg.flags & Omask;
 		if(op != Oquery && op != Onotify){
 			dnslog("server: op %d from %I", reqmsg.flags & Omask,

+ 2 - 1
sys/src/cmd/ndb/inform.c

@@ -219,10 +219,11 @@ main(int argc, char *argv[])
 	close(fd);
 
 	err = g16(&p) & 7;
-	if(err != 0 && err != 7)	/* err==7 is just a "yes, I know" warning */
+	if(err != 0 && err != 7){	/* err==7 is just a "yes, I know" warning */
 		if(err < nelem(errmsgs))
 			sysfatal("%s", errmsgs[err]);
 		else
 			sysfatal("unknown dns server error %d", err);
+	}
 	exits(0);
 }

+ 1 - 1
sys/src/cmd/ndb/mkdb.c

@@ -163,7 +163,7 @@ main(void)
 	Binit(&in, 0, OREAD);
 	Binit(&out, 1, OWRITE);
 	ntup = 0;
-	while(l = Brdline(&in, '\n')){
+	while((l = Brdline(&in, '\n')) != nil){
 		l[Blinelen(&in)-1] = 0;
 		n = getfields(l, fields, NFIELDS, 1, " \t");
 		same = 0;

+ 3 - 3
sys/src/cmd/ndb/mkhash.c

@@ -100,7 +100,7 @@ main(int argc, char **argv)
 	/* count entries to calculate hash size */
 	n = 0;
 
-	while(nt = ndbparse(db)){
+	while((nt = ndbparse(db)) != nil){
 		for(t = nt; t; t = t->entry){
 			if(strcmp(t->attr, argv[2]) == 0)
 				n++;
@@ -123,8 +123,8 @@ main(int argc, char **argv)
 	/* create the in core hash table */
 	Bseek(&db->b, 0, 0);
 	off = 0;
-	while(nt = ndbparse(db)){
-		for(t = nt; t; t = t->entry){
+	while((nt = ndbparse(db)) != nil){
+		for(t = nt; t != nil; t = t->entry){
 			if(strcmp(t->attr, argv[2]) == 0)
 				enter(t->val, off);
 		}

+ 2 - 2
sys/src/cmd/ndb/mkhosts.c

@@ -31,7 +31,7 @@ upper(char *x)
 	char *p;
 	int c;
 
-	for(p = x; c = *p; p++)
+	for(p = x; (c = *p) != '\0'; p++)
 		*p = toupper(c);
 	return x;
 }
@@ -137,7 +137,7 @@ parse(char *file)
 	db = ndbopen(file);
 	if(db == 0)
 		exits("no database");
-	while(t = ndbparse(db)){
+	while((t = ndbparse(db)) != nil){
 		for(nt = t; nt; nt = nt->entry){
 			if(strcmp(nt->attr, "ip") == 0)
 				break;

+ 6 - 6
sys/src/cmd/plumb/fsys.c

@@ -82,7 +82,7 @@ struct Holdq
 
 struct	/* needed because incref() doesn't return value */
 {
-	Lock;
+	Lock			lk;
 	int			ref;
 } rulesref;
 
@@ -738,14 +738,14 @@ fsysopen(Fcall *t, uint8_t *buf, Fid *f)
 	if(((f->dir->perm&~(DMDIR|DMAPPEND))&m) != m)
 		goto Deny;
 	if(f->qid.path==Qrules && (mode==OWRITE || mode==ORDWR)){
-		lock(&rulesref);
+		lock(&rulesref.lk);
 		if(rulesref.ref++ != 0){
 			rulesref.ref--;
-			unlock(&rulesref);
+			unlock(&rulesref.lk);
 			fsysrespond(t, buf, Einuse);
 			return t;
 		}
-		unlock(&rulesref);
+		unlock(&rulesref.lk);
 	}
 	if(clearrules){
 		writerules(nil, 0);
@@ -954,9 +954,9 @@ fsysclunk(Fcall *t, uint8_t *buf, Fid *f)
 			 * unless last write ended with a blank line
 			 */
 			writerules(nil, 0);
-			lock(&rulesref);
+			lock(&rulesref.lk);
 			rulesref.ref--;
-			unlock(&rulesref);
+			unlock(&rulesref.lk);
 		}
 		prev = nil;
 		for(p=d->fopen; p; p=p->nextopen){

+ 1 - 1
sys/src/cmd/rc/exec.c

@@ -917,7 +917,7 @@ Xrdcmds(void)
 	}
 	Noerror();
 	if(yyparse()){
-		if(!p->iflag || p->eof && !Eintr()){
+		if(!p->iflag || (p->eof && !Eintr())){
 			if(p->cmdfile)
 				efree(p->cmdfile);
 			closeio(p->cmdfd);

+ 1 - 1
sys/src/cmd/rc/glob.c

@@ -174,7 +174,7 @@ matchfn(void *as, void *ap)
 {
 	uint8_t *s = as, *p = ap;
 
-	if(s[0]=='.' && (s[1]=='\0' || s[1]=='.' && s[2]=='\0') && p[0]!='.')
+	if(s[0]=='.' && (s[1]=='\0' || (s[1]=='.' && s[2]=='\0')) && p[0]!='.')
 		return 0;
 	return match(s, p, '/');
 }

+ 2 - 2
sys/src/cmd/rc/lex.c

@@ -90,7 +90,7 @@ getnext(void)
 	doprompt = doprompt || c=='\n' || c==EOF;
 	if(c==EOF)
 		runq->eof++;
-	else if(flag['V'] || ndot>=2 && flag['v']) pchr(err, c);
+	else if(flag['V'] || (ndot>=2 && flag['v'])) pchr(err, c);
 	return c;
 }
 
@@ -337,7 +337,7 @@ yylex(void)
 				}
 			}
 			if(c!=']'
-			|| t->type==DUP && (t->rtype==HERE || t->rtype==APPEND))
+			|| (t->type==DUP && (t->rtype==HERE || t->rtype==APPEND)))
 				goto RedirErr;
 			*w++=']';
 		}

+ 46 - 46
sys/src/cmd/rc/pfnc.c

@@ -16,52 +16,52 @@ struct{
 	void	(*f)(void);
 	char	*name;
 } fname[] = {
-	Xappend, "Xappend",
-	Xassign, "Xassign",
-	Xasync, "Xasync",
-	Xbackq, "Xbackq",
-	Xbang, "Xbang",
-	Xcase, "Xcase",
-	Xclose, "Xclose",
-	Xconc, "Xconc",
-	Xcount, "Xcount",
-	Xdelfn, "Xdelfn",
-	Xdelhere, "Xdelhere",
-	Xdol, "Xdol",
-	Xdup, "Xdup",
-	Xeflag, "Xeflag",
-	(void (*)(void))Xerror, "Xerror",
-	Xexit, "Xexit",
-	Xfalse, "Xfalse",
-	Xfn, "Xfn",
-	Xfor, "Xfor",
-	Xglob, "Xglob",
-	Xif, "Xif",
-	Xifnot, "Xifnot",
-	Xjump, "Xjump",
-	Xlocal, "Xlocal",
-	Xmark, "Xmark",
-	Xmatch, "Xmatch",
-	Xpipe, "Xpipe",
-	Xpipefd, "Xpipefd",
-	Xpipewait, "Xpipewait",
-	Xpopm, "Xpopm",
-	Xpopredir, "Xpopredir",
-	Xqdol, "Xqdol",
-	Xrdcmds, "Xrdcmds",
-	Xrdfn, "Xrdfn",
-	Xrdwr, "Xrdwr",
-	Xread, "Xread",
-	Xreturn, "Xreturn",
-	Xsimple, "Xsimple",
-	Xsub, "Xsub",
-	Xsubshell, "Xsubshell",
-	Xtrue, "Xtrue",
-	Xunlocal, "Xunlocal",
-	Xwastrue, "Xwastrue",
-	Xword, "Xword",
-	Xwrite, "Xwrite",
-	0
+	{Xappend, "Xappend"},
+	{Xassign, "Xassign"},
+	{Xasync, "Xasync"},
+	{Xbackq, "Xbackq"},
+	{Xbang, "Xbang"},
+	{Xcase, "Xcase"},
+	{Xclose, "Xclose"},
+	{Xconc, "Xconc"},
+	{Xcount, "Xcount"},
+	{Xdelfn, "Xdelfn"},
+	{Xdelhere, "Xdelhere"},
+	{Xdol, "Xdol"},
+	{Xdup, "Xdup"},
+	{Xeflag, "Xeflag"},
+	{(void (*)(void))Xerror, "Xerror"},
+	{Xexit, "Xexit"},
+	{Xfalse, "Xfalse"},
+	{Xfn, "Xfn"},
+	{Xfor, "Xfor"},
+	{Xglob, "Xglob"},
+	{Xif, "Xif"},
+	{Xifnot, "Xifnot"},
+	{Xjump, "Xjump"},
+	{Xlocal, "Xlocal"},
+	{Xmark, "Xmark"},
+	{Xmatch, "Xmatch"},
+	{Xpipe, "Xpipe"},
+	{Xpipefd, "Xpipefd"},
+	{Xpipewait, "Xpipewait"},
+	{Xpopm, "Xpopm"},
+	{Xpopredir, "Xpopredir"},
+	{Xqdol, "Xqdol"},
+	{Xrdcmds, "Xrdcmds"},
+	{Xrdfn, "Xrdfn"},
+	{Xrdwr, "Xrdwr"},
+	{Xread, "Xread"},
+	{Xreturn, "Xreturn"},
+	{Xsimple, "Xsimple"},
+	{Xsub, "Xsub"},
+	{Xsubshell, "Xsubshell"},
+	{Xtrue, "Xtrue"},
+	{Xunlocal, "Xunlocal"},
+	{Xwastrue, "Xwastrue"},
+	{Xword, "Xword"},
+	{Xwrite, "Xwrite"},
+	{0, nil}
 };
 
 void

+ 12 - 12
sys/src/cmd/rc/plan9.c

@@ -47,18 +47,18 @@ void execmount(void);
 void execnewpgrp(void);
 
 builtin Builtin[] = {
-	"cd",		execcd,
-	"whatis",	execwhatis,
-	"eval",		execeval,
-	"exec",		execexec,	/* but with popword first */
-	"exit",		execexit,
-	"shift",	execshift,
-	"wait",		execwait,
-	".",		execdot,
-	"finit",	execfinit,
-	"flag",		execflag,
-	"rfork",	execnewpgrp,
-	0
+	{"cd",		execcd},
+	{"whatis",	execwhatis},
+	{"eval",	execeval},
+	{"exec",	execexec},	/* but with popword first */
+	{"exit",	execexit},
+	{"shift",	execshift},
+	{"wait",	execwait},
+	{".",		execdot},
+	{"finit",	execfinit},
+	{"flag",	execflag},
+	{"rfork",	execnewpgrp},
+	{0,		nil}
 };
 
 void

+ 1 - 1
sys/src/cmd/rio/util.c

@@ -122,7 +122,7 @@ strrune(Rune *s, Rune c)
 		return s-1;
 	}
 
-	while(c1 = *s++)
+	while((c1 = *s++) != 0)
 		if(c1 == c)
 			return s-1;
 	return nil;

+ 1 - 1
sys/src/cmd/sam/address.c

@@ -98,7 +98,7 @@ address(Addr *ap, Address a, int sign)
 			panic("address");
 			return a;
 		}
-	}while(ap = ap->next);	/* assign = */
+	}while((ap = ap->next) != nil);	/* assign = */
 	return a;
 }
 

+ 36 - 36
sys/src/cmd/sam/cmd.c

@@ -14,39 +14,39 @@ static char	linex[]="\n";
 static char	wordx[]=" \t\n";
 Cmdtab cmdtab[]={
 /*	cmdc	text	regexp	addr	defcmd	defaddr	count	token	 fn	*/
-	'\n',	0,	0,	0,	0,	aDot,	0,	0,	nl_cmd,
-	'a',	1,	0,	0,	0,	aDot,	0,	0,	a_cmd,
-	'b',	0,	0,	0,	0,	aNo,	0,	linex,	b_cmd,
-	'B',	0,	0,	0,	0,	aNo,	0,	linex,	b_cmd,
-	'c',	1,	0,	0,	0,	aDot,	0,	0,	c_cmd,
-	'd',	0,	0,	0,	0,	aDot,	0,	0,	d_cmd,
-	'D',	0,	0,	0,	0,	aNo,	0,	linex,	D_cmd,
-	'e',	0,	0,	0,	0,	aNo,	0,	wordx,	e_cmd,
-	'f',	0,	0,	0,	0,	aNo,	0,	wordx,	f_cmd,
-	'g',	0,	1,	0,	'p',	aDot,	0,	0,	g_cmd,
-	'i',	1,	0,	0,	0,	aDot,	0,	0,	i_cmd,
-	'k',	0,	0,	0,	0,	aDot,	0,	0,	k_cmd,
-	'm',	0,	0,	1,	0,	aDot,	0,	0,	m_cmd,
-	'n',	0,	0,	0,	0,	aNo,	0,	0,	n_cmd,
-	'p',	0,	0,	0,	0,	aDot,	0,	0,	p_cmd,
-	'q',	0,	0,	0,	0,	aNo,	0,	0,	q_cmd,
-	'r',	0,	0,	0,	0,	aDot,	0,	wordx,	e_cmd,
-	's',	0,	1,	0,	0,	aDot,	1,	0,	s_cmd,
-	't',	0,	0,	1,	0,	aDot,	0,	0,	m_cmd,
-	'u',	0,	0,	0,	0,	aNo,	2,	0,	u_cmd,
-	'v',	0,	1,	0,	'p',	aDot,	0,	0,	g_cmd,
-	'w',	0,	0,	0,	0,	aAll,	0,	wordx,	w_cmd,
-	'x',	0,	1,	0,	'p',	aDot,	0,	0,	x_cmd,
-	'y',	0,	1,	0,	'p',	aDot,	0,	0,	x_cmd,
-	'X',	0,	1,	0,	'f',	aNo,	0,	0,	X_cmd,
-	'Y',	0,	1,	0,	'f',	aNo,	0,	0,	X_cmd,
-	'!',	0,	0,	0,	0,	aNo,	0,	linex,	plan9_cmd,
-	'>',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
-	'<',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
-	'|',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
-	'=',	0,	0,	0,	0,	aDot,	0,	linex,	eq_cmd,
-	'c'|0x100,0,	0,	0,	0,	aNo,	0,	wordx,	cd_cmd,
-	0,	0,	0,	0,	0,	0,	0,	0,
+	{'\n',	0,	0,	0,	0,	aDot,	0,	0,	nl_cmd},
+	{'a',	1,	0,	0,	0,	aDot,	0,	0,	a_cmd},
+	{'b',	0,	0,	0,	0,	aNo,	0,	linex,	b_cmd},
+	{'B',	0,	0,	0,	0,	aNo,	0,	linex,	b_cmd},
+	{'c',	1,	0,	0,	0,	aDot,	0,	0,	c_cmd},
+	{'d',	0,	0,	0,	0,	aDot,	0,	0,	d_cmd},
+	{'D',	0,	0,	0,	0,	aNo,	0,	linex,	D_cmd},
+	{'e',	0,	0,	0,	0,	aNo,	0,	wordx,	e_cmd},
+	{'f',	0,	0,	0,	0,	aNo,	0,	wordx,	f_cmd},
+	{'g',	0,	1,	0,	'p',	aDot,	0,	0,	g_cmd},
+	{'i',	1,	0,	0,	0,	aDot,	0,	0,	i_cmd},
+	{'k',	0,	0,	0,	0,	aDot,	0,	0,	k_cmd},
+	{'m',	0,	0,	1,	0,	aDot,	0,	0,	m_cmd},
+	{'n',	0,	0,	0,	0,	aNo,	0,	0,	n_cmd},
+	{'p',	0,	0,	0,	0,	aDot,	0,	0,	p_cmd},
+	{'q',	0,	0,	0,	0,	aNo,	0,	0,	q_cmd},
+	{'r',	0,	0,	0,	0,	aDot,	0,	wordx,	e_cmd},
+	{'s',	0,	1,	0,	0,	aDot,	1,	0,	s_cmd},
+	{'t',	0,	0,	1,	0,	aDot,	0,	0,	m_cmd},
+	{'u',	0,	0,	0,	0,	aNo,	2,	0,	u_cmd},
+	{'v',	0,	1,	0,	'p',	aDot,	0,	0,	g_cmd},
+	{'w',	0,	0,	0,	0,	aAll,	0,	wordx,	w_cmd},
+	{'x',	0,	1,	0,	'p',	aDot,	0,	0,	x_cmd},
+	{'y',	0,	1,	0,	'p',	aDot,	0,	0,	x_cmd},
+	{'X',	0,	1,	0,	'f',	aNo,	0,	0,	X_cmd},
+	{'Y',	0,	1,	0,	'f',	aNo,	0,	0,	X_cmd},
+	{'!',	0,	0,	0,	0,	aNo,	0,	linex,	plan9_cmd},
+	{'>',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd},
+	{'<',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd},
+	{'|',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd},
+	{'=',	0,	0,	0,	0,	aDot,	0,	linex,	eq_cmd},
+	{'c'|0x100,0,	0,	0,	0,	aNo,	0,	wordx,	cd_cmd},
+	{0,	0,	0,	0,	0,	0,	0,	0},
 };
 Cmd	*parsecmd(int);
 Addr	*compoundaddr(void);
@@ -477,7 +477,7 @@ parsecmd(int nest)
 	}else
 		switch(cmd.cmdc){
 		case '{':
-			cp = 0;
+			cp = nil;
 			do{
 				if(skipbl()=='\n')
 					getch();
@@ -486,7 +486,7 @@ parsecmd(int nest)
 					cp->next = ncp;
 				else
 					cmd.ccmd = ncp;
-			}while(cp = ncp);
+			}while((cp = ncp) != nil);
 			break;
 		case '}':
 			atnl();
@@ -562,7 +562,7 @@ simpleaddr(void)
 	default:
 		return 0;
 	}
-	if(addr.next = simpleaddr())
+	if((addr.next = simpleaddr()) != nil)
 		switch(addr.next->type){
 		case '.':
 		case '$':

+ 1 - 1
sys/src/cmd/sam/moveto.c

@@ -122,7 +122,7 @@ strrune(Rune *s, Rune c)
 		return s-1;
 	}
 
-	while(c1 = *s++)
+	while((c1 = *s++) != 0)
 		if(c1 == c)
 			return s-1;
 	return 0;

+ 4 - 3
sys/src/cmd/sam/regexp.c

@@ -281,11 +281,12 @@ pushator(int t)
 Node *
 popand(int op)
 {
-	if(andp <= &andstack[0])
+	if(andp <= &andstack[0]){
 		if(op)
 			regerror_c(Emissop, op);
 		else
 			regerror(Ebadregexp);
+	}
 	return --andp;
 }
 
@@ -612,7 +613,7 @@ execute(File *f, Posn startp, Posn eof)
 				error(Eoverflow);
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; inst = tlp->inst; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){	/* assignment = */
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */
@@ -738,7 +739,7 @@ bexecute(File *f, Posn startp)
 				error(Eoverflow);
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; inst = tlp->inst; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){	/* assignment = */
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */

+ 1 - 1
sys/src/cmd/sam/shell.c

@@ -73,7 +73,7 @@ plan9(File *f, int type, String *s, int nest)
 				 */
 				close(pipe2[0]);
 				io = pipe2[1];
-				if(retcode=!setjmp(mainloop)){	/* assignment = */
+				if((retcode=!setjmp(mainloop)) != 0){	/* assignment = */
 					char *c;
 					for(l = 0; l<plan9buf.nc; l+=m){
 						m = plan9buf.nc-l;

+ 1 - 1
sys/src/cmd/sam/string.c

@@ -113,7 +113,7 @@ Strcmp(String *a, String *b)
 	int i, c;
 
 	for(i=0; i<a->n && i<b->n; i++)
-		if(c = (a->s[i] - b->s[i]))	/* assign = */
+		if((c = (a->s[i] - b->s[i])) != 0)	/* assign = */
 			return c;
 	/* damn NULs confuse everything */
 	i = a->n - b->n;

+ 2 - 2
sys/src/cmd/sam/xec.c

@@ -52,7 +52,7 @@ cmdexec(File *f, Cmd *cp)
 				ap->next->type = '*';
 		}
 		if(cp->addr){	/* may be false for '\n' (only) */
-			static Address none = {0,0,0};
+			static Address none = {{0,0},0};
 			if(f)
 				addr = address(ap, f->dot, 0);
 			else	/* a " */
@@ -141,7 +141,7 @@ g_cmd(File *f, Cmd *cp)
 {
 	if(f!=addr.f)panic("g_cmd f!=addr.f");
 	compile(cp->re);
-	if(execute(f, addr.r.p1, addr.r.p2) ^ cp->cmdc=='v'){
+	if(execute(f, addr.r.p1, addr.r.p2) ^ (cp->cmdc=='v')){
 		f->dot = addr;
 		return cmdexec(f, cp->ccmd);
 	}

+ 2 - 1
sys/src/cmd/samterm/main.c

@@ -74,11 +74,12 @@ threadmain(int argc, char *argv[])
 			flsetselect(which, cmd.rasp.nrunes, cmd.rasp.nrunes);
 			type(which, RPlumb);
 		}
-		if(got&(1<<RKeyboard))
+		if(got&(1<<RKeyboard)){
 			if(which)
 				type(which, RKeyboard);
 			else
 				kbdblock();
+		}
 		if(got&(1<<RMouse)){
 			if(hostlock==2 || !ptinrect(mousep->xy, screen->r)){
 				mouseunblock();

+ 3 - 3
sys/src/cmd/samterm/menu.c

@@ -191,7 +191,7 @@ menu3hit(void)
 		break;
 
 	default:
-		if(t = text[m-NMENU3]){
+		if((t = text[m-NMENU3]) != nil){
 			i = t->front;
 			if(t->nwin==0 || t->l[i].textfn==0)
 				return;	/* not ready yet; try again later */
@@ -303,7 +303,7 @@ paren(char *s)
 	uchar *t = buf;
 
 	*t++ = '(';
-	do; while(*t++ = *s++);
+	do; while((*t++ = *s++) != '\0');
 	t[-1] = ')';
 	*t = 0;
 	return (char *)buf;
@@ -316,7 +316,7 @@ genmenu2(int n)
 	if(n>=NMENU2+(menu2str[Search]!=0))
 		return 0;
 	p = menu2str[n];
-	if(!hostlock && !t->lock || n==Search || n==Look)
+	if((!hostlock && !t->lock) || n==Search || n==Look)
 		return p;
 	return paren(p);
 }

+ 1 - 1
sys/src/cmd/samterm/rasp.c

@@ -180,7 +180,7 @@ rclean(Rasp *r)
 void
 Strcpy(Rune *to, Rune *from)
 {
-	do; while(*to++ = *from++);
+	do; while((*to++ = *from++) != 0);
 }
 
 Rune*

+ 1 - 1
sys/src/cmd/usb/audio.c

@@ -108,7 +108,7 @@ controlproc(void *_)
 	int32_t value[8];
 	Channel *replchan;
 
-	while(req = recvp(controlchan)){
+	while((req = recvp(controlchan)) != nil){
 		int rec;
 
 		nf = tokenize(req, args, nelem(args));

+ 6 - 5
sys/src/cmd/usb/usbd/dev.c

@@ -59,11 +59,12 @@ cspmatch(Devtab *dt, int dcsp)
 	int	csp;
 
 	for(i = 0; i < nelem(dt->csps); i++)
-		if((csp=dt->csps[i]) != 0)
-		if(csp == dcsp)
-			return 1;
-		else if((csp&DCL) && (csp&~DCL) == Class(dcsp))
-			return 1;
+		if((csp=dt->csps[i]) != 0){
+			if(csp == dcsp)
+				return 1;
+			else if((csp&DCL) && (csp&~DCL) == Class(dcsp))
+				return 1;
+		}
 	return 0;
 }
 

+ 1 - 1
sys/src/cmd/venti/srv/arenas.c

@@ -37,7 +37,7 @@ hashstr(char *s)
 	int c;
 
 	h = 0;
-	for(; c = *s; s++){
+	for(; (c = *s) != '\0'; s++){
 		c ^= c << 6;
 		h += (c << 11) ^ (c >> 1);
 		c = *s;

+ 5 - 5
sys/src/cmd/venti/srv/conv.c

@@ -30,11 +30,11 @@ static struct {
 	uint32_t m;
 	char *s;
 } magics[] = {
-	ArenaPartMagic, "ArenaPartMagic",
-	ArenaHeadMagic, "ArenaHeadMagic",
-	ArenaMagic, "ArenaMagic",
-	ISectMagic, "ISectMagic",
-	BloomMagic, "BloomMagic",
+	{ArenaPartMagic, "ArenaPartMagic"},
+	{ArenaHeadMagic, "ArenaHeadMagic"},
+	{ArenaMagic, "ArenaMagic"},
+	{ISectMagic, "ISectMagic"},
+	{BloomMagic, "BloomMagic"},
 };
 
 static char*

+ 76 - 76
sys/src/cmd/venti/srv/fixarenas.c

@@ -490,106 +490,106 @@ struct Info
 };
 
 Info partinfo[] = {
-	4,	"magic",
-	D|4,	"version",
-	Z|4,	"blocksize",
-	4,	"arenabase",
-	0
+	{4,	"magic"},
+	{D|4,	"version"},
+	{Z|4,	"blocksize"},
+	{4,	"arenabase"},
+	{0,	nil}
 };
 
 Info headinfo4[] = {
-	4,	"magic",
-	D|4,	"version",
-	S|ANameSize,	"name",
-	Z|4,	"blocksize",
-	Z|8,	"size",
-	0
+	{4,	"magic"},
+	{D|4,	"version"},
+	{S|ANameSize,	"name"},
+	{Z|4,	"blocksize"},
+	{Z|8,	"size"},
+	{0,	nil}
 };
 
 Info headinfo5[] = {
-	4,	"magic",
-	D|4,	"version",
-	S|ANameSize,	"name",
-	Z|4,	"blocksize",
-	Z|8,	"size",
-	4,	"clumpmagic",
-	0
+	{4,	"magic"},
+	{D|4,	"version"},
+	{S|ANameSize,	"name"},
+	{Z|4,	"blocksize"},
+	{Z|8,	"size"},
+	{4,	"clumpmagic"},
+	{0,	nil}
 };
 
 Info tailinfo4[] = {
-	4,	"magic",
-	D|4,	"version",
-	S|ANameSize,	"name",
-	D|4,	"clumps",
-	D|4,	"cclumps",
-	T|4,	"ctime",
-	T|4,	"wtime",
-	D|8,	"used",
-	D|8,	"uncsize",
-	1,	"sealed",
-	0
+	{4,	"magic"},
+	{D|4,	"version"},
+	{S|ANameSize,	"name"},
+	{D|4,	"clumps"},
+	{D|4,	"cclumps"},
+	{T|4,	"ctime"},
+	{T|4,	"wtime"},
+	{D|8,	"used"},
+	{D|8,	"uncsize"},
+	{1,	"sealed"},
+	{0,	nil}
 };
 
 Info tailinfo4a[] = {
 	/* tailinfo 4 */
-	4,	"magic",
-	D|4,	"version",
-	S|ANameSize,	"name",
-	D|4,	"clumps",
-	D|4,	"cclumps",
-	T|4,	"ctime",
-	T|4,	"wtime",
-	D|8,	"used",
-	D|8,	"uncsize",
-	1,	"sealed",
+	{4,	"magic"},
+	{D|4,	"version"},
+	{S|ANameSize,	"name"},
+	{D|4,	"clumps"},
+	{D|4,	"cclumps"},
+	{T|4,	"ctime"},
+	{T|4,	"wtime"},
+	{D|8,	"used"},
+	{D|8,	"uncsize"},
+	{1,	"sealed"},
 
 	/* mem stats */
-	1,	"extension",
-	D|4,	"mem.clumps",
-	D|4,	"mem.cclumps",
-	D|8,	"mem.used",
-	D|8,	"mem.uncsize",
-	1,	"mem.sealed",
-	0
+	{1,	"extension"},
+	{D|4,	"mem.clumps"},
+	{D|4,	"mem.cclumps"},
+	{D|8,	"mem.used"},
+	{D|8,	"mem.uncsize"},
+	{1,	"mem.sealed"},
+	{0,	nil}
 };
 
 Info tailinfo5[] = {
-	4,	"magic",
-	D|4,	"version",
-	S|ANameSize,	"name",
-	D|4,	"clumps",
-	D|4,	"cclumps",
-	T|4,	"ctime",
-	T|4,	"wtime",
-	4,	"clumpmagic",
-	D|8,	"used",
-	D|8,	"uncsize",
-	1,	"sealed",
-	0
+	{4,	"magic"},
+	{D|4,	"version"},
+	{S|ANameSize,	"name"},
+	{D|4,	"clumps"},
+	{D|4,	"cclumps"},
+	{T|4,	"ctime"},
+	{T|4,	"wtime"},
+	{4,	"clumpmagic"},
+	{D|8,	"used"},
+	{D|8,	"uncsize"},
+	{1,	"sealed"},
+	{0,	nil}
 };
 
 Info tailinfo5a[] = {
 	/* tailinfo 5 */
-	4,	"magic",
-	D|4,	"version",
-	S|ANameSize,	"name",
-	D|4,	"clumps",
-	D|4,	"cclumps",
-	T|4,	"ctime",
-	T|4,	"wtime",
-	4,	"clumpmagic",
-	D|8,	"used",
-	D|8,	"uncsize",
-	1,	"sealed",
+	{4,	"magic"},
+	{D|4,	"version"},
+	{S|ANameSize,	"name"},
+	{D|4,	"clumps"},
+	{D|4,	"cclumps"},
+	{T|4,	"ctime"},
+	{T|4,	"wtime"},
+	{4,	"clumpmagic"},
+	{D|8,	"used"},
+	{D|8,	"uncsize"},
+	{1,	"sealed"},
 
 	/* mem stats */
-	1,	"extension",
-	D|4,	"mem.clumps",
-	D|4,	"mem.cclumps",
-	D|8,	"mem.used",
-	D|8,	"mem.uncsize",
-	1,	"mem.sealed",
-	0
+	{1,	"extension"},
+	{D|4,	"mem.clumps"},
+	{D|4,	"mem.cclumps"},
+	{D|8,	"mem.used"},
+	{D|8,	"mem.uncsize"},
+	{1,	"mem.sealed"},
+	{0,	nil}
 };
 
 void

+ 2 - 2
sys/src/cmd/venti/srv/hproc.c

@@ -137,7 +137,7 @@ printsym(void)
 	int i;
 	Sym *sp;
 
-	for (i = 0; sp = getsym(i); i++) {
+	for (i = 0; (sp = getsym(i)) != nil; i++) {
 		switch(sp->type) {
 		case 't':
 		case 'l':
@@ -461,7 +461,7 @@ threadfmt(uintptr t)
 	
 	if(FIELD(Thread, t, moribund) == 1)
 		fmtprint(&fmt, " Moribund");
-	if(s = FIELD(Thread, t, cmdname)){
+	if((s = FIELD(Thread, t, cmdname)) != 0){
 		fmtprint(&fmt, " [%s]", debugstr(s));
 	}
 

+ 20 - 20
sys/src/cmd/venti/srv/httpd.c

@@ -326,12 +326,12 @@ struct {
 	char *ext;
 	char *type;
 } exttab[] = {
-	".html",	"text/html",
-	".txt",	"text/plain",
-	".xml",	"text/xml",
-	".png",	"image/png",
-	".gif",	"image/gif",
-	0
+	{".html", "text/html"},
+	{".txt",  "text/plain"},
+	{".xml",  "text/xml"},
+	{".png",  "image/png"},
+	{".gif",  "image/gif"},
+	{nil, nil}
 };
 
 static int
@@ -392,20 +392,20 @@ static struct
 	int *p;
 } namedints[] =
 {
-	"compress",	&compressblocks,
-	"devnull",	&writestodevnull,
-	"logging",	&ventilogging,
-	"stats",	&collectstats,
-	"icachesleeptime",	&icachesleeptime,
-	"minicachesleeptime",	&minicachesleeptime,
-	"arenasumsleeptime",	&arenasumsleeptime,
-	"l0quantum",	&l0quantum,
-	"l1quantum",	&l1quantum,
-	"manualscheduling",	&manualscheduling,
-	"ignorebloom",	&ignorebloom,
-	"syncwrites",	&syncwrites,
-	"icacheprefetch",	&icacheprefetch,
-	0
+	{"compress",	&compressblocks},
+	{"devnull",	&writestodevnull},
+	{"logging",	&ventilogging},
+	{"stats",	&collectstats},
+	{"icachesleeptime",	&icachesleeptime},
+	{"minicachesleeptime",	&minicachesleeptime},
+	{"arenasumsleeptime",	&arenasumsleeptime},
+	{"l0quantum",	&l0quantum},
+	{"l1quantum",	&l1quantum},
+	{"manualscheduling",	&manualscheduling},
+	{"ignorebloom",	&ignorebloom},
+	{"syncwrites",	&syncwrites},
+	{"icacheprefetch",	&icacheprefetch},
+	{nil, nil}
 };
 
 static int

+ 1 - 1
sys/src/cmd/venti/srv/ifile.c

@@ -128,7 +128,7 @@ ifileline(IFile *f)
 		t = strchr(s, '#');
 		if(t != nil)
 			*t = '\0';
-		for(; c = *s; s++)
+		for(; (c = *s) != '\0'; s++)
 			if(c != ' ' && c != '\t' && c != '\r')
 				return s;
 	}

+ 1 - 1
sys/src/cmd/venti/srv/utils.c

@@ -32,7 +32,7 @@ nameok(char *name)
 
 	if(name == nil)
 		return -1;
-	for(t = name; c = *t; t++)
+	for(t = name; (c = *t) != '\0'; t++)
 		if(t - name >= ANameSize
 		|| c < ' ' || c >= 0x7f)
 			return -1;

+ 3 - 3
sys/src/cmd/venti/srv/whack.c

@@ -104,7 +104,7 @@ whackmatch(Whack *b, uint8_t **ss, uint8_t *esrc, uint32_t h, uint32_t now)
 		 */
 		t = s - off;
 		if(s[0] == t[0] && s[1] == t[1] && s[2] == t[2]){
-			if(!bestlen || esrc - s > bestlen && s[bestlen] == t[bestlen]){
+			if(!bestlen || ((esrc - s) > bestlen && s[bestlen] == t[bestlen])){
 				t += 3;
 				for(s += 3; s < esrc; s++){
 					if(*s != *t)
@@ -190,7 +190,7 @@ whack(Whack *w, uint8_t *dst, uint8_t *src, int n,
 		}
 		if(len < MinMatch){
 			toff = *s;
-			lithist = (lithist << 1) | toff < 32 | toff > 127;
+			lithist = (lithist << 1) | (toff < 32) | (toff > 127);
 			if(lithist & 0x1e){
 				wbits = (wbits << 9) | toff;
 				wnbits += 9;
@@ -290,7 +290,7 @@ whack(Whack *w, uint8_t *dst, uint8_t *src, int n,
 			wnbits += bits + 4;
 			offbits += bits + 4;
 		}
-		wbits = (wbits << bits) | toff & ((1 << bits) - 1);
+		wbits = (wbits << bits) | (toff & ((1 << bits) - 1));
 
 		for(; s != ss; s++){
 			if(s + MinMatch <= esrc){

+ 7 - 7
sys/src/games/catclock.c

@@ -35,13 +35,13 @@ typedef enum{
 #define	WHITE	0
 #define NTP	7
 Point tp[NTP]={			/* tail polygon */
-	 0, 0,
-	 0,76,
-	 3,82,
-	10,84,
-	18,82,
-	21,76,
-	21,70,
+	{ 0, 0},
+	{ 0,76},
+	{ 3,82},
+	{10,84},
+	{18,82},
+	{21,76},
+	{21,70},
 };
 #define	NTAIL	16
 Image *eye[NTAIL+1];

+ 2 - 2
sys/src/games/festoon.c

@@ -243,7 +243,7 @@ art(env)
 			artv->list.s[0] = CHOOSE(aspecsg);
 		else
 			artv->list.s[0] = CHOOSE(aspecpl);
-	} else if (prob(0.50) || env->an && EQ(env->number, "sing")) {
+	} else if (prob(0.50) || (env->an && EQ(env->number, "sing"))) {
 		if (EQ(env->number, "sing"))
 			artv->list.s[0] = env->an ? "a" : CHOOSE(aunssg);
 		else
@@ -1444,7 +1444,7 @@ main(int argc, char *argv[]) {
 
 	for (i = 1, ++argv; i < argc; i++, argv++)
 		if (*argv[0] == '-')	/* -pet -snnn */
-			while (c = *++argv[0])
+			while ((c = *++argv[0]) != '\0')
 				switch (c) {
 				case 'z':
 					flag = 1;