1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-30 20:51:48 +02:00

More code cleanup.

This commit is contained in:
Sandu Liviu Catalin
2020-03-22 09:16:40 +02:00
parent 615f3a4d46
commit 3080c20341
31 changed files with 701 additions and 1148 deletions

View File

@@ -254,6 +254,49 @@ Uint64 PopStackULong(HSQUIRRELVM vm, SQInteger idx)
return 0;
}
// ------------------------------------------------------------------------------------------------
const SLongInt & GetSLongInt()
{
static SLongInt l;
l.SetNum(0);
return l;
}
const SLongInt & GetSLongInt(Int64 n)
{
static SLongInt l;
l.SetNum(n);
return l;
}
const SLongInt & GetSLongInt(CSStr s)
{
static SLongInt l;
l = s;
return l;
}
const ULongInt & GetULongInt()
{
static ULongInt l;
l.SetNum(0);
return l;
}
const ULongInt & GetULongInt(Uint64 n)
{
static ULongInt l;
l.SetNum(n);
return l;
}
const ULongInt & GetULongInt(CSStr s)
{
static ULongInt l;
l = s;
return l;
}
// ================================================================================================
void Register_LongInt(HSQUIRRELVM vm)
{

View File

@@ -1284,4 +1284,14 @@ Int64 PopStackSLong(HSQUIRRELVM vm, SQInteger idx);
*/
Uint64 PopStackULong(HSQUIRRELVM vm, SQInteger idx);
/* ------------------------------------------------------------------------------------------------
* Get a persistent LongInt instance with the given values.
*/
const SLongInt & GetSLongInt();
const SLongInt & GetSLongInt(Int64 n);
const SLongInt & GetSLongInt(CSStr s);
const ULongInt & GetULongInt();
const ULongInt & GetULongInt(Uint64 n);
const ULongInt & GetULongInt(CSStr s);
} // Namespace:: SqMod