Browse Source

More broken windows: now-redundant 'assign' comments.

Remove a bunch of no-longer-relevant comments about
assignments in loops and conditionals.

Signed-off-by: Dan Cross <cross@gajendra.net>
Dan Cross 7 years ago
parent
commit
4d194245a6

+ 1 - 1
sys/src/cmd/9660srv/9660srv.c

@@ -268,7 +268,7 @@ iwalk(Xfile *f, char *name)
 	int len, vers, dvers;
 
 	vers = -1;
-	if((p = strchr(name, ';')) != nil) {	/* assign = */
+	if((p = strchr(name, ';')) != nil) {
 		len = p-name;
 		if(len >= Maxname)
 			len = Maxname-1;

+ 2 - 2
sys/src/cmd/9660srv/main.c

@@ -549,10 +549,10 @@ showdir(int fd, Dir *s)
 	char *p;
 
 	strcpy(a_time, ctime(s->atime));
-	if((p=strchr(a_time, '\n')) != nil)	/* assign = */
+	if((p=strchr(a_time, '\n')) != nil)
 		*p = 0;
 	strcpy(m_time, ctime(s->mtime));
-	if((p=strchr(m_time, '\n')) != nil)	/* assign = */
+	if((p=strchr(m_time, '\n')) != nil)
 		*p = 0;
 	fprint(fd, "name=\"%s\" qid=(0x%llux,%lu) type=%d dev=%d \
 mode=0x%8.8lux=0%luo atime=%s mtime=%s length=%lld uid=\"%s\" gid=\"%s\"...",

+ 1 - 1
sys/src/cmd/9660srv/xfile.c

@@ -145,7 +145,7 @@ xfile(int fid, int flag)
 	}
 	if(f)
 		return clean(f);
-	if((f = freelist) != nil)	/* assign = */
+	if((f = freelist) != nil)
 		freelist = f->next;
 	else
 		f = ealloc(sizeof(Xfile));

+ 1 - 1
sys/src/cmd/acme/ecmd.c

@@ -1074,7 +1074,7 @@ editerror("can't handle '");
 			error("cmdaddress");
 			return a;
 		}
-	}while((ap = ap->next) != nil);	/* assign = */
+	}while((ap = ap->next) != nil);
 	return a;
 }
 

+ 2 - 2
sys/src/cmd/acme/regx.c

@@ -633,7 +633,7 @@ rxexecute(Text *t, Rune *r, uint startp, uint eof, Rangeset *rp)
 			}
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */
@@ -771,7 +771,7 @@ rxbexecute(Text *t, uint startp, Rangeset *rp)
 			}
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */

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

@@ -72,7 +72,7 @@ errorwin1(Rune *dir, int ndir, Rune **incl, int nincl)
 	int i, n;
 
 	r = runemalloc(ndir+8);
-	if((n = ndir) != 0){	/* assign = */
+	if((n = ndir) != 0){
 		runemove(r, dir, ndir);
 		r[n++] = L'/';
 	}

+ 1 - 1
sys/src/cmd/dict/ahd.c

@@ -131,7 +131,7 @@ ahdnextoff(int32_t fromoff)
 		}
 		if(pat[++state])
 			continue;
