shithub: scc

Download patch

ref: 832ea42180bd2b051dffcce298d785fa246e86b2
parent: 28cca8469d717f90b81f429721c99997358d6a4c
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Dec 1 04:07:55 EST 2016

[cc1] Change name of variable in typesize()

The scope of the variable was to big to use aux for it,
and it was hard to follow the code because it was not
clear was 'aux' meant.

--- a/cc1/types.c
+++ b/cc1/types.c
@@ -173,7 +173,7 @@
 typesize(Type *tp)
 {
 	Symbol **sp;
-	Type *aux;
+	Type *type;
 	unsigned long size, offset;
 	int align, a;
 	TINT n;
@@ -202,18 +202,18 @@
 		n = tp->n.elem;
 		for (sp = tp->p.fields; n--; ++sp) {
 			(*sp)->u.i = offset;
-			aux = (*sp)->type;
-			a = aux->align;
+			type = (*sp)->type;
+			a = type->align;
 			if (a > align)
 				align = a;
 			if (tp->op == STRUCT) {
 				if (--a != 0)
 					size = (size + a) & ~a;
-				size += aux->size;
+				size += type->size;
 				offset = size;
 			} else {
-				if (aux->size > size)
-					size = aux->size;
+				if (type->size > size)
+					size = type->size;
 			}
 		}