- removed fixed_t and associated utility macros from FraggleScript code.

This commit is contained in:
Christoph Oelckers 2016-03-24 09:16:35 +01:00
commit eac0bfeaeb
6 changed files with 34 additions and 48 deletions

View file

@ -384,9 +384,9 @@ void FParser::OPdivide(svalue_t &result, int start, int n, int stop)
// haleyjd: 8-17
if(left.type == svt_fixed || right.type == svt_fixed)
{
fixed_t fr;
auto fr = fixedvalue(right);
if((fr = fixedvalue(right)) == 0)
if(fr == 0)
script_error("divide by zero\n");
else
{
@ -396,9 +396,9 @@ void FParser::OPdivide(svalue_t &result, int start, int n, int stop)
}
else
{
int ir;
auto ir = intvalue(right);
if(!(ir = intvalue(right)))
if(!ir)
script_error("divide by zero\n");
else
{
@ -508,8 +508,7 @@ void FParser::OPincrement(svalue_t &result, int start, int n, int stop)
}
else
{
result.value.f = fixedvalue(result) + FRACUNIT;
result.type = svt_fixed;
result.setDouble(floatvalue(result)+1);
var->SetValue (result);
}
}
@ -534,8 +533,7 @@ void FParser::OPincrement(svalue_t &result, int start, int n, int stop)
}
else
{
newvalue.type = svt_fixed;
newvalue.value.f = fixedvalue(result) + FRACUNIT;
newvalue.setDouble(floatvalue(result)+1);
var->SetValue (newvalue);
}
}
@ -573,7 +571,7 @@ void FParser::OPdecrement(svalue_t &result, int start, int n, int stop)
}
else
{
result.value.f = fixedvalue(result) - FRACUNIT;
result.setDouble(floatvalue(result)-1);
result.type = svt_fixed;
var->SetValue (result);
}
@ -599,8 +597,7 @@ void FParser::OPdecrement(svalue_t &result, int start, int n, int stop)
}
else
{
newvalue.type = svt_fixed;
newvalue.value.f = fixedvalue(result) - FRACUNIT;
newvalue.setDouble(floatvalue(result)-1);
var->SetValue (newvalue);
}
}