mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Fix stack balancing problems by refactoring execution calls
- Con::executef now uses a template - All public execution functions now restore the console stack upon return - Fixed bad parameters on some callbacks - Reverts get*Arg behavior
This commit is contained in:
parent
b1ad72692c
commit
f44a3f27d6
43 changed files with 1781 additions and 358 deletions
|
|
@ -103,9 +103,7 @@ S32 QSORT_CALLBACK ArrayObject::_keyFunctionCompare( const void* a, const void*
|
|||
ArrayObject::Element* ea = ( ArrayObject::Element* )( a );
|
||||
ArrayObject::Element* eb = ( ArrayObject::Element* )( b );
|
||||
|
||||
ConsoleValueRef argv[] = { smCompareFunction, ea->key, eb->key };
|
||||
|
||||
S32 result = dAtoi( Con::execute( 3, argv ) );
|
||||
S32 result = dAtoi( Con::executef( (const char*)smCompareFunction, ea->value, eb->key ) );
|
||||
S32 res = result < 0 ? -1 : ( result > 0 ? 1 : 0 );
|
||||
return ( smDecreasing ? -res : res );
|
||||
}
|
||||
|
|
@ -115,9 +113,7 @@ S32 QSORT_CALLBACK ArrayObject::_valueFunctionCompare( const void* a, const void
|
|||
ArrayObject::Element* ea = ( ArrayObject::Element* )( a );
|
||||
ArrayObject::Element* eb = ( ArrayObject::Element* )( b );
|
||||
|
||||
ConsoleValueRef argv[] = { smCompareFunction, ea->value, eb->value };
|
||||
|
||||
S32 result = dAtoi( Con::execute( 3, argv ) );
|
||||
S32 result = dAtoi( Con::executef( (const char*)smCompareFunction, ea->value, eb->value ) );
|
||||
S32 res = result < 0 ? -1 : ( result > 0 ? 1 : 0 );
|
||||
return ( smDecreasing ? -res : res );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue