1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-19 03:57:14 +01:00

Replace GetObject with GetObj to avoid collisions on Windows.

ef you MS
This commit is contained in:
Sandu Liviu Catalin 2020-04-17 17:42:09 +03:00
parent 1242b8a2fc
commit e13d1a91e7
22 changed files with 94 additions and 95 deletions

View File

@ -31,11 +31,6 @@
#include <stdexcept> #include <stdexcept>
#include <algorithm> #include <algorithm>
// ------------------------------------------------------------------------------------------------
#ifdef GetObject
#undef GetObject
#endif // ef you MS
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
namespace SqMod { namespace SqMod {
@ -371,6 +366,8 @@ bool Core::Initialize()
// Initialize routines and tasks // Initialize routines and tasks
InitializeRoutines(); InitializeRoutines();
InitializeTasks(); InitializeTasks();
// Initialize third-party
// Initialization successful // Initialization successful
return true; return true;
@ -478,6 +475,8 @@ void Core::Terminate(bool shutdown)
const ContainerCleaner cc_blips(m_Blips, ENT_BLIP, !shutdown); const ContainerCleaner cc_blips(m_Blips, ENT_BLIP, !shutdown);
const ContainerCleaner cc_keybinds(m_Keybinds, ENT_KEYBIND, !shutdown); const ContainerCleaner cc_keybinds(m_Keybinds, ENT_KEYBIND, !shutdown);
cLogDbg(m_Verbosity >= 1, "Terminating routines an commands"); cLogDbg(m_Verbosity >= 1, "Terminating routines an commands");
// Release third-party
// Release all resources from routines and tasks // Release all resources from routines and tasks
TerminateRoutines(); TerminateRoutines();
TerminateTasks(); TerminateTasks();

View File

@ -1056,7 +1056,7 @@ public:
BlipInst & GetBlip(Int32 id) { return m_Blips.at(static_cast< size_t >(id)); } BlipInst & GetBlip(Int32 id) { return m_Blips.at(static_cast< size_t >(id)); }
CheckpointInst & GetCheckpoint(Int32 id) { return m_Checkpoints.at(static_cast< size_t >(id)); } CheckpointInst & GetCheckpoint(Int32 id) { return m_Checkpoints.at(static_cast< size_t >(id)); }
KeybindInst & GetKeybind(Int32 id) { return m_Keybinds.at(static_cast< size_t >(id)); } KeybindInst & GetKeybind(Int32 id) { return m_Keybinds.at(static_cast< size_t >(id)); }
ObjectInst & GetObject(Int32 id) { return m_Objects.at(static_cast< size_t >(id)); } ObjectInst & GetObj(Int32 id) { return m_Objects.at(static_cast< size_t >(id)); }
PickupInst & GetPickup(Int32 id) { return m_Pickups.at(static_cast< size_t >(id)); } PickupInst & GetPickup(Int32 id) { return m_Pickups.at(static_cast< size_t >(id)); }
PlayerInst & GetPlayer(Int32 id) { return m_Players.at(static_cast< size_t >(id)); } PlayerInst & GetPlayer(Int32 id) { return m_Players.at(static_cast< size_t >(id)); }
VehicleInst & GetVehicle(Int32 id) { return m_Vehicles.at(static_cast< size_t >(id)); } VehicleInst & GetVehicle(Int32 id) { return m_Vehicles.at(static_cast< size_t >(id)); }
@ -1067,7 +1067,7 @@ public:
const Blips & GetBlips() const { return m_Blips; } const Blips & GetBlips() const { return m_Blips; }
const Checkpoints & GetCheckpoints() const { return m_Checkpoints; } const Checkpoints & GetCheckpoints() const { return m_Checkpoints; }
const Keybinds & GetKeybinds() const { return m_Keybinds; } const Keybinds & GetKeybinds() const { return m_Keybinds; }
const Objects & GetObjects() const { return m_Objects; } const Objects & GetObjs() const { return m_Objects; }
const Pickups & GetPickups() const { return m_Pickups; } const Pickups & GetPickups() const { return m_Pickups; }
const Players & GetPlayers() const { return m_Players; } const Players & GetPlayers() const { return m_Players; }
const Vehicles & GetVehicles() const { return m_Vehicles; } const Vehicles & GetVehicles() const { return m_Vehicles; }

View File

@ -193,7 +193,7 @@ static LightObj & SqGetKeybind(Int32 id)
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static LightObj & SqGetObject(Int32 id) static LightObj & SqGetObj(Int32 id)
{ {
// Validate the identifier first // Validate the identifier first
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
@ -201,7 +201,7 @@ static LightObj & SqGetObject(Int32 id)
STHROWF("Out of range object identifier: %d", id); STHROWF("Out of range object identifier: %d", id);
} }
// Return the requested information // Return the requested information
return Core::Get().GetObject(id).mObj; return Core::Get().GetObj(id).mObj;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -345,7 +345,7 @@ void Register_Core(HSQUIRRELVM vm)
.Func(_SC("GetBlip"), &SqGetBlip) .Func(_SC("GetBlip"), &SqGetBlip)
.Func(_SC("GetCheckpoint"), &SqGetCheckpoint) .Func(_SC("GetCheckpoint"), &SqGetCheckpoint)
.Func(_SC("GetKeybind"), &SqGetKeybind) .Func(_SC("GetKeybind"), &SqGetKeybind)
.Func(_SC("GetObject"), &SqGetObject) .Func(_SC("GetObj"), &SqGetObj)
.Func(_SC("GetPickup"), &SqGetPickup) .Func(_SC("GetPickup"), &SqGetPickup)
.Func(_SC("GetPlayer"), &SqGetPlayer) .Func(_SC("GetPlayer"), &SqGetPlayer)
.Func(_SC("GetVehicle"), &SqGetVehicle) .Func(_SC("GetVehicle"), &SqGetVehicle)

View File

@ -15,7 +15,7 @@ const Int32 CBlip::Max = SQMOD_BLIP_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CBlip::SqGetNull(HSQUIRRELVM vm) SQInteger CBlip::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullBlip().GetObject()); sq_pushobject(vm, Core::Get().GetNullBlip().GetObj());
return 1; return 1;
} }

View File

@ -18,7 +18,7 @@ const Int32 CCheckpoint::Max = SQMOD_CHECKPOINT_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CCheckpoint::SqGetNull(HSQUIRRELVM vm) SQInteger CCheckpoint::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullCheckpoint().GetObject()); sq_pushobject(vm, Core::Get().GetNullCheckpoint().GetObj());
return 1; return 1;
} }

View File

@ -15,7 +15,7 @@ const Int32 CKeybind::Max = SQMOD_KEYBIND_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CKeybind::SqGetNull(HSQUIRRELVM vm) SQInteger CKeybind::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullKeybind().GetObject()); sq_pushobject(vm, Core::Get().GetNullKeybind().GetObj());
return 1; return 1;
} }

View File

@ -18,7 +18,7 @@ const Int32 CObject::Max = SQMOD_OBJECT_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CObject::SqGetNull(HSQUIRRELVM vm) SQInteger CObject::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullObject().GetObject()); sq_pushobject(vm, Core::Get().GetNullObject().GetObj());
return 1; return 1;
} }
@ -107,7 +107,7 @@ LightObj & CObject::GetEvents() const
// Validate the managed identifier // Validate the managed identifier
Validate(); Validate();
// Return the associated event table // Return the associated event table
return Core::Get().GetObject(m_ID).mEvents; return Core::Get().GetObj(m_ID).mEvents;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View File

@ -17,7 +17,7 @@ const Int32 CPickup::Max = SQMOD_PICKUP_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CPickup::SqGetNull(HSQUIRRELVM vm) SQInteger CPickup::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullPickup().GetObject()); sq_pushobject(vm, Core::Get().GetNullPickup().GetObj());
return 1; return 1;
} }

View File

@ -27,7 +27,7 @@ const Int32 CPlayer::Max = SQMOD_PLAYER_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CPlayer::SqGetNull(HSQUIRRELVM vm) SQInteger CPlayer::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullPlayer().GetObject()); sq_pushobject(vm, Core::Get().GetNullPlayer().GetObj());
return 1; return 1;
} }
@ -1329,7 +1329,7 @@ LightObj & CPlayer::StandingOnObject() const
if (VALID_ENTITYEX(id, SQMOD_OBJECT_POOL)) if (VALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
{ {
// Return the requested information // Return the requested information
return Core::Get().GetObject(id).mObj; return Core::Get().GetObj(id).mObj;
} }
// Default to a null object // Default to a null object
return Core::Get().GetNullObject(); return Core::Get().GetNullObject();

View File

@ -20,7 +20,7 @@ const Int32 CVehicle::Max = SQMOD_VEHICLE_POOL;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
SQInteger CVehicle::SqGetNull(HSQUIRRELVM vm) SQInteger CVehicle::SqGetNull(HSQUIRRELVM vm)
{ {
sq_pushobject(vm, Core::Get().GetNullVehicle().GetObject()); sq_pushobject(vm, Core::Get().GetNullVehicle().GetObj());
return 1; return 1;
} }

View File

@ -661,7 +661,7 @@ Int32 SQLiteConnHnd::Flush(Uint32 num, Object & env, Function & func)
num = mQueue.size(); num = mQueue.size();
} }
// Generate the function that should be called upon error // Generate the function that should be called upon error
Function callback = Function(env.GetVM(), env.GetObject(), func.GetFunc()); Function callback = Function(env.GetVM(), env.GetObj(), func.GetFunc());
// Obtain iterators to the range of queries that should be flushed // Obtain iterators to the range of queries that should be flushed
auto itr = mQueue.begin(); auto itr = mQueue.begin();
auto end = mQueue.begin() + num; auto end = mQueue.begin() + num;

View File

@ -712,7 +712,7 @@ template <> struct InstSpec< CObject >
*/ */
static inline Instances::const_iterator CBegin() static inline Instances::const_iterator CBegin()
{ {
return Core::Get().GetObjects().cbegin(); return Core::Get().GetObjs().cbegin();
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
@ -720,7 +720,7 @@ template <> struct InstSpec< CObject >
*/ */
static inline Instances::const_iterator CEnd() static inline Instances::const_iterator CEnd()
{ {
return Core::Get().GetObjects().cend(); return Core::Get().GetObjs().cend();
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
@ -907,7 +907,7 @@ template < typename T > struct AppendElemFunc
void operator () (const typename InstSpec< T >::Instance & inst) const void operator () (const typename InstSpec< T >::Instance & inst) const
{ {
// Push the script object on the stack // Push the script object on the stack
sq_pushobject(mVM, inst.mObj.GetObject()); sq_pushobject(mVM, inst.mObj.GetObj());
// Append the object at the back of the array // Append the object at the back of the array
if (SQ_FAILED(sq_arrayappend(mVM, mIdx))) if (SQ_FAILED(sq_arrayappend(mVM, mIdx)))
{ {

View File

@ -640,7 +640,7 @@ public:
} }
else else
{ {
m_OnFail = Function(env.GetVM(), env.GetObject(), func.GetFunc()); m_OnFail = Function(env.GetVM(), env.GetObj(), func.GetFunc());
} }
} }
@ -669,7 +669,7 @@ public:
} }
else else
{ {
m_OnAuth = Function(env.GetVM(), env.GetObject(), func.GetFunc()); m_OnAuth = Function(env.GetVM(), env.GetObj(), func.GetFunc());
} }
} }
@ -1761,7 +1761,7 @@ public:
} }
else else
{ {
m_OnExec = Function(env.GetVM(), env.GetObject(), func.GetFunc()); m_OnExec = Function(env.GetVM(), env.GetObj(), func.GetFunc());
} }
} }
@ -1790,7 +1790,7 @@ public:
} }
else else
{ {
m_OnAuth = Function(env.GetVM(), env.GetObject(), func.GetFunc()); m_OnAuth = Function(env.GetVM(), env.GetObj(), func.GetFunc());
} }
} }
@ -1819,7 +1819,7 @@ public:
} }
else else
{ {
m_OnPost = Function(env.GetVM(), env.GetObject(), func.GetFunc()); m_OnPost = Function(env.GetVM(), env.GetObj(), func.GetFunc());
} }
} }
@ -1848,7 +1848,7 @@ public:
} }
else else
{ {
m_OnFail = Function(env.GetVM(), env.GetObject(), func.GetFunc()); m_OnFail = Function(env.GetVM(), env.GetObj(), func.GetFunc());
} }
} }

View File

