1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-30 22:17:13 +02:00

More helper functions to the shared utility.

This commit is contained in:
Sandu Liviu Catalin
2016-06-07 03:04:57 +03:00
parent 0d6e80a9d5
commit 410a60cfe5
2 changed files with 64 additions and 0 deletions

View File

@ -750,6 +750,50 @@ Object MakeULongObj(HSQUIRRELVM vm, Uint64 val)
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)
{