shithub: scc

Download patch

ref: c9a50478a9b995cf12d91edb32cf9e4dda528a31
parent: d8b440c914ba19c96d8c8ec6eaaa10bf90352987
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Oct 31 17:46:00 EDT 2013

Fix rturn value of specifier

specifier is no longer returning a pointer, so fix all the returns
pointer in the code.

--- a/decl.c
+++ b/decl.c
@@ -85,7 +85,7 @@
 static bool
 specifier(register struct ctype *, struct storage *, struct qualifier *);
 
-static struct ctype *
+static void
 fielddcl(unsigned char ns)
 {
 	struct ctype base;
@@ -121,10 +121,9 @@
 	} while (accept(','));
 
 	expect(';');
-	return tp;
 }
 
-static struct ctype *
+static void
 structdcl(register struct ctype *tp)
 {
 	aggregate(tp);
@@ -133,7 +132,7 @@
 
 	++nested_tags;
 	if (!accept('{'))
-		return tp;
+		return;
 	if (!tp->forward)
 		error("struct/union already defined");
 
@@ -143,10 +142,9 @@
 	--nested_tags;
 
 	tp->forward = 0;
-	return tp;
 }
 
-static struct ctype *
+static void
 enumdcl(struct ctype *base)
 {
 	short val = 0;
@@ -153,7 +151,7 @@
 
 	aggregate(base);
 	if (!accept('{'))
-		return base;
+		return;
 
 	do {
 		register struct symbol *sym;
@@ -172,8 +170,6 @@
 	} while (accept(','));
 
 	expect('}');
-
-	return base;
 }
 
 bool
@@ -199,11 +195,13 @@
 		case ENUM:
 			tp = ctype(tp, yytoken);
 			next();
-			return enumdcl(tp);
+			enumdcl(tp);
+			return true;
 		case STRUCT:   case UNION:
 			tp = ctype(tp, yytoken);
 			next();
-			return structdcl(tp);
+			structdcl(tp);
+			return true;
 		case IDEN:
 			if (!tp->defined) {
 				register struct symbol *sym;