zero float value counts as false. No other value in QC can have the bit pattern
0x80000000 as long as no int type is added.
I have verified that the only false floats on x86_64 and i386 are 0 and
0x80000000. However, this may fail on other platforms! (but then, OR_F and
others would also fail in some cases, as fteqcc also uses it for "float ||
entity").
When an "int" type is introduced, we'll need a new IF_I and IFNOT_I instruction
as then this would REALLY have a bad impact.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9113
d7cf8633-e32d-0410-b094-
e92efae38249
//==================
case OP_IFNOT:
- if (!OPA->_int)
+ if (!OPA->_float)
+ // TODO add an "int-ifnot"
+ // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
+ // and entity, string, field values can never have that value
{
prog->xfunction->profile += (st - startst);
st += st->b - 1; // offset the s++
break;
case OP_IF:
- if (OPA->_int)
+ if (OPA->_float)
+ // TODO add an "int-if"
+ // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
+ // and entity, string, field values can never have that value
{
prog->xfunction->profile += (st - startst);
st += st->b - 1; // offset the s++