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