-		if(pat = patterns[++k]){	/* assign = */
+		if(pat = patterns[++k]){
 			state = 0;
 			defoff = fromoff-6;
 			continue;

+ 1 - 1
sys/src/cmd/dict/pcollinsg.c

@@ -137,7 +137,7 @@ pcollgprintentry(Entry e, int cmd)
 			outchar(*p++);
 			continue;
 		}
-		switch(r = intab[*p++]){	/* assign = */
+		switch(r = intab[*p++]){
 		case TAGS:
 			if(rprev != NONE){
 				outrune(rprev);

+ 2 - 2
sys/src/cmd/dict/robert.c

@@ -154,7 +154,7 @@ robertprintentry(Entry *def, Entry *etym, int cmd)
 			continue;
 		}
 		c = *p++;
-		switch(r = intab[c]){	/* assign = */
+		switch(r = intab[c]){
 		case BROM:
 		case ITON:
 		case ROM:
@@ -250,7 +250,7 @@ robertprintkey(void)
 	char *l;
 
 	db = Bouvrir(kfile);
-	while(l = Brdline(db, '\n'))	/* assign = */
+	while((l = Brdline(db, '\n')) != nil)
 		Bwrite(bout, l, Blinelen(db));
 	Bterm(db);
 }

+ 1 - 1
sys/src/cmd/dossrv/iotrack.c

@@ -306,7 +306,7 @@ newsect(void)
 	Iosect *p;
 
 	mlock(&freelock);
-	if((p = freelist) != nil)	/* assign = */
+	if((p = freelist) != nil)
 		freelist = p->next;
 	else
 		p = malloc(sizeof(Iosect));

+ 1 - 1
sys/src/cmd/dossrv/xfile.c

@@ -190,7 +190,7 @@ xfile(int fid, int flag)
 	if(f)
 		return clean(f);
 	mlock(&freelock);
-	if((f = freelist) != nil){	/* assign = */
+	if((f = freelist) != nil){
 		freelist = f->next;
 		unmlock(&freelock);
 	} else {

+ 1 - 1
sys/src/cmd/ext2srv/xfile.c

@@ -141,7 +141,7 @@ xfile(Fid *fid, int flag)
 	if(f)
 		return clean(f);
 	lock(&freelock);
-	if(f = freelist){	/* assign = */
+	if((f = freelist) != nil){
 		freelist = f->next;
 		unlock(&freelock);
 	} else {

+ 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) != nil);	/* assign = */
+	}while((ap = ap->next) != nil);
 	return a;
 }
 

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

@@ -613,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) != nil; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */
@@ -739,7 +739,7 @@ bexecute(File *f, Posn startp)
 				error(Eoverflow);
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){
 	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)) != 0){	/* assignment = */
+				if((retcode=!setjmp(mainloop)) != 0){
 					char *c;
 					for(l = 0; l<plan9buf.nc; l+=m){
 						m = plan9buf.nc-l;

+ 2 - 2
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])) != 0)	/* assign = */
+		if((c = (a->s[i] - b->s[i])) != 0)
 			return c;
 	/* damn NULs confuse everything */
 	i = a->n - b->n;
