shithub: scc

Download patch

ref: deb8e6ab7e00afd97cd585bdd59b205b7565015a
parent: 44cc5010e56094acc7cf2a042135c0cd4ca27323
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Dec 6 15:08:18 EST 2017

Get rid of nothing

Why do you want a /* nothing */ comment when you already
have a ;?

--- a/as/parser.c
+++ b/as/parser.c
@@ -77,7 +77,7 @@
 			break;
 		case '"':
 			while ((c = *++s) && c != '"')
-				/* nothing */;
+				;
 			if (c == '\0')
 				error("unterminated string");
 			break;
--- a/cc1/builtin.c
+++ b/cc1/builtin.c
@@ -70,7 +70,7 @@
 		 goto error;
 
 	for (p = curfun->u.pars; p && *p != last->sym; ++p)
-		/* nothing */;
+		;
 	if (!p || *p == NULL || p[1] == NULL || p[1]->type != ellipsistype)
 		warn("second parameter of 'va_start' not last named argument");
 
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -204,7 +204,7 @@
 			delim = '"';
 		search_delim:
 			for (p = s; *++s != delim; )
-				/* nothing */;
+				;
 			size = s - p + 1;
 			if (size > bufsiz)
 				goto expansion_too_long;
@@ -726,7 +726,7 @@
 	char *p;
 
 	for (p = input->p; isspace(*p); ++p)
-		/* nothing */;
+		;
 
 	if (*p != '#')
 		return cppoff;
@@ -740,7 +740,7 @@
 	namespace = NS_IDEN;
 
 	for (bp = clauses; bp->token && bp->token != yytoken; ++bp)
-		/* nothing */;
+		;
 	if (!bp->token) {
 		errorp("incorrect preprocessor directive '%s'", yytext);
 		goto error;
--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -589,7 +589,7 @@
 
 	for (n = 0; accept('*'); ++n) {
 		while (accept(TQUALIFIER))
-			/* nothing */;
+			;
 	}
 
 	directdcl(dp);
@@ -928,7 +928,7 @@
 		declarator(&stack);
 
 		while (pop(&stack, &dcl))
-			/* nothing */;
+			;
 		sym = (*fun)(&dcl);
 		if (funbody(sym, dcl.pars))
 			return sym;
--- a/cc1/init.c
+++ b/cc1/init.c
@@ -65,7 +65,7 @@
 		return 0;
 	}
 	for (p = tp->p.fields; *p != sym; ++p)
-		/* nothing */;
+		;
 	return p - tp->p.fields;
 }
 
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -219,7 +219,7 @@
 
 repeat:
 	while ((c = readchar()) != EOF && c != type)
-		/* nothing */;
+		;
 
 	if (c == EOF) {
 		errorp("unterminated comment");
@@ -567,7 +567,7 @@
 
 	begin = input->p;
 	for (p = begin; isalnum(*p) || *p == '_'; ++p)
-		/* nothing */;
+		;
 	input->p = p;
 	tok2str();
 	if ((sym = lookup(NS_CPP, yytext, NOALLOC)) != NULL) {
--- a/cc1/main.c
+++ b/cc1/main.c
@@ -96,7 +96,7 @@
 		outcpp();
 	} else {
 		for (next(); yytoken != EOFTOK; decl())
-			/* nothing */;
+			;
 	}
 
 	return failure;
--- a/cc2/parser.c
+++ b/cc2/parser.c
@@ -716,7 +716,7 @@
 	endf = 0;
 
 	while (!endf && nextline())
-		/* nothing */;
+		;
 	if (ferror(stdin))
 		error(EFERROR, strerror(errno));
 }
--- a/lib/c/src/strcat.c
+++ b/lib/c/src/strcat.c
@@ -9,6 +9,6 @@
 	while (*dst)
 		++dst;
 	while (*dst++ = *src++)
-		/* nothing */;
+		;
 	return ret;
 }
--- a/lib/c/src/strcpy.c
+++ b/lib/c/src/strcpy.c
@@ -7,6 +7,6 @@
 	char *ret = dst;
 
 	while (*dst++ = *src++)
-		/* nothing */;
+		;
 	return ret;
 }
--- a/lib/c/src/strcspn.c
+++ b/lib/c/src/strcspn.c
@@ -10,7 +10,7 @@
 
 	for (n = 0; c = *s1++; ++n) {
 		for (p = s2; *p && *p != c; ++p)
-			/* nothing */;
+			;
 		if (*p == c)
 			break;
 	}
--- a/lib/c/src/strlen.c
+++ b/lib/c/src/strlen.c
@@ -7,6 +7,6 @@
 	const char *t;
 
 	for (t = s; *t; ++t)
-		/* nothing */;
+		;
 	return t - s;
 }
--- a/lib/c/src/strncmp.c
+++ b/lib/c/src/strncmp.c
@@ -5,6 +5,6 @@
 strncmp(const char *s1, const char *s2, size_t n)
 {
 	for (; n && *s1 && *s2 && *s1 == *s2; --n, ++s1, ++s2);
-		/* nothing */;
+		;
 	return n ? (*(unsigned char *)s1 - *(unsigned char *)s2) : 0;
 }
--- a/lib/c/src/strpbrk.c
+++ b/lib/c/src/strpbrk.c
@@ -9,7 +9,7 @@
 
 	for (; c = *s1; ++s1) {
 		for (p = s2; *p && *p != c; ++p)
-			/* nothing */;
+			;
 		if (*p == c)
 			return s1;
 	}
--- a/lib/c/src/strspn.c
+++ b/lib/c/src/strspn.c
@@ -10,7 +10,7 @@
 
 	for (n = 0; c = *s1++; ++n) {
 		for (p = s2; *p && *p != c; ++p)
-			/* nothing */;
+			;
 		if (*p == '\0')
 			break;
 	}
--- a/lib/c/src/strstr.c
+++ b/lib/c/src/strstr.c
@@ -17,7 +17,7 @@
 		} else {
 			p = s1++;
 			for (q = s2; *q && *s1 == *q; ++s1, ++q)
-				/* nothing */;
+				;
 			if (*q == '\0')
 				return (char *) p;
 		}
--- a/tests/execute/0132-forward.c
+++ b/tests/execute/0132-forward.c
@@ -16,6 +16,6 @@
 	*x = y;
 
 	for (n = 0, p = &y; p; ++n, p = p->next)
-		/* nothing */;
+		;
 	return n;
 }