[hackers] [scc] Reduce indentation in initlist() || Roberto E. Vargas Caballero
commit a1254513235f39ea3816072cf50c0a46f6155e67
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sun Jan 17 20:53:55 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sun Jan 17 21:07:13 2016 +0100
Reduce indentation in initlist()
diff --git a/cc1/init.c b/cc1/init.c
index b2ae095..651a65a 100644
--- a/cc1/init.c
+++ b/cc1/init.c
_AT_@ -105,34 +105,34 @@ initlist(Symbol *sym, Type *tp)
}
switch (tp->op) {
case ARY:
- if (tp->defined && n >= tp->n.elem) {
- if (!toomany)
- warn("excess elements in array initializer");
- toomany = 1;
- sym = NULL;
- }
newtp = tp->type;
+ if (!tp->defined || n < tp->n.elem)
+ break;
+ if (!toomany)
+ warn("excess elements in array initializer");
+ toomany = 1;
+ sym = NULL;
break;
case STRUCT:
- if (n >= tp->n.elem) {
- if (!toomany)
- warn("excess elements in struct initializer");
- toomany = 1;
- sym = NULL;
- } else {
+ if (n < tp->n.elem) {
sym = tp->p.fields[n];
newtp = sym->type;
+ break;
}
+ if (!toomany)
+ warn("excess elements in struct initializer");
+ toomany = 1;
+ sym = NULL;
break;
default:
newtp = tp;
warn("braces around scalar initializer");
- if (n > 0) {
- if (!toomany)
- warn("excess elements in scalar initializer");
- toomany = 1;
- sym = NULL;
- }
+ if (n <= 0)
+ break;
+ if (!toomany)
+ warn("excess elements in scalar initializer");
+ toomany = 1;
+ sym = NULL;
break;
}
if (accept('{'))
Received on Sun Jan 17 2016 - 21:57:55 CET
This archive was generated by hypermail 2.3.0
: Sun Jan 17 2016 - 22:00:24 CET