Improve more sizeof return on array without specifiying the dimension
This commit is contained in:
parent
9b662bb0ca
commit
1a97b2cbe1
|
@ -2264,17 +2264,17 @@ static void initials(int ident,int tag,cell *size,int dim[],int numdim,
|
|||
* the same value; if so, we can store this
|
||||
*/
|
||||
constvalue *ld=lastdim.next;
|
||||
int d,match;
|
||||
for (d=0; d<dim[numdim-2]; d++) {
|
||||
int match;
|
||||
assert(ld!=NULL);
|
||||
assert(strtol(ld->name,NULL,16)==d);
|
||||
if (d==0)
|
||||
assert(strtol(ld->name,NULL,16)==0);
|
||||
match=ld->value;
|
||||
else if (match!=ld->value)
|
||||
break;
|
||||
while (ld->next) {
|
||||
ld=ld->next;
|
||||
} /* for */
|
||||
if (d==dim[numdim-2])
|
||||
if (match!=ld->value) {
|
||||
match=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
dim[numdim-1]=match;
|
||||
} /* if */
|
||||
/* after all arrays have been initalized, we know the (major) dimensions
|
||||
|
|
Loading…
Reference in New Issue
Block a user