mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
Remove lax from FCompileContext
- It's always set to true these days, so let's get rid of it.
This commit is contained in:
parent
09c902ce55
commit
4f528e3832
5 changed files with 15 additions and 28 deletions
|
@ -293,7 +293,7 @@ static void FinishThingdef()
|
|||
}
|
||||
else
|
||||
{
|
||||
FCompileContext ctx(tcall->ActorClass, true);
|
||||
FCompileContext ctx(tcall->ActorClass);
|
||||
for (j = 0; j < tcall->Parameters.Size(); ++j)
|
||||
{
|
||||
tcall->Parameters[j]->Resolve(ctx);
|
||||
|
@ -358,7 +358,7 @@ static void FinishThingdef()
|
|||
sfunc = dmg->GetFunction();
|
||||
if (sfunc == NULL)
|
||||
{
|
||||
FCompileContext ctx(ti, true);
|
||||
FCompileContext ctx(ti);
|
||||
dmg->Resolve(ctx);
|
||||
VMFunctionBuilder buildit;
|
||||
buildit.Registers[REGT_POINTER].Get(1); // The self pointer
|
||||
|
|
|
@ -76,9 +76,7 @@ FxExpression *ParseExpression (FScanner &sc, PClassActor *cls)
|
|||
{
|
||||
FxExpression *data = ParseExpressionM (sc, cls);
|
||||
|
||||
FCompileContext ctx;
|
||||
ctx.cls = cls;
|
||||
ctx.lax = true;
|
||||
FCompileContext ctx(cls);
|
||||
data = data->Resolve(ctx);
|
||||
|
||||
return data;
|
||||
|
|
|
@ -61,12 +61,10 @@ extern PSymbolTable GlobalSymbols;
|
|||
struct FCompileContext
|
||||
{
|
||||
PClassActor *cls;
|
||||
bool lax;
|
||||
|
||||
FCompileContext(PClassActor *_cls = NULL, bool _lax = false)
|
||||
FCompileContext(PClassActor *_cls = NULL)
|
||||
{
|
||||
cls = _cls;
|
||||
lax = _lax;
|
||||
}
|
||||
|
||||
PSymbol *FindInClass(FName identifier)
|
||||
|
|
|
@ -750,7 +750,7 @@ FxExpression *FxUnaryNotBitwise::Resolve(FCompileContext& ctx)
|
|||
CHECKRESOLVED();
|
||||
SAFE_RESOLVE(Operand, ctx);
|
||||
|
||||
if (Operand->ValueType == VAL_Float && ctx.lax)
|
||||
if (Operand->ValueType == VAL_Float /* lax */)
|
||||
{
|
||||
// DECORATE allows floats here so cast them to int.
|
||||
Operand = new FxIntCast(Operand);
|
||||
|
@ -1501,7 +1501,7 @@ FxExpression *FxBinaryInt::Resolve(FCompileContext& ctx)
|
|||
CHECKRESOLVED();
|
||||
if (!ResolveLR(ctx, false)) return NULL;
|
||||
|
||||
if (ctx.lax && ValueType == VAL_Float)
|
||||
if (ValueType == VAL_Float /* lax */)
|
||||
{
|
||||
// For DECORATE which allows floats here.
|
||||
if (left->ValueType != VAL_Int)
|
||||
|
@ -2711,7 +2711,7 @@ FxExpression *FxArrayElement::Resolve(FCompileContext &ctx)
|
|||
SAFE_RESOLVE(Array,ctx);
|
||||
SAFE_RESOLVE(index,ctx);
|
||||
|
||||
if (index->ValueType == VAL_Float && ctx.lax)
|
||||
if (index->ValueType == VAL_Float /* lax */)
|
||||
{
|
||||
// DECORATE allows floats here so cast them to int.
|
||||
index = new FxIntCast(index);
|
||||
|
@ -2932,7 +2932,7 @@ FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx)
|
|||
}
|
||||
else if ((*ArgList)[i]->ValueType != VAL_Int)
|
||||
{
|
||||
if (ctx.lax && ((*ArgList)[i]->ValueType == VAL_Float))
|
||||
if ((*ArgList)[i]->ValueType == VAL_Float /* lax */)
|
||||
{
|
||||
(*ArgList)[i] = new FxIntCast((*ArgList)[i]);
|
||||
}
|
||||
|
@ -3163,12 +3163,7 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
|
|||
cls = PClass::FindClass(clsname);
|
||||
if (cls == NULL)
|
||||
{
|
||||
if (!ctx.lax)
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR,"Unknown class name '%s'", clsname.GetChars());
|
||||
delete this;
|
||||
return NULL;
|
||||
}
|
||||
/* lax */
|
||||
// Since this happens in released WADs it must pass without a terminal error... :(
|
||||
ScriptPosition.Message(MSG_WARNING,
|
||||
"Unknown class name '%s'",
|
||||
|
@ -3341,12 +3336,8 @@ FxExpression *FxMultiNameState::Resolve(FCompileContext &ctx)
|
|||
destination = scope->FindState(names.Size()-1, &names[1], false);
|
||||
if (destination == NULL)
|
||||
{
|
||||
ScriptPosition.Message(ctx.lax? MSG_WARNING:MSG_ERROR, "Unknown state jump destination");
|
||||
if (!ctx.lax)
|
||||
{
|
||||
delete this;
|
||||
return NULL;
|
||||
}
|
||||
ScriptPosition.Message(MSG_WARNING, "Unknown state jump destination");
|
||||
/* lax */
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ static void ParseConstant (FScanner &sc, PSymbolTable *symt, PClassActor *cls)
|
|||
FxExpression *expr = ParseExpression (sc, cls);
|
||||
sc.MustGetToken(';');
|
||||
|
||||
FCompileContext ctx(cls, true);
|
||||
FCompileContext ctx(cls);
|
||||
expr = expr->Resolve(ctx);
|
||||
if (!expr->isConstant())
|
||||
{
|
||||
|
@ -266,7 +266,7 @@ static void ParseEnum (FScanner &sc, PSymbolTable *symt, PClassActor *cls)
|
|||
if (sc.CheckToken('='))
|
||||
{
|
||||
FxExpression *expr = ParseExpression (sc, cls);
|
||||
FCompileContext ctx(cls, true);
|
||||
FCompileContext ctx(cls);
|
||||
expr = expr->Resolve(ctx);
|
||||
if (!expr->isConstant())
|
||||
{
|
||||
|
@ -355,7 +355,7 @@ static void ParseNativeVariable (FScanner &sc, PSymbolTable *symt, PClassActor *
|
|||
if (sc.CheckToken('['))
|
||||
{
|
||||
FxExpression *expr = ParseExpression (sc, cls);
|
||||
FCompileContext ctx(cls, true);
|
||||
FCompileContext ctx(cls);
|
||||
expr = expr->Resolve(ctx);
|
||||
if (!expr->isConstant())
|
||||
{
|
||||
|
@ -428,7 +428,7 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl
|
|||
if (sc.CheckToken('['))
|
||||
{
|
||||
FxExpression *expr = ParseExpression(sc, cls);
|
||||
FCompileContext ctx(cls, true);
|
||||
FCompileContext ctx(cls);
|
||||
int maxelems;
|
||||
expr = expr->Resolve(ctx);
|
||||
if (!expr->isConstant())
|
||||
|
|
Loading…
Reference in a new issue