mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-03-14 08:07:14 +01:00
More helper functions to the shared utility.
This commit is contained in:
parent
0d6e80a9d5
commit
410a60cfe5
@ -750,6 +750,50 @@ Object MakeULongObj(HSQUIRRELVM vm, Uint64 val)
|
|||||||
return Var< Object >(vm, -1).value;
|
return Var< Object >(vm, -1).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Int64 FetchSLongObjVal(Object & val)
|
||||||
|
{
|
||||||
|
// Obtain the initial stack size
|
||||||
|
const StackGuard sg(DefaultVM::Get());
|
||||||
|
// Push the specified object onto the stack
|
||||||
|
Var< Object & >::push(DefaultVM::Get(), val);
|
||||||
|
// Retrieve and return the object value from the stack
|
||||||
|
return PopStackSLong(DefaultVM::Get(), -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Uint64 FetchULongObjVal(Object & val)
|
||||||
|
{
|
||||||
|
// Obtain the initial stack size
|
||||||
|
const StackGuard sg(DefaultVM::Get());
|
||||||
|
// Push the specified object onto the stack
|
||||||
|
Var< Object & >::push(DefaultVM::Get(), val);
|
||||||
|
// Retrieve and return the object value from the stack
|
||||||
|
return PopStackSLong(DefaultVM::Get(), -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Int64 FetchSLongObjVal(HSQUIRRELVM vm, Object & val)
|
||||||
|
{
|
||||||
|
// Obtain the initial stack size
|
||||||
|
const StackGuard sg(vm);
|
||||||
|
// Push the specified object onto the stack
|
||||||
|
Var< Object & >::push(vm, val);
|
||||||
|
// Retrieve and return the object value from the stack
|
||||||
|
return PopStackSLong(vm, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Uint64 FetchULongObjVal(HSQUIRRELVM vm, Object & val)
|
||||||
|
{
|
||||||
|
// Obtain the initial stack size
|
||||||
|
const StackGuard sg(vm);
|
||||||
|
// Push the specified object onto the stack
|
||||||
|
Var< Object & >::push(vm, val);
|
||||||
|
// Retrieve and return the object value from the stack
|
||||||
|
return PopStackSLong(vm, -1);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
||||||
{
|
{
|
||||||
|
@ -1450,6 +1450,26 @@ Object MakeSLongObj(HSQUIRRELVM vm, Int64 val);
|
|||||||
*/
|
*/
|
||||||
Object MakeULongObj(HSQUIRRELVM vm, Uint64 val);
|
Object MakeULongObj(HSQUIRRELVM vm, Uint64 val);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve a signed 64 bit integer from an signed long integer object.
|
||||||
|
*/
|
||||||
|
Int64 FetchSLongObjVal(Object & val);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve a unsigned 64 bit integer from an unsigned long integer object.
|
||||||
|
*/
|
||||||
|
Uint64 FetchULongObjVal(Object & val);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve a signed 64 bit integer from an signed long integer object.
|
||||||
|
*/
|
||||||
|
Int64 FetchSLongObjVal(HSQUIRRELVM vm, Object & val);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* Retrieve a unsigned 64 bit integer from an unsigned long integer object.
|
||||||
|
*/
|
||||||
|
Uint64 FetchULongObjVal(HSQUIRRELVM vm, Object & val);
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Attempt to pop the value at the specified index on the stack as a native integer.
|
* Attempt to pop the value at the specified index on the stack as a native integer.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user