shithub: scc

Download patch

ref: 50b60a65075cc74836becee050eb87f11642da75
parent: 1b2bcd0b455e35c6792bb1ce19859288e696a00a
author: Hiltjo Posthuma <hiltjo@codemadness.org>
date: Fri Jul 17 17:27:55 EDT 2015

remove unused endif() function and unused variables

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -19,7 +19,6 @@
 static unsigned arglen;
 static Symbol *symline, *symfile;
 static unsigned char ifstatus[NR_COND];
-static Type *charptype;
 
 unsigned cppctx;
 int disexpand;
@@ -405,7 +404,6 @@
 static void
 line(void)
 {
-	char *file, *p;
 	Type *tp;
 	long n;
 
@@ -479,20 +477,8 @@
 }
 
 static void
-endif(void)
-{
-	if (cppctx == 0)
-		error("#endif without #if");
-
-	if (!ifstatus[--cppctx])
-		--cppoff;
-}
-
-static void
 elseclause(void)
 {
-	struct ifstatus *ip;
-
 	if (cppctx == 0)
 		error("#else without #ifdef/ifndef");
 
--- a/cc2/cgen.c
+++ b/cc2/cgen.c
@@ -207,8 +207,6 @@
 static void
 accum(Node *np)
 {
-	Symbol *sym;
-
 	switch (np->type.size) {
 	case 1:
 		moveto(np, A);
--- a/cc2/parser.c
+++ b/cc2/parser.c
@@ -278,7 +278,7 @@
 	case L_UINT64:
 		return &l_uint64;
 	case L_FUNCTION:
-		return &Funct;;
+		return &Funct;
 	default:
 		error(ETYPERR);
 	}
@@ -423,7 +423,6 @@
 static void
 expr(char *token)
 {
-	Node *np;
 	void (*fun)(char *);
 	unsigned c;
 
@@ -438,8 +437,6 @@
 expression(char *token)
 {
 	Node *np;
-	void (*fun)(char *);
-	unsigned c;
 
 	if (!curfun)
 		error(ESYNTAX);