- addressed most unused/uninitialized variable warnings from MSVC.

This commit is contained in:
Christoph Oelckers 2021-11-14 15:03:50 +01:00
parent c6bd5c04c7
commit 01abe7b2ac
158 changed files with 94 additions and 468 deletions

View file

@ -2436,7 +2436,7 @@ ExpEmit FxAssign::Emit(VMFunctionBuilder *build)
ExpEmit result;
bool intconst = false;
int intconstval;
int intconstval = 0;
if (Right->isConstant() && Right->ValueType->GetRegType() == REGT_INT)
{
@ -4396,7 +4396,7 @@ ExpEmit FxBinaryLogical::Emit(VMFunctionBuilder *build)
build->Emit(OP_LI, to.RegNum, (Operator == TK_AndAnd) ? 1 : 0);
build->Emit(OP_JMP, 1);
build->BackpatchListToHere(no);
auto ctarget = build->Emit(OP_LI, to.RegNum, (Operator == TK_AndAnd) ? 0 : 1);
build->Emit(OP_LI, to.RegNum, (Operator == TK_AndAnd) ? 0 : 1);
list.DeleteAndClear();
list.ShrinkToFit();
return to;
@ -8036,7 +8036,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
}
// No need to create a dedicated node here, all builtins map directly to trivial operations.
Self->ValueType = TypeSInt32; // all builtins treat the texture index as integer.
FxExpression *x;
FxExpression *x = nullptr;
switch (MethodName.GetIndex())
{
case NAME_IsValid:

View file

@ -265,7 +265,7 @@ void VMDumpConstants(FILE *out, const VMScriptFunction *func)
void VMDisasm(FILE *out, const VMOP *code, int codesize, const VMScriptFunction *func)
{
VMFunction *callfunc;
VMFunction *callfunc = nullptr;
const char *name;
int col;
int mode;
@ -665,7 +665,6 @@ static int print_reg(FILE *out, int col, int arg, int mode, int immshift, const
default:
return col+printf_wrapper(out, "$%d", arg);
}
return col;
}
//==========================================================================

View file

@ -1302,12 +1302,10 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
ASSERTF(a); ASSERTF(B); ASSERTKF(C);
fb = reg.f[B]; fc = konstf[C];
goto Do_MODF;
NEXTOP;
OP(MODF_KR):
ASSERTF(a); ASSERTKF(B); ASSERTF(C);
fb = konstf[B]; fc = reg.f[C];
goto Do_MODF;
NEXTOP;
OP(POWF_RR):
ASSERTF(a); ASSERTF(B); ASSERTF(C);
@ -1712,7 +1710,6 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
// PrintParameters(reg.param + f->NumParam - B, B);
throw;
}
return 0;
}
static double DoFLOP(int flop, double v)

View file

@ -694,7 +694,6 @@ void ThrowAbortException(EVMAbortException reason, const char *moreinfo, ...)
va_list ap;
va_start(ap, moreinfo);
throw CVMAbortException(reason, moreinfo, ap);
va_end(ap);
}
void ThrowAbortException(VMScriptFunction *sfunc, VMOP *line, EVMAbortException reason, const char *moreinfo, ...)
@ -706,7 +705,6 @@ void ThrowAbortException(VMScriptFunction *sfunc, VMOP *line, EVMAbortException
err.stacktrace.AppendFormat("Called from %s at %s, line %d\n", sfunc->PrintableName.GetChars(), sfunc->SourceFileName.GetChars(), sfunc->PCToLine(line));
throw err;
va_end(ap);
}
DEFINE_ACTION_FUNCTION(DObject, ThrowAbortException)