shithub: scc

Download patch

ref: 03513bb49e57c85779f088666ae448f3932089ca
parent: 60170fa8ff5a4d0ffc73cf069eb190ea99386cc0
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Apr 3 17:41:21 EDT 2014

Clean arithmetic() function

There were some comments and some small bugs in this function
,
as for example accept FTN types in this expressions.

--- a/expr.c
+++ b/expr.c
@@ -65,7 +65,7 @@
 		case FLOAT:
 			SWAP(np1, np2, naux);
 			goto int_float;
-		case PTR: case FTN: case ARY:
+		case PTR: case ARY:
 			SWAP(np1, np2, naux);
 			SWAP(t1, t2, taux);
 			goto pointer;
@@ -80,7 +80,8 @@
 				floatconv(&np1, &np2);
 			break;
 		case INT:
-int_float:		np2 = castcode(np2, np1->type);
+int_float:
+			np2 = castcode(np2, np1->type);
 			break;
 		default:
 			goto incorrect;
@@ -107,7 +108,7 @@
 	return bincode(op, tp1, np1, np2);
 
 incorrect:
-	error("incorrect arithmetic operands"); /*TODO: print type names */
+	error("incorrect arithmetic operands");
 }
 
 static Node *