@ -434,7 +434,7 @@ public:
*/ */
void SetEnv(const LightObj & env) void SetEnv(const LightObj & env)
{ {
GetValid().mEnv = env.IsNull() ? LightObj(RootTable().GetObject()) : env; GetValid().mEnv = env.IsNull() ? LightObj(RootTable().GetObj()) : env;
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------

View File

@ -113,7 +113,7 @@ protected:
* Forwarding constructor. * Forwarding constructor.
*/ */
Slot(Object & env, Function & func) Slot(Object & env, Function & func)
: Slot(env.GetObject(), func.GetFunc()) : Slot(env.GetObj(), func.GetFunc())
{ {
/* ... */ /* ... */
} }

View File

@ -190,7 +190,7 @@ LightObj & Tasks::FindEntity(Int32 id, Int32 type)
case ENT_BLIP: return Core::Get().GetBlip(id).mObj; case ENT_BLIP: return Core::Get().GetBlip(id).mObj;
case ENT_CHECKPOINT: return Core::Get().GetCheckpoint(id).mObj; case ENT_CHECKPOINT: return Core::Get().GetCheckpoint(id).mObj;
case ENT_KEYBIND: return Core::Get().GetKeybind(id).mObj; case ENT_KEYBIND: return Core::Get().GetKeybind(id).mObj;
case ENT_OBJECT: return Core::Get().GetObject(id).mObj; case ENT_OBJECT: return Core::Get().GetObj(id).mObj;
case ENT_PICKUP: return Core::Get().GetPickup(id).mObj; case ENT_PICKUP: return Core::Get().GetPickup(id).mObj;
case ENT_PLAYER: return Core::Get().GetPlayer(id).mObj; case ENT_PLAYER: return Core::Get().GetPlayer(id).mObj;
case ENT_VEHICLE: return Core::Get().GetVehicle(id).mObj; case ENT_VEHICLE: return Core::Get().GetVehicle(id).mObj;
@ -244,7 +244,7 @@ SQInteger Tasks::Create(Int32 id, Int32 type, HSQUIRRELVM vm)
// Attempt to retrieve the entity instance // Attempt to retrieve the entity instance
try try
{ {
inst = FindEntity(id, type).GetObject(); inst = FindEntity(id, type).GetObj();
} }
catch (const std::exception & e) catch (const std::exception & e)
{ {

View File

@ -140,9 +140,9 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Bind(const SQInteger index, Object& obj) { void Bind(const SQInteger index, Object& obj) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
sq_pushobject(vm, obj.GetObject()); sq_pushobject(vm, obj.GetObj());
sq_set(vm, -3); sq_set(vm, -3);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
} }
@ -158,7 +158,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ArrayBase& SquirrelFunc(const SQInteger index, SQFUNCTION func, const SQChar* name = nullptr) { ArrayBase& SquirrelFunc(const SQInteger index, SQFUNCTION func, const SQChar* name = nullptr) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
sq_newclosure(vm, func, 0); sq_newclosure(vm, func, 0);
// Set the closure name (for debug purposes) // Set the closure name (for debug purposes)
@ -181,7 +181,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ArrayBase& SquirrelFunc(const SQInteger index, SQFUNCTION func, SQInteger pnum, const SQChar * mask, const SQChar* name = nullptr) { ArrayBase& SquirrelFunc(const SQInteger index, SQFUNCTION func, SQInteger pnum, const SQChar * mask, const SQChar* name = nullptr) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
sq_newclosure(vm, func, 0); sq_newclosure(vm, func, 0);
// Set the closure name (for debug purposes) // Set the closure name (for debug purposes)
@ -206,7 +206,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class V> template<class V>
ArrayBase& SetValue(const SQInteger index, const V& val) { ArrayBase& SetValue(const SQInteger index, const V& val) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
PushVar(vm, val); PushVar(vm, val);
sq_set(vm, -3); sq_set(vm, -3);
@ -303,7 +303,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Function GetFunction(const SQInteger index) { Function GetFunction(const SQInteger index) {
HSQOBJECT funcObj; HSQOBJECT funcObj;
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
if(SQ_FAILED(sq_get(vm, -2))) { if(SQ_FAILED(sq_get(vm, -2))) {
@ -319,7 +319,7 @@ public:
sq_get(vm, -2); sq_get(vm, -2);
#endif #endif
sq_getstackobj(vm, -1, &funcObj); sq_getstackobj(vm, -1, &funcObj);
Function ret(vm, GetObject(), funcObj); // must addref before the pop! Function ret(vm, GetObj(), funcObj); // must addref before the pop!
sq_pop(vm, 2); sq_pop(vm, 2);
return ret; return ret;
} }
@ -339,7 +339,7 @@ public:
template <typename T> template <typename T>
void GetArray(T* array, int size) const void GetArray(T* array, int size) const
{ {
HSQOBJECT value = GetObject(); HSQOBJECT value = GetObj();
sq_pushobject(vm, value); sq_pushobject(vm, value);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
if (size > sq_getsize(vm, -1)) { if (size > sq_getsize(vm, -1)) {
@ -384,7 +384,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class V> template<class V>
ArrayBase& Append(const V& val) { ArrayBase& Append(const V& val) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
PushVar(vm, val); PushVar(vm, val);
sq_arrayappend(vm, -2); sq_arrayappend(vm, -2);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
@ -403,7 +403,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class V> template<class V>
ArrayBase& Append(V* val) { ArrayBase& Append(V* val) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
PushVar(vm, val); PushVar(vm, val);
sq_arrayappend(vm, -2); sq_arrayappend(vm, -2);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
@ -423,7 +423,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class V> template<class V>
ArrayBase& Insert(const SQInteger destpos, const V& val) { ArrayBase& Insert(const SQInteger destpos, const V& val) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
PushVar(vm, val); PushVar(vm, val);
sq_arrayinsert(vm, -2, destpos); sq_arrayinsert(vm, -2, destpos);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
@ -443,7 +443,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class V> template<class V>
ArrayBase& Insert(const SQInteger destpos, V* val) { ArrayBase& Insert(const SQInteger destpos, V* val) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
PushVar(vm, val); PushVar(vm, val);
sq_arrayinsert(vm, -2, destpos); sq_arrayinsert(vm, -2, destpos);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
@ -458,7 +458,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Object Pop() { Object Pop() {
HSQOBJECT slotObj; HSQOBJECT slotObj;
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
if(SQ_FAILED(sq_arraypop(vm, -1, true))) { if(SQ_FAILED(sq_arraypop(vm, -1, true))) {
sq_pop(vm, 1); sq_pop(vm, 1);
return Object(); // Return a NULL object return Object(); // Return a NULL object
@ -479,7 +479,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ArrayBase& Remove(const SQInteger itemidx) { ArrayBase& Remove(const SQInteger itemidx) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_arrayremove(vm, -1, itemidx); sq_arrayremove(vm, -1, itemidx);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
return *this; return *this;
@ -494,7 +494,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ArrayBase& Resize(const SQInteger newsize) { ArrayBase& Resize(const SQInteger newsize) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_arrayresize(vm, -1, newsize); sq_arrayresize(vm, -1, newsize);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
return *this; return *this;
@ -507,7 +507,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ArrayBase& Reverse() { ArrayBase& Reverse() {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_arrayreverse(vm, -1); sq_arrayreverse(vm, -1);
sq_pop(vm,1); // pop array sq_pop(vm,1); // pop array
return *this; return *this;
@ -539,7 +539,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class F> template<class F>
ArrayBase& AppendFrom(F&& func) { ArrayBase& AppendFrom(F&& func) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
while (func(vm)) while (func(vm))
{ {
sq_arrayappend(vm, -2); sq_arrayappend(vm, -2);
@ -695,7 +695,7 @@ struct Var<Array> {
static void push(HSQUIRRELVM vm, const Array& value) { static void push(HSQUIRRELVM vm, const Array& value) {
HSQOBJECT obj; HSQOBJECT obj;
sq_resetobject(&obj); sq_resetobject(&obj);
obj = value.GetObject(); obj = value.GetObj();
sq_pushobject(vm,obj); sq_pushobject(vm,obj);
} }
}; };

View File

@ -132,7 +132,7 @@ public:
/// \return Squirrel object representing the Squirrel class /// \return Squirrel object representing the Squirrel class
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual HSQOBJECT GetObject() const { virtual HSQOBJECT GetObj() const {
return ClassType<C>::getClassData(vm)->classObj; return ClassType<C>::getClassData(vm)->classObj;
} }
@ -142,7 +142,7 @@ public:
/// \return Squirrel object representing the Squirrel class /// \return Squirrel object representing the Squirrel class
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual HSQOBJECT& GetObject() { virtual HSQOBJECT& GetObj() {
return ClassType<C>::getClassData(vm)->classObj; return ClassType<C>::getClassData(vm)->classObj;
} }

View File

@ -359,9 +359,9 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ConstTable& Enum(const SQChar* name, Enumeration& en) { ConstTable& Enum(const SQChar* name, Enumeration& en) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
sq_pushobject(vm, en.GetObject()); sq_pushobject(vm, en.GetObj());
sq_newslot(vm, -3, false); sq_newslot(vm, -3, false);
sq_pop(vm,1); // pop table sq_pop(vm,1); // pop table
return *this; return *this;

View File

@ -65,10 +65,10 @@ struct Function {
sq_resetobject(&sf.GetFunc()); sq_resetobject(&sf.GetFunc());
} }
// Constructs a Function from a slot in an Object // Constructs a Function from a slot in an Object
Function(const Object& e, const SQChar* slot) : mEnv(e.GetObject()) { Function(const Object& e, const SQChar* slot) : mEnv(e.GetObj()) {
sq_addref(DefaultVM::Get_(), &mEnv); sq_addref(DefaultVM::Get_(), &mEnv);
Object so = e.GetSlot(slot); Object so = e.GetSlot(slot);
mObj = so.GetObject(); mObj = so.GetObj();
sq_addref(DefaultVM::Get_(), &mObj); sq_addref(DefaultVM::Get_(), &mObj);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
SQObjectType value_type = so.GetType(); SQObjectType value_type = so.GetType();

View File

@ -223,7 +223,7 @@ public:
vm = so.vm; vm = so.vm;
obj = so.obj; obj = so.obj;
release = so.release; release = so.release;
sq_addref(vm, &GetObject()); sq_addref(vm, &GetObj());
return *this; return *this;
} }
@ -271,7 +271,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ResetObj() { void ResetObj() {
sq_resetobject(&GetObject()); sq_resetobject(&GetObj());
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -280,7 +280,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Reset() { void Reset() {
vm = nullptr; vm = nullptr;
sq_resetobject(&GetObject()); sq_resetobject(&GetObj());
release = false; release = false;
} }
@ -311,7 +311,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SQObjectType GetType() const { SQObjectType GetType() const {
return GetObject()._type; return GetObj()._type;
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -321,7 +321,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool IsNull() const { bool IsNull() const {
return sq_isnull(GetObject()); return sq_isnull(GetObj());
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -330,7 +330,7 @@ public:
/// \return Squirrel object /// \return Squirrel object
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual HSQOBJECT GetObject() const { virtual HSQOBJECT GetObj() const {
return obj; return obj;
} }
@ -340,7 +340,7 @@ public:
/// \return Squirrel object /// \return Squirrel object
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual HSQOBJECT& GetObject() { virtual HSQOBJECT& GetObj() {
return obj; return obj;
} }
@ -349,7 +349,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
operator HSQOBJECT&() { operator HSQOBJECT&() {
return GetObject(); return GetObj();
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -371,7 +371,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Object GetSlot(const SQChar* slot) const { Object GetSlot(const SQChar* slot) const {
HSQOBJECT slotObj; HSQOBJECT slotObj;
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, slot, -1); sq_pushstring(vm, slot, -1);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
@ -403,7 +403,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Object GetSlot(SQInteger index) const { Object GetSlot(SQInteger index) const {
HSQOBJECT slotObj; HSQOBJECT slotObj;
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
@ -434,7 +434,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool HasKey(const SQChar* key) const { bool HasKey(const SQChar* key) const {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, key, -1); sq_pushstring(vm, key, -1);
if (SQ_FAILED(sq_get(vm, -2))) { if (SQ_FAILED(sq_get(vm, -2))) {
sq_pop(vm, 1); sq_pop(vm, 1);
@ -453,7 +453,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool HasKey(SQInteger index) const { bool HasKey(SQInteger index) const {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
if (SQ_FAILED(sq_get(vm, -2))) { if (SQ_FAILED(sq_get(vm, -2))) {
sq_pop(vm, 1); sq_pop(vm, 1);
@ -476,7 +476,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <class T> template <class T>
T Cast() const { T Cast() const {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
T ret = Var<T>(vm, -1).value; T ret = Var<T>(vm, -1).value;
sq_pop(vm, 1); sq_pop(vm, 1);
return ret; return ret;
@ -505,7 +505,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SQInteger GetSize() const { SQInteger GetSize() const {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
SQInteger ret = sq_getsize(vm, -1); SQInteger ret = sq_getsize(vm, -1);
sq_pop(vm, 1); sq_pop(vm, 1);
return ret; return ret;
@ -623,7 +623,7 @@ protected:
// Bind a function and it's associated Squirrel closure to the object // Bind a function and it's associated Squirrel closure to the object
inline void BindFunc(const SQChar* name, void* method, size_t methodSize, SQFUNCTION func, bool staticVar = false) { inline void BindFunc(const SQChar* name, void* method, size_t methodSize, SQFUNCTION func, bool staticVar = false) {
// Push object/environment // Push object/environment
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
// Push name where the closure will be stored // Push name where the closure will be stored
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
// Push the native closure pointer as a free variable // Push the native closure pointer as a free variable
@ -641,7 +641,7 @@ protected:
inline void BindFunc(const SQInteger index, void* method, size_t methodSize, SQFUNCTION func, bool staticVar = false, const SQChar* name = nullptr) { inline void BindFunc(const SQInteger index, void* method, size_t methodSize, SQFUNCTION func, bool staticVar = false, const SQChar* name = nullptr) {
// Push object/environment // Push object/environment
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
// Push index where the closure will be stored // Push index where the closure will be stored
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
// Push the native closure pointer as a free variable // Push the native closure pointer as a free variable
@ -664,7 +664,7 @@ protected:
overloadName.reserve(15); overloadName.reserve(15);
SqOverloadName::Get(name, argCount, overloadName); SqOverloadName::Get(name, argCount, overloadName);
// Push object/environment // Push object/environment
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
// Bind overload handler // Bind overload handler
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
@ -694,7 +694,7 @@ protected:
// Set the value of a variable on the object. Changes to values set this way are not reciprocated // Set the value of a variable on the object. Changes to values set this way are not reciprocated
template<class V> template<class V>
inline void BindValue(const SQChar* name, const V& val, bool staticVar = false) { inline void BindValue(const SQChar* name, const V& val, bool staticVar = false) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
PushVar(vm, val); PushVar(vm, val);
sq_newslot(vm, -3, staticVar); sq_newslot(vm, -3, staticVar);
@ -702,7 +702,7 @@ protected:
} }
template<class V> template<class V>
inline void BindValue(const SQInteger index, const V& val, bool staticVar = false) { inline void BindValue(const SQInteger index, const V& val, bool staticVar = false) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
PushVar(vm, val); PushVar(vm, val);
sq_newslot(vm, -3, staticVar); sq_newslot(vm, -3, staticVar);
@ -712,7 +712,7 @@ protected:
// Set the value of an instance on the object. Changes to values set this way are reciprocated back to the source instance // Set the value of an instance on the object. Changes to values set this way are reciprocated back to the source instance
template<class V> template<class V>
inline void BindInstance(const SQChar* name, V* val, bool staticVar = false) { inline void BindInstance(const SQChar* name, V* val, bool staticVar = false) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
PushVar(vm, val); PushVar(vm, val);
sq_newslot(vm, -3, staticVar); sq_newslot(vm, -3, staticVar);
@ -720,7 +720,7 @@ protected:
} }
template<class V> template<class V>
inline void BindInstance(const SQInteger index, V* val, bool staticVar = false) { inline void BindInstance(const SQInteger index, V* val, bool staticVar = false) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
PushVar(vm, val); PushVar(vm, val);
sq_newslot(vm, -3, staticVar); sq_newslot(vm, -3, staticVar);
@ -733,7 +733,7 @@ protected:
/// @cond DEV /// @cond DEV
template<> template<>
inline void Object::BindValue<int>(const SQChar* name, const int & val, bool staticVar /* = false */) { inline void Object::BindValue<int>(const SQChar* name, const int & val, bool staticVar /* = false */) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
PushVar<int>(vm, val); PushVar<int>(vm, val);
sq_newslot(vm, -3, staticVar); sq_newslot(vm, -3, staticVar);
@ -770,7 +770,7 @@ struct Var<Object> {
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void push(HSQUIRRELVM vm, const Object& value) { static void push(HSQUIRRELVM vm, const Object& value) {
sq_pushobject(vm, value.GetObject()); sq_pushobject(vm, value.GetObj());
} }
}; };
@ -900,7 +900,7 @@ struct LightObj {
/// \param so Object to copy /// \param so Object to copy
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
LightObj(const Object& obj) : mObj(obj.GetObject()) { LightObj(const Object& obj) : mObj(obj.GetObj()) {
if (!sq_isnull(mObj)) { if (!sq_isnull(mObj)) {
sq_addref(obj.GetVM(), &mObj); sq_addref(obj.GetVM(), &mObj);
} }
@ -1055,7 +1055,7 @@ struct LightObj {
/// \return Squirrel object /// \return Squirrel object
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
HSQOBJECT GetObject() const { HSQOBJECT GetObj() const {
return mObj; return mObj;
} }
@ -1065,7 +1065,7 @@ struct LightObj {
/// \return Squirrel object /// \return Squirrel object
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
HSQOBJECT& GetObject() { HSQOBJECT& GetObj() {
return mObj; return mObj;
} }
@ -1174,7 +1174,7 @@ inline Object& Object::operator=(const LightObj& so) {
vm = SqVM(); vm = SqVM();
obj = so.mObj; obj = so.mObj;
release = !so.IsNull(); release = !so.IsNull();
sq_addref(vm, &GetObject()); sq_addref(vm, &GetObj());
return *this; return *this;
} }

View File

@ -158,9 +158,9 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Bind(const SQChar* name, Object& obj) { void Bind(const SQChar* name, Object& obj) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
sq_pushobject(vm, obj.GetObject()); sq_pushobject(vm, obj.GetObj());
sq_newslot(vm, -3, false); sq_newslot(vm, -3, false);
sq_pop(vm,1); // pop table sq_pop(vm,1); // pop table
} }
@ -176,9 +176,9 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Bind(const SQChar* name, LightObj& obj) { void Bind(const SQChar* name, LightObj& obj) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
sq_pushobject(vm, obj.GetObject()); sq_pushobject(vm, obj.GetObj());
sq_newslot(vm, -3, false); sq_newslot(vm, -3, false);
sq_pop(vm,1); // pop table sq_pop(vm,1); // pop table
} }
@ -193,7 +193,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TableBase& SquirrelFunc(const SQChar* name, SQFUNCTION func) { TableBase& SquirrelFunc(const SQChar* name, SQFUNCTION func) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
sq_newclosure(vm, func, 0); sq_newclosure(vm, func, 0);
// Set the closure name (for debug purposes) // Set the closure name (for debug purposes)
@ -215,7 +215,7 @@ public:
/// ///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TableBase& SquirrelFunc(const SQChar* name, SQFUNCTION func, SQInteger pnum, const SQChar * mask) { TableBase& SquirrelFunc(const SQChar* name, SQFUNCTION func, SQInteger pnum, const SQChar * mask) {
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
sq_newclosure(vm, func, 0); sq_newclosure(vm, func, 0);
// Set the closure name (for debug purposes) // Set the closure name (for debug purposes)
@ -469,7 +469,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Function GetFunction(const SQChar* name) { Function GetFunction(const SQChar* name) {
HSQOBJECT funcObj; HSQOBJECT funcObj;
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushstring(vm, name, -1); sq_pushstring(vm, name, -1);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
if(SQ_FAILED(sq_get(vm, -2))) { if(SQ_FAILED(sq_get(vm, -2))) {
@ -485,7 +485,7 @@ public:
sq_get(vm, -2); sq_get(vm, -2);
#endif #endif
sq_getstackobj(vm, -1, &funcObj); sq_getstackobj(vm, -1, &funcObj);
Function ret(vm, GetObject(), funcObj); // must addref before the pop! Function ret(vm, GetObj(), funcObj); // must addref before the pop!
sq_pop(vm, 2); sq_pop(vm, 2);
return ret; return ret;
} }
@ -500,7 +500,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Function GetFunction(const SQInteger index) { Function GetFunction(const SQInteger index) {
HSQOBJECT funcObj; HSQOBJECT funcObj;
sq_pushobject(vm, GetObject()); sq_pushobject(vm, GetObj());
sq_pushinteger(vm, index); sq_pushinteger(vm, index);
#if !defined (SCRAT_NO_ERROR_CHECKING) #if !defined (SCRAT_NO_ERROR_CHECKING)
if(SQ_FAILED(sq_get(vm, -2))) { if(SQ_FAILED(sq_get(vm, -2))) {
@ -516,7 +516,7 @@ public:
sq_get(vm, -2); sq_get(vm, -2);
#endif #endif
sq_getstackobj(vm, -1, &funcObj); sq_getstackobj(vm, -1, &funcObj);
Function ret(vm, GetObject(), funcObj); // must addref before the pop! Function ret(vm, GetObj(), funcObj); // must addref before the pop!
sq_pop(vm, 2); sq_pop(vm, 2);
return ret; return ret;
} }
@ -722,7 +722,7 @@ struct Var<Table> {
static void push(HSQUIRRELVM vm, const Table& value) { static void push(HSQUIRRELVM vm, const Table& value) {
HSQOBJECT obj; HSQOBJECT obj;
sq_resetobject(&obj); sq_resetobject(&obj);
obj = value.GetObject(); obj = value.GetObj();
sq_pushobject(vm,obj); sq_pushobject(vm,obj);
} }
}; };