shithub: scc

Download patch

ref: 1ca89cac46831770fd9fcde016b7c8a1d5ff7e58
parent: e879cdfcae193d1ee6d3615534f2d44843a0a229
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed May 6 14:44:16 EDT 2015

Fix typo in right field

This is a bit embarrasing, but I mistook right with rigth in all the places,
so this commit changes it.

--- a/cc1/cc1.h
+++ b/cc1/cc1.h
@@ -143,7 +143,7 @@
 	bool lvalue : 1;
 	bool symbol: 1;
 	bool constant : 1;
-	struct node *left, *rigth;
+	struct node *left, *right;
 } Node;
 
 enum {
--- a/cc1/code.c
+++ b/cc1/code.c
@@ -110,7 +110,7 @@
 	if (!np)
 		return;
 	freetree(np->left);
-	freetree(np->rigth);
+	freetree(np->right);
 	free(np);
 }
 
@@ -203,7 +203,7 @@
 	Node *np = arg;
 
 	emitnode(np->left);
-	emitnode(np->rigth);
+	emitnode(np->right);
 	printf("\t%s%c", optxt[op], np->type->letter);
 }
 
@@ -213,8 +213,8 @@
 	Node *cond, *ifyes, *ifno, *np = arg;
 
 	cond = np->left;
-	ifyes = np->rigth->left;
-	ifno = np->rigth->rigth;
+	ifyes = np->right->left;
+	ifno = np->right->right;
 	emitnode(cond);
 	emitnode(ifyes);
 	emitnode(ifno);
@@ -298,7 +298,7 @@
 }
 
 Node *
-node(uint8_t op, Type *tp, Node *left, Node *rigth)
+node(uint8_t op, Type *tp, Node *left, Node *right)
 {
 	Node *np;
 
@@ -308,7 +308,7 @@
 	np->sym = NULL;
 	np->constant = np->symbol = np->lvalue = 0;
 	np->left = left;
-	np->rigth = rigth;
+	np->right = right;
 	return np;
 }