shithub: scc

Download patch

ref: 937a1686e98b70e427e12de8b9b635d245d7e05c
parent: 5e295214e4eddad0eb9be0b88398ed4137269694
author: Hiltjo Posthuma <[email protected]>
date: Wed Jul 15 18:22:02 EDT 2015

minor fixes (whitespace and such)

Hi,

Just some minor fixes (whitespace and such).

Kind regards,
Hiltjo

From c79b4339fc477e2d0212d442f38c50326e430f2a Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma <[email protected]>
Date: Wed, 15 Jul 2015 21:37:32 +0200
Subject: [PATCH] whitespace + typo fixes

change exit(-1) to exit(1), just use 1 instead of EXIT_FAILURE

--- a/README
+++ b/README
@@ -23,8 +23,8 @@
 This is the reason why I begin to develop this compiler, and I hope
 it will be useful for you.
 
-Changes from standar C
-======================
+Changes from standard C
+=======================
 This compiler is near of being full compatible with C99 standard, but
 it has some differences:
 
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -534,7 +534,7 @@
 	if (cppoff)
 		return;
 	printerr("#error %s", s);
-	exit(-1);
+	exit(1);
 }
 
 static void
--- a/cc1/error.c
+++ b/cc1/error.c
@@ -25,7 +25,7 @@
 	putc('\n', stderr);
 	if (flag < 0 && nerrors++ == MAXERRNUM) {
 		fputs("too many errors\n", stderr);
-		exit(-1);
+		exit(1);
 	}
 }
 
@@ -62,6 +62,6 @@
 
 void
 unexpected(void)
-{	
+{
 	error("unexpected '%s'", yytext);
 }
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -651,7 +651,7 @@
 			break;
 		}
 		if (c == '\0' && !moreinput())
-			exit(-1);
+			exit(1);
 	}
 jump:
 	yytoken = c;
--- a/cc2/main.c
+++ b/cc2/main.c
@@ -22,7 +22,7 @@
 		vfprintf(stderr, errlist[nerror], va);
 	va_end(va);
 	putc('\n', stderr);
-	exit(EXIT_FAILURE);
+	exit(1);
 }
 
 bool
--- a/cc2/optm.c
+++ b/cc2/optm.c
@@ -34,7 +34,7 @@
 
 	np->left = optcasts(np->left, tp);
 	np->right = optcasts(np->right, tp);
-	return np;			
+	return np;
 }
 
 static Node *
--- a/cc2/parser.c
+++ b/cc2/parser.c
@@ -464,7 +464,7 @@
 	if (token = strtok(NULL, "\t")) {
 		expr(token);
 		lp = pop();
-		np ->left = lp;
+		np->left = lp;
 		np->type = lp->type;
 	} else {
 		np->left = NULL;
--- a/lib/die.c
+++ b/lib/die.c
@@ -16,5 +16,5 @@
 	va_start(va, fmt);
 	fprintf(stderr, fmt, va);
 	va_end(va);
-	exit(EXIT_FAILURE);
+	exit(1);
 }