| 160 | //========================================================================== |
| 161 | |
| 162 | static bool CheckForCustomAddition(FxAddSub *func, FCompileContext &ctx) |
| 163 | { |
| 164 | if (func->left->ValueType == TypeState && func->right->IsInteger() && func->Operator == '+' && !func->left->isConstant()) |
| 165 | { |
| 166 | // This is the only special case of pointer addition that will be accepted - because it is used quite often in the existing game code. |
| 167 | func->ValueType = TypeState; |
| 168 | func->right = new FxMulDiv('*', func->right, new FxConstant((int)sizeof(FState), func->ScriptPosition)); // multiply by size here, so that constants can be better optimized. |
| 169 | func->right = func->right->Resolve(ctx); |
| 170 | return true; |
| 171 | } |
| 172 | return false; |
| 173 | } |
| 174 | |
| 175 | //========================================================================== |
| 176 | // |
nothing calls this directly
no test coverage detected