@@ -133,7 +133,7 @@ Strispre(String *a, String *b)
 	int i;
 
 	for(i=0; i<a->n && i<b->n; i++){
-		if(a->s[i] - b->s[i]){	/* assign = */
+		if(a->s[i] - b->s[i]){
 			if(a->s[i] == 0)
 				return 1;
 			return 0;

+ 1 - 1
sys/src/cmd/sum.c

@@ -40,7 +40,7 @@ main(int argc, char **argv)
 	}ARGEND
 	if(*argv){
 		while(*argv)
-			if((s = sumfile(*argv++, fn)) != nil)	/* assign = */
+			if((s = sumfile(*argv++, fn)) != nil)
 				exitstr = s;
 	}else
 		exitstr = sumfile(0, fn);

+ 4 - 4
sys/src/cmd/vnc/devdraw.c

@@ -624,7 +624,7 @@ drawfreedscreen(DScreen *this)
 		dscreen = this->next;
 		goto Found;
 	}
-	while(next = ds->next){	/* assign = */
+	while((next = ds->next) != nil){
 		if(next == this){
 			ds->next = this->next;
 			goto Found;
@@ -699,7 +699,7 @@ drawuninstallscreen(Client *client, CScreen *this)
 		free(this);
 		return;
 	}
-	while(next = cs->next){	/* assign = */
+	while((next = cs->next) != nil){
 		if(next == this){
 			cs->next = this->next;
 			drawfreedscreen(this->dscreen);
@@ -723,7 +723,7 @@ drawuninstall(Client *client, int id)
 		drawfreedimage(d);
 		return;
 	}
-	while(next = d->next){	/* assign = */
+	while((next = d->next) != nil){
 		if(next->id == id){
 			d->next = next->next;
 			drawfreedimage(next);
@@ -1020,7 +1020,7 @@ drawclose(Chan *c)
 	if(QID(c->qid) == Qctl)
 		cl->busy = 0;
 	if((c->flag&COPEN) && (decref(&cl->r)==0)){
-		while(r = cl->refresh){	/* assign = */
+		while((r = cl->refresh) != nil){
 			cl->refresh = r->next;
 			free(r);
 		}

+ 1 - 1
sys/src/cmd/zenith/ecmd.c

@@ -1074,7 +1074,7 @@ editerror("can't handle '");
 			error("cmdaddress");
 			return a;
 		}
-	}while(ap = ap->next);	/* assign = */
+	}while((ap = ap->next) != nil);
 	return a;
 }
 

+ 2 - 2
sys/src/cmd/zenith/regx.c

@@ -632,7 +632,7 @@ rxexecute(Text *t, Rune *r, uint startp, uint eof, Rangeset *rp)
 			}
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; inst = tlp->inst; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */
@@ -770,7 +770,7 @@ rxbexecute(Text *t, uint startp, Rangeset *rp)
 			}
 		}
 		/* Execute machine until this list is empty */
-		for(tlp = tl; inst = tlp->inst; tlp++){	/* assignment = */
+		for(tlp = tl; (inst = tlp->inst) != nil; tlp++){
 	Switchstmt:
 			switch(inst->type){
 			default:	/* regular character */

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

@@ -75,7 +75,7 @@ errorwin1(Rune *dir, int ndir, Rune **incl, int nincl)
 	int i, n;
 
 	r = runemalloc(ndir+8);
-	if(n = ndir){	/* assign = */
+	if(n = ndir){
 		runemove(r, dir, ndir);
 		r[n++] = L'/';
 	}

+ 1 - 1
sys/src/libc/port/atnotify.c

@@ -36,7 +36,7 @@ atnotify(int (*f)(void*, char*), int in)
 
 	if(!init){
 		notify(notifier);
-		init = 1;		/* assign = */
+		init = 1;
 	}
 	ret = 0;
 	lock(&onnotlock);

+ 3 - 3
sys/src/libc/port/pool.c

@@ -627,10 +627,10 @@ poolnewarena(Pool *p, uint32_t asize)
 	for(lastap=nil, ap=p->arenalist; ap > a; lastap=ap, ap=ap->down)
 		;
 
-	if((a->down = ap) != nil)	/* assign = */
+	if((a->down = ap) != nil)
 		a->down->aup = a;
 
-	if((a->aup = lastap) != nil)	/* assign = */
+	if((a->aup = lastap) != nil)
 		a->aup->down = a;
 	else
 		p->arenalist = a;
@@ -686,7 +686,7 @@ arenamerge(Pool *p, Arena *bot, Arena *top)
 		return nil;
 
 	/* remove top from list */
-	if((bot->aup = top->aup) != nil)	/* assign = */
+	if((bot->aup = top->aup) != nil)
 		bot->aup->down = bot;
 	else
 		p->arenalist = bot;

+ 1 - 1
sys/src/libregexp/regexec.c

@@ -90,7 +90,7 @@ regexec1(Reprog *progp,	/* program to run */
 			_renewemptythread(tl, progp->startinst, ms, s);
 
 		/* Execute machine until current list is empty */
-		for(tlp=tl; tlp->inst; tlp++){	/* assignment = */
+		for(tlp=tl; tlp->inst; tlp++){
 			for(inst = tlp->inst; ; inst = inst->next){
 				switch(inst->type){
 				case RUNE:	/* regular character */

+ 2 - 2
sys/src/libstdio/dtoa.c

@@ -545,8 +545,8 @@ d2b(double d, int *e, int *bits)
 	uls.hi &= 0x7fffffff;			/* clear sign bit, which we ignore */
 	de = (int)(uls.hi >> Exp_shift);
 	z |= Exp_msk11;
-	if ((y = uls.lo) != 0) {		/* assignment = */
-		if ((k = lo0bits(&y)) != 0) {	/* assignment = */
+	if ((y = uls.lo) != 0) {
+		if ((k = lo0bits(&y)) != 0) {
 			x[0] = y | z << (32 - k);
 			z >>= k;
 		} else