Fix const cast of functions to void * in struct inits

This commit is contained in:
drmortalwombat 2023-03-08 20:26:46 +01:00
parent 905afd6451
commit dd6f1e0cb6
2 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,7 @@ Point tcorners[8], pcorners[8];
int bm_line(void) int bm_line(void)
{ {
return 0;
} }
void drawCube(void) void drawCube(void)

View File

@ -276,6 +276,13 @@ Expression* Expression::ConstantFold(Errors * errors)
ex->mDecType = mLeft->mDecType; ex->mDecType = mLeft->mDecType;
return ex; return ex;
} }
else if (mRight->mDecValue->mType == DT_CONST_FUNCTION)
{
Expression* ex = new Expression(mLocation, EX_CONSTANT);
ex->mDecValue = mRight->mDecValue;
ex->mDecType = mLeft->mDecType;
return ex;
}
} }
else if (mLeft->mDecType->mType == DT_TYPE_INTEGER) else if (mLeft->mDecType->mType == DT_TYPE_INTEGER)
{ {