mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 00:21:34 +00:00
Made Lemon's dynamic stack size compatible with C++
This commit is contained in:
parent
370e53befe
commit
28e6477a03
1 changed files with 2 additions and 2 deletions
|
@ -296,10 +296,10 @@ static int yyGrowStack(yyParser *p){
|
||||||
newSize = p->yystksz*2 + 100;
|
newSize = p->yystksz*2 + 100;
|
||||||
idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
|
idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
|
||||||
if( p->yystack==&p->yystk0 ){
|
if( p->yystack==&p->yystk0 ){
|
||||||
pNew = malloc(newSize*sizeof(pNew[0]));
|
pNew = (yyStackEntry *)malloc(newSize*sizeof(pNew[0]));
|
||||||
if( pNew ) pNew[0] = p->yystk0;
|
if( pNew ) pNew[0] = p->yystk0;
|
||||||
}else{
|
}else{
|
||||||
pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
|
pNew = (yyStackEntry *)realloc(p->yystack, newSize*sizeof(pNew[0]));
|
||||||
}
|
}
|
||||||
if( pNew ){
|
if( pNew ){
|
||||||
p->yystack = pNew;
|
p->yystack = pNew;
|
||||||
|
|
Loading…
Reference in a new issue