+2003-01-04 <johan@balder>
+
+ * src/SDCCval.c (getNelements): fixed the initialized array of structures
+
2002-12-29 Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
* as/mcs51/Makefile.bcc: fixed typo lkomf51.o -> lkaomf51.o
int
getNelements (sym_link * type, initList * ilist)
{
- sym_link *etype = getSpec (type);
int i;
if (!ilist)
return 0;
- while (ilist->type == INIT_DEEP)
+ if (ilist->type == INIT_DEEP)
ilist = ilist->init.deep;
/* if type is a character array and there is only one
(string) initialiser then get the length of the string */
- if (IS_ARRAY (type) && IS_CHAR (etype) && !ilist->next)
+ if (IS_ARRAY (type) && IS_CHAR (type->next) && !ilist->next)
{
ast *iast = ilist->init.node;
value *v = (iast->type == EX_VALUE ? iast->opval.val : NULL);
i++;
ilist = ilist->next;
}
-
return i;
}