diff --git a/include/sqrat/sqratUtil.h b/include/sqrat/sqratUtil.h index d7a7c0cb..ec12e57c 100644 --- a/include/sqrat/sqratUtil.h +++ b/include/sqrat/sqratUtil.h @@ -1888,6 +1888,16 @@ struct StackStrF CacheHash(); return GetHash(); } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Provide a dummy non constant instance when calling functions that can work with placeholders. + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + static StackStrF & Dummy() + { + static StackStrF o; + o.Release(); + return o; + } }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -2122,7 +2132,7 @@ template struct is_reference ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// Fast integer to string implementation to avoid using itoa. See https://github.com/jeaiii/itoa +/// Fast integer to string implementation to avoid using itoa. See https://github.com/jeaiii/itoa ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/modules/mysql/Connection.cpp b/modules/mysql/Connection.cpp index c855839d..1e7abb3e 100644 --- a/modules/mysql/Connection.cpp +++ b/modules/mysql/Connection.cpp @@ -350,7 +350,7 @@ SQInteger Connection::QueryF(HSQUIRRELVM vm) } // ------------------------------------------------------------------------------------------------ -LightObj Connection::EscapeString(const StackStrF & str) +LightObj Connection::EscapeString(StackStrF & str) { // Is there even a string to escape? if (str.mLen <= 0) diff --git a/modules/mysql/Connection.hpp b/modules/mysql/Connection.hpp index bd341a41..e573e7f9 100644 --- a/modules/mysql/Connection.hpp +++ b/modules/mysql/Connection.hpp @@ -414,7 +414,7 @@ public: /* -------------------------------------------------------------------------------------------- * Escape unwanted characters from a given string. */ - LightObj EscapeString(const StackStrF & str); + LightObj EscapeString(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Attempt to execute the specified query. diff --git a/modules/sqlite/Common.cpp b/modules/sqlite/Common.cpp index a3d6570b..e4d3b4a2 100644 --- a/modules/sqlite/Common.cpp +++ b/modules/sqlite/Common.cpp @@ -101,7 +101,7 @@ Object GetMemoryHighwaterMark(bool reset) } // ------------------------------------------------------------------------------------------------ -CSStr EscapeString(const StackStrF & str) +CSStr EscapeString(StackStrF & str) { // Is there even a string to escape? if (str.mLen <= 0) @@ -115,7 +115,7 @@ CSStr EscapeString(const StackStrF & str) } // ------------------------------------------------------------------------------------------------ -CCStr EscapeStringEx(SQChar spec, const StackStrF & str) +CCStr EscapeStringEx(SQChar spec, StackStrF & str) { // Utility that allows changing the format specifier temporarily static SQChar fs[] = _SC("%q"); diff --git a/modules/sqlite/Common.hpp b/modules/sqlite/Common.hpp index 92c19783..d2aa9590 100644 --- a/modules/sqlite/Common.hpp +++ b/modules/sqlite/Common.hpp @@ -126,12 +126,12 @@ Object GetMemoryHighwaterMark(bool reset); /* ------------------------------------------------------------------------------------------------ * Retrieve the escaped version of the specified string. */ -CSStr EscapeString(const StackStrF & str); +CSStr EscapeString(StackStrF & str); /* ------------------------------------------------------------------------------------------------ * Retrieve the escaped version of the specified string using the supplied format specifier. */ -CCStr EscapeStringEx(SQChar spec, const StackStrF & str); +CCStr EscapeStringEx(SQChar spec, StackStrF & str); /* ------------------------------------------------------------------------------------------------ * Convert the values from the specified array to a list of column names string. diff --git a/modules/sqlite/Connection.cpp b/modules/sqlite/Connection.cpp index 5aaacb56..c82320fa 100644 --- a/modules/sqlite/Connection.cpp +++ b/modules/sqlite/Connection.cpp @@ -97,7 +97,7 @@ const ConnRef & Connection::GetCreated() const #endif // _DEBUG // ------------------------------------------------------------------------------------------------ -void Connection::Open(const StackStrF & name) +void Connection::Open(StackStrF & name) { // Should we create a connection handle? if (!m_Handle) @@ -114,7 +114,7 @@ void Connection::Open(const StackStrF & name) } // ------------------------------------------------------------------------------------------------ -void Connection::Open(const StackStrF & name, Int32 flags) +void Connection::Open(StackStrF & name, Int32 flags) { // Should we create a connection handle? if (!m_Handle) @@ -131,7 +131,7 @@ void Connection::Open(const StackStrF & name, Int32 flags) } // ------------------------------------------------------------------------------------------------ -void Connection::Open(const StackStrF & name, Int32 flags, const StackStrF & vfs) +void Connection::Open(StackStrF & name, Int32 flags, StackStrF & vfs) { // Should we create a connection handle? if (!m_Handle) @@ -148,7 +148,7 @@ void Connection::Open(const StackStrF & name, Int32 flags, const StackStrF & vfs } // ------------------------------------------------------------------------------------------------ -Int32 Connection::Exec(const StackStrF & str) +Int32 Connection::Exec(StackStrF & str) { SQMOD_VALIDATE_CREATED(*this); // Attempt to execute the specified query @@ -163,7 +163,7 @@ Int32 Connection::Exec(const StackStrF & str) } // ------------------------------------------------------------------------------------------------ -Object Connection::Query(const StackStrF & str) const +Object Connection::Query(StackStrF & str) const { SQMOD_VALIDATE_CREATED(*this); // Return the requested information @@ -171,7 +171,7 @@ Object Connection::Query(const StackStrF & str) const } // ------------------------------------------------------------------------------------------------ -void Connection::Queue(const StackStrF & str) +void Connection::Queue(StackStrF & str) { SQMOD_VALIDATE(*this); // Is there a query to commit? @@ -198,10 +198,11 @@ bool Connection::IsReadOnly() const } // ------------------------------------------------------------------------------------------------ -bool Connection::TableExists(const StackStrF & name) const +bool Connection::TableExists(StackStrF & name) const { + StackStrF query("SELECT count(*) FROM [sqlite_master] WHERE [type]='table' AND [name]=?"); // Prepare a statement to inspect the master table - Statement stmt(SQMOD_GET_CREATED(*this), "SELECT count(*) FROM [sqlite_master] WHERE [type]='table' AND [name]=?"); + Statement stmt(SQMOD_GET_CREATED(*this), query); // Could the statement be created? if (stmt.IsValid()) { @@ -346,9 +347,9 @@ void Register_Connection(Table & sqlns) Class< Connection >(sqlns.GetVM(), Typename::Str) // Constructors .Ctor() - .Ctor< const StackStrF & >() - .Ctor< const StackStrF &, Int32 >() - .Ctor< const StackStrF &, Int32, const StackStrF & >() + .Ctor< StackStrF & >() + .Ctor< StackStrF &, Int32 >() + .Ctor< StackStrF &, Int32, StackStrF & >() // Meta-methods .SquirrelFunc(_SC("_typename"), &Typename::Fn) .Func(_SC("_tostring"), &Connection::ToString) @@ -387,9 +388,9 @@ void Register_Connection(Table & sqlns) .Func(_SC("ClearQueue"), &Connection::ClearQueue) .Func(_SC("PopQueue"), &Connection::PopQueue) // Member Overloads - .Overload< void (Connection::*)(const StackStrF &) >(_SC("Open"), &Connection::Open) - .Overload< void (Connection::*)(const StackStrF &, Int32) >(_SC("Open"), &Connection::Open) - .Overload< void (Connection::*)(const StackStrF &, Int32, const StackStrF &) >(_SC("Open"), &Connection::Open) + .Overload< void (Connection::*)(StackStrF &) >(_SC("Open"), &Connection::Open) + .Overload< void (Connection::*)(StackStrF &, Int32) >(_SC("Open"), &Connection::Open) + .Overload< void (Connection::*)(StackStrF &, Int32, StackStrF &) >(_SC("Open"), &Connection::Open) .Overload< Int32 (Connection::*)(Int32) >(_SC("GetInfo"), &Connection::GetInfo) .Overload< Int32 (Connection::*)(Int32, bool) >(_SC("GetInfo"), &Connection::GetInfo) .Overload< Int32 (Connection::*)(Int32, bool, bool) >(_SC("GetInfo"), &Connection::GetInfo) diff --git a/modules/sqlite/Connection.hpp b/modules/sqlite/Connection.hpp index f105ebfa..c5f170c5 100644 --- a/modules/sqlite/Connection.hpp +++ b/modules/sqlite/Connection.hpp @@ -79,7 +79,7 @@ public: /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ - Connection(const StackStrF & name) + Connection(StackStrF & name) : m_Handle(new ConnHnd()) { SQMOD_GET_VALID(*this)->Create(name.mPtr, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr); @@ -88,7 +88,7 @@ public: /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ - Connection(const StackStrF & name, Int32 flags) + Connection(StackStrF & name, Int32 flags) : m_Handle(new ConnHnd()) { SQMOD_GET_VALID(*this)->Create(name.mPtr, flags, nullptr); @@ -97,7 +97,7 @@ public: /* -------------------------------------------------------------------------------------------- * Explicit constructor. */ - Connection(const StackStrF & name, Int32 flags, const StackStrF & vfs) + Connection(StackStrF & name, Int32 flags, StackStrF & vfs) : m_Handle(new ConnHnd()) { SQMOD_GET_VALID(*this)->Create(name.mPtr, flags, vfs.mPtr); @@ -279,32 +279,32 @@ public: /* -------------------------------------------------------------------------------------------- * Attempt to open the specified database. */ - void Open(const StackStrF & name); + void Open(StackStrF & name); /* -------------------------------------------------------------------------------------------- * Attempt to open the specified database. */ - void Open(const StackStrF & name, Int32 flags); + void Open(StackStrF & name, Int32 flags); /* -------------------------------------------------------------------------------------------- * Attempt to open the specified database. */ - void Open(const StackStrF & name, Int32 flags, const StackStrF & vfs); + void Open(StackStrF & name, Int32 flags, StackStrF & vfs); /* -------------------------------------------------------------------------------------------- * Attempt to execute the specified query. */ - Int32 Exec(const StackStrF & str); + Int32 Exec(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Attempt to queue the specified query. */ - void Queue(const StackStrF & str); + void Queue(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Attempt to create a statement from the specified query. */ - Object Query(const StackStrF & str) const; + Object Query(StackStrF & str) const; /* -------------------------------------------------------------------------------------------- * See if the database connection was opened in read-only mode. @@ -314,7 +314,7 @@ public: /* -------------------------------------------------------------------------------------------- * Shortcut to test if a table exists. */ - bool TableExists(const StackStrF & name) const; + bool TableExists(StackStrF & name) const; /* -------------------------------------------------------------------------------------------- * See if the database connection is or is not in auto-commit mode. diff --git a/modules/sqlite/Parameter.cpp b/modules/sqlite/Parameter.cpp index 5bd5d6dc..3312c5e2 100644 --- a/modules/sqlite/Parameter.cpp +++ b/modules/sqlite/Parameter.cpp @@ -459,7 +459,7 @@ void Parameter::SetFloat64(SQFloat value) } // ------------------------------------------------------------------------------------------------ -void Parameter::SetString(const StackStrF & value) +void Parameter::SetString(StackStrF & value) { SQMOD_VALIDATE_CREATED(*this); // Attempt to bind the specified value diff --git a/modules/sqlite/Parameter.hpp b/modules/sqlite/Parameter.hpp index 2ef6276f..bc511782 100644 --- a/modules/sqlite/Parameter.hpp +++ b/modules/sqlite/Parameter.hpp @@ -341,7 +341,7 @@ public: /* -------------------------------------------------------------------------------------------- * Attempt to bind a string value at the referenced parameter index. */ - void SetString(const StackStrF & value); + void SetString(StackStrF & value); /* -------------------------------------------------------------------------------------------- * Attempt to bind a string value at the referenced parameter index. diff --git a/modules/sqlite/Statement.cpp b/modules/sqlite/Statement.cpp index c621d3f0..a5bff305 100644 --- a/modules/sqlite/Statement.cpp +++ b/modules/sqlite/Statement.cpp @@ -160,7 +160,7 @@ void Statement::ValidateRow() const #endif // _DEBUG // ------------------------------------------------------------------------------------------------ -Statement::Statement(const Connection & connection, const StackStrF & query) +Statement::Statement(const Connection & connection, StackStrF & query) : m_Handle(new StmtHnd(connection.GetHandle())) { SQMOD_GET_VALID(*this)->Create(query.mPtr, query.mLen); @@ -425,7 +425,7 @@ void Register_Statement(Table & sqlns) // Constructors .Ctor() .Ctor< const Statement & >() - .Ctor< const Connection &, const StackStrF & >() + .Ctor< const Connection &, StackStrF & >() // Meta-methods .SquirrelFunc(_SC("_typename"), &Typename::Fn) .Func(_SC("_tostring"), &Statement::ToString) diff --git a/modules/sqlite/Statement.hpp b/modules/sqlite/Statement.hpp index 031d09f9..ed33b136 100644 --- a/modules/sqlite/Statement.hpp +++ b/modules/sqlite/Statement.hpp @@ -98,7 +98,7 @@ public: /* -------------------------------------------------------------------------------------------- * Construct a statement under the specified connection using the specified string. */ - Statement(const ConnRef & connection, const StackStrF & query) + Statement(const ConnRef & connection, StackStrF & query) : m_Handle(new StmtHnd(connection)) { SQMOD_GET_VALID(*this)->Create(query.mPtr, query.mLen); @@ -107,7 +107,7 @@ public: /* -------------------------------------------------------------------------------------------- * Construct a statement under the specified connection using the specified string. */ - Statement(const Connection & connection, const StackStrF & query); + Statement(const Connection & connection, StackStrF & query); /* -------------------------------------------------------------------------------------------- * Direct handle constructor. @@ -314,7 +314,7 @@ public: /* -------------------------------------------------------------------------------------------- * Retrieve the parameter index associated with the specified name. */ - Int32 GetParameterIndex(const StackStrF & name) const + Int32 GetParameterIndex(StackStrF & name) const { return sqlite3_bind_parameter_index(SQMOD_GET_VALID(*this)->mPtr, name.mPtr); } @@ -367,7 +367,7 @@ public: /* -------------------------------------------------------------------------------------------- * Retrieve the column index associated with the specified name. */ - Int32 GetColumnIndex(const StackStrF & name) const + Int32 GetColumnIndex(StackStrF & name) const { return SQMOD_GET_VALID(*this)->GetColumnIndex(name.mPtr, name.mLen); } @@ -594,7 +594,7 @@ public: /* -------------------------------------------------------------------------------------------- * Attempt to bind a string value at the specified parameter index. */ - Statement & SetString(const Object & param, const StackStrF & value) + Statement & SetString(const Object & param, StackStrF & value) { Parameter(SQMOD_GET_CREATED(*this), param).SetString(value); // Allow chaining of operations diff --git a/source/Base/AABB.cpp b/source/Base/AABB.cpp index 5d90f2c2..26a64729 100644 --- a/source/Base/AABB.cpp +++ b/source/Base/AABB.cpp @@ -307,7 +307,7 @@ CSStr AABB::ToString() const } // ------------------------------------------------------------------------------------------------ -void AABB::SetStr(SQChar delim, const StackStrF & values) +void AABB::SetStr(SQChar delim, StackStrF & values) { DefineAABB(AABB::GetEx(delim, values)); } @@ -734,13 +734,13 @@ Int32 AABB::IsSphereInsideFastEx(Value x, Value y, Value z, Value r) const } // ------------------------------------------------------------------------------------------------ -const AABB & AABB::Get(const StackStrF & str) +const AABB & AABB::Get(StackStrF & str) { return AABB::GetEx(AABB::Delim, str); } // ------------------------------------------------------------------------------------------------ -const AABB & AABB::GetEx(SQChar delim, const StackStrF & str) +const AABB & AABB::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f , %f , %f , %f , %f "); diff --git a/source/Base/AABB.hpp b/source/Base/AABB.hpp index b855f315..786ddde9 100644 --- a/source/Base/AABB.hpp +++ b/source/Base/AABB.hpp @@ -300,7 +300,7 @@ struct AABB /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Clear the component values to default. @@ -470,12 +470,12 @@ struct AABB /* -------------------------------------------------------------------------------------------- * Extract the values for components of the AABB type from a string. */ - static const AABB & Get(const StackStrF & str); + static const AABB & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the AABB type from a string. */ - static const AABB & GetEx(SQChar delim, const StackStrF & str); + static const AABB & GetEx(SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Circle.cpp b/source/Base/Circle.cpp index 58ab1344..ddac280c 100644 --- a/source/Base/Circle.cpp +++ b/source/Base/Circle.cpp @@ -409,7 +409,7 @@ void Circle::SetPositionEx(Value nx, Value ny) } // ------------------------------------------------------------------------------------------------ -void Circle::SetStr(SQChar delim, const StackStrF & values) +void Circle::SetStr(SQChar delim, StackStrF & values) { SetCircle(Circle::GetEx(delim, values)); } @@ -468,13 +468,13 @@ Circle Circle::Abs() const } // ------------------------------------------------------------------------------------------------ -const Circle & Circle::Get(const StackStrF & str) +const Circle & Circle::Get(StackStrF & str) { return Circle::GetEx(Circle::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Circle & Circle::GetEx(SQChar delim, const StackStrF & str) +const Circle & Circle::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f , %f "); diff --git a/source/Base/Circle.hpp b/source/Base/Circle.hpp index 9a611c2e..ce9c5d0f 100644 --- a/source/Base/Circle.hpp +++ b/source/Base/Circle.hpp @@ -376,7 +376,7 @@ struct Circle /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate a randomly sized and positioned circle. @@ -415,12 +415,12 @@ struct Circle /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Circle type from a string. */ - static const Circle & Get(const StackStrF & str); + static const Circle & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Circle type from a string. */ - static const Circle & GetEx(SQChar delim, const StackStrF & str); + static const Circle & GetEx(SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Color3.cpp b/source/Base/Color3.cpp index 7022ddb5..ed9310c0 100644 --- a/source/Base/Color3.cpp +++ b/source/Base/Color3.cpp @@ -530,13 +530,13 @@ void Color3::SetColor4Ex(Value nr, Value ng, Value nb, Value /*na*/) } // ------------------------------------------------------------------------------------------------ -void Color3::SetStr(SQChar delim, const StackStrF & values) +void Color3::SetStr(SQChar delim, StackStrF & values) { SetColor3(Color3::GetEx(delim, values)); } // ------------------------------------------------------------------------------------------------ -void Color3::SetName(const StackStrF & name) +void Color3::SetName(StackStrF & name) { SetColor3(GetColor(name)); } @@ -632,13 +632,13 @@ void Color3::Inverse() } // ------------------------------------------------------------------------------------------------ -const Color3 & Color3::Get(const StackStrF & str) +const Color3 & Color3::Get(StackStrF & str) { return Color3::GetEx(Color3::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Color3 & Color3::GetEx(SQChar delim, const StackStrF & str) +const Color3 & Color3::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %u , %u , %u "); diff --git a/source/Base/Color3.hpp b/source/Base/Color3.hpp index f2fd44bb..c3b982e4 100644 --- a/source/Base/Color3.hpp +++ b/source/Base/Color3.hpp @@ -429,12 +429,12 @@ struct Color3 /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & str); + void SetStr(SQChar delim, StackStrF & str); /* -------------------------------------------------------------------------------------------- * Set the values from the identified color. */ - void SetName(const StackStrF & name); + void SetName(StackStrF & name); /* -------------------------------------------------------------------------------------------- * Get the component values packed inside an integer value. @@ -502,12 +502,12 @@ struct Color3 /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Color3 type from a string. */ - static const Color3 & Get(const StackStrF & str); + static const Color3 & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Color3 type from a string. */ - static const Color3 & GetEx( SQChar delim, const StackStrF & str); + static const Color3 & GetEx( SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Color4.cpp b/source/Base/Color4.cpp index b46570d7..895f39bf 100644 --- a/source/Base/Color4.cpp +++ b/source/Base/Color4.cpp @@ -559,13 +559,13 @@ void Color4::SetColor4Ex(Value nr, Value ng, Value nb, Value na) } // ------------------------------------------------------------------------------------------------ -void Color4::SetStr(SQChar delim, const StackStrF & values) +void Color4::SetStr(SQChar delim, StackStrF & values) { SetColor4(Color4::GetEx(delim, values)); } // ------------------------------------------------------------------------------------------------ -void Color4::SetName(const StackStrF & name) +void Color4::SetName(StackStrF & name) { SetColor3(GetColor(name)); } @@ -667,13 +667,13 @@ void Color4::Inverse() } // ------------------------------------------------------------------------------------------------ -const Color4 & Color4::Get(const StackStrF & str) +const Color4 & Color4::Get(StackStrF & str) { return Color4::GetEx(Color4::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Color4 & Color4::GetEx(SQChar delim, const StackStrF & str) +const Color4 & Color4::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %u , %u , %u , %u "); diff --git a/source/Base/Color4.hpp b/source/Base/Color4.hpp index 4543ceba..3d54ad91 100644 --- a/source/Base/Color4.hpp +++ b/source/Base/Color4.hpp @@ -429,12 +429,12 @@ struct Color4 /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & name); + void SetStr(SQChar delim, StackStrF & name); /* -------------------------------------------------------------------------------------------- * Set the values from the identified color. */ - void SetName(const StackStrF & name); + void SetName(StackStrF & name); /* -------------------------------------------------------------------------------------------- * Get the component values packed inside an integer value. @@ -502,12 +502,12 @@ struct Color4 /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Color4 type from a string. */ - static const Color4 & Get(const StackStrF & str); + static const Color4 & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Color4 type from a string. */ - static const Color4 & GetEx(SQChar delim, const StackStrF & str); + static const Color4 & GetEx(SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Quaternion.cpp b/source/Base/Quaternion.cpp index 01b2e779..aba49409 100644 --- a/source/Base/Quaternion.cpp +++ b/source/Base/Quaternion.cpp @@ -431,7 +431,7 @@ void Quaternion::SetVector4(const Vector4 & v) } // ------------------------------------------------------------------------------------------------ -void Quaternion::SetStr(SQChar delim, const StackStrF & values) +void Quaternion::SetStr(SQChar delim, StackStrF & values) { SetQuaternion(Quaternion::GetEx(delim, values)); } @@ -714,13 +714,13 @@ Quaternion Quaternion::NlerpEx(const Quaternion & quat, Value t, bool shortest_p } // ------------------------------------------------------------------------------------------------ -const Quaternion & Quaternion::Get(const StackStrF & str) +const Quaternion & Quaternion::Get(StackStrF & str) { return Quaternion::GetEx(Quaternion::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Quaternion & Quaternion::GetEx(SQChar delim, const StackStrF & str) +const Quaternion & Quaternion::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f , %f , %f "); diff --git a/source/Base/Quaternion.hpp b/source/Base/Quaternion.hpp index bc14a828..437a6ddc 100644 --- a/source/Base/Quaternion.hpp +++ b/source/Base/Quaternion.hpp @@ -330,7 +330,7 @@ struct Quaternion /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate random values for all components of this instance. @@ -443,12 +443,12 @@ struct Quaternion /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Quaternion type from a string. */ - static const Quaternion & Get(const StackStrF & str); + static const Quaternion & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Quaternion type from a string. */ - static const Quaternion & GetEx(SQChar delim, const StackStrF & str); + static const Quaternion & GetEx(SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Shared.cpp b/source/Base/Shared.cpp index f37fdab1..435c43d4 100644 --- a/source/Base/Shared.cpp +++ b/source/Base/Shared.cpp @@ -324,7 +324,7 @@ const Color3 & GetRandomColor() } // ------------------------------------------------------------------------------------------------ -Color3 GetColor(const StackStrF & name) +Color3 GetColor(StackStrF & name) { return name.mLen <= 0 ? Color3() : GetColorStr(name.mPtr); } diff --git a/source/Base/Shared.hpp b/source/Base/Shared.hpp index b2b6e246..b07e2b09 100644 --- a/source/Base/Shared.hpp +++ b/source/Base/Shared.hpp @@ -231,7 +231,7 @@ Color3 GetColorStr(CSStr name); /* ------------------------------------------------------------------------------------------------ * Attempt to identify the color in the specified name and return it. */ -Color3 GetColor(const StackStrF & name); +Color3 GetColor(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Throw the last system error as an exception. diff --git a/source/Base/Sphere.cpp b/source/Base/Sphere.cpp index 3035feea..330b1464 100644 --- a/source/Base/Sphere.cpp +++ b/source/Base/Sphere.cpp @@ -409,7 +409,7 @@ void Sphere::SetPositionEx(Value nx, Value ny, Value nz) } // ------------------------------------------------------------------------------------------------ -void Sphere::SetStr(SQChar delim, const StackStrF & values) +void Sphere::SetStr(SQChar delim, StackStrF & values) { SetSphere(Sphere::GetEx(delim, values)); } @@ -468,13 +468,13 @@ Sphere Sphere::Abs() const } // ------------------------------------------------------------------------------------------------ -const Sphere & Sphere::Get(const StackStrF & str) +const Sphere & Sphere::Get(StackStrF & str) { return Sphere::GetEx(Sphere::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Sphere & Sphere::GetEx(SQChar delim, const StackStrF & str) +const Sphere & Sphere::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f , %f , %f "); diff --git a/source/Base/Sphere.hpp b/source/Base/Sphere.hpp index c62b68da..cec3ae95 100644 --- a/source/Base/Sphere.hpp +++ b/source/Base/Sphere.hpp @@ -376,7 +376,7 @@ struct Sphere /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate a randomly sized and positioned sphere. @@ -414,12 +414,12 @@ struct Sphere /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Sphere type from a string. */ - static const Sphere & Get(const StackStrF & str); + static const Sphere & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Sphere type from a string. */ - static const Sphere & GetEx(SQChar delim, const StackStrF & str); + static const Sphere & GetEx(SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Vector2.cpp b/source/Base/Vector2.cpp index 05ab1d69..0f0c0854 100644 --- a/source/Base/Vector2.cpp +++ b/source/Base/Vector2.cpp @@ -333,7 +333,7 @@ void Vector2::SetVector2i(const Vector2i & v) } // ------------------------------------------------------------------------------------------------ -void Vector2::SetStr(SQChar delim, const StackStrF & values) +void Vector2::SetStr(SQChar delim, StackStrF & values) { SetVector2(Vector2::GetEx(delim, values)); } @@ -376,13 +376,13 @@ Vector2 Vector2::Abs() const } // ------------------------------------------------------------------------------------------------ -const Vector2 & Vector2::Get(const StackStrF & str) +const Vector2 & Vector2::Get(StackStrF & str) { return Vector2::GetEx(Vector2::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Vector2 & Vector2::GetEx(SQChar delim, const StackStrF & str) +const Vector2 & Vector2::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f "); diff --git a/source/Base/Vector2.hpp b/source/Base/Vector2.hpp index 3a546f1d..bcf1c049 100644 --- a/source/Base/Vector2.hpp +++ b/source/Base/Vector2.hpp @@ -314,7 +314,7 @@ struct Vector2 /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate random values for all components of this instance. @@ -347,12 +347,12 @@ struct Vector2 /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector2 type from a string. */ - static const Vector2 & Get(const StackStrF & str); + static const Vector2 & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector2 type from a string. */ - static const Vector2 & GetEx(SQChar delim, const StackStrF & str); + static const Vector2 & GetEx(SQChar delim, StackStrF & str); }; } // Namespace:: SqMod diff --git a/source/Base/Vector2i.cpp b/source/Base/Vector2i.cpp index f71f5229..2d5dfb67 100644 --- a/source/Base/Vector2i.cpp +++ b/source/Base/Vector2i.cpp @@ -479,7 +479,7 @@ void Vector2i::SetVector2(const Vector2 & v) } // ------------------------------------------------------------------------------------------------ -void Vector2i::SetStr(SQChar delim, const StackStrF & values) +void Vector2i::SetStr(SQChar delim, StackStrF & values) { SetVector2i(Vector2i::GetEx(delim, values)); } @@ -522,13 +522,13 @@ Vector2i Vector2i::Abs() const } // ------------------------------------------------------------------------------------------------ -const Vector2i & Vector2i::Get(const StackStrF & str) +const Vector2i & Vector2i::Get(StackStrF & str) { return Vector2i::GetEx(Vector2i::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Vector2i & Vector2i::GetEx(SQChar delim, const StackStrF & str) +const Vector2i & Vector2i::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %d , %d "); diff --git a/source/Base/Vector2i.hpp b/source/Base/Vector2i.hpp index fabed5a1..179832f1 100644 --- a/source/Base/Vector2i.hpp +++ b/source/Base/Vector2i.hpp @@ -414,7 +414,7 @@ struct Vector2i /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate random values for all components of this instance. @@ -447,12 +447,12 @@ struct Vector2i /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector2i type from a string. */ - static const Vector2i & Get(const StackStrF & str); + static const Vector2i & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector2i type from a string. */ - static const Vector2i & GetEx(SQChar delim, const StackStrF & str); + static const Vector2i & GetEx(SQChar delim, StackStrF & str); }; diff --git a/source/Base/Vector3.cpp b/source/Base/Vector3.cpp index c32af182..1cb06919 100644 --- a/source/Base/Vector3.cpp +++ b/source/Base/Vector3.cpp @@ -415,7 +415,7 @@ void Vector3::SetQuaternionEx(Value qx, Value qy, Value qz, Value qw) } // ------------------------------------------------------------------------------------------------ -void Vector3::SetStr(SQChar delim, const StackStrF & values) +void Vector3::SetStr(SQChar delim, StackStrF & values) { SetVector3(Vector3::GetEx(delim, values)); } @@ -629,13 +629,13 @@ void Vector3::CenterRotateYZBy(Value degrees, const Vector3 & center) } // ------------------------------------------------------------------------------------------------ -const Vector3 & Vector3::Get(const StackStrF & str) +const Vector3 & Vector3::Get(StackStrF & str) { return Vector3::GetEx(Vector3::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Vector3 & Vector3::GetEx(SQChar delim, const StackStrF & str) +const Vector3 & Vector3::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f , %f "); diff --git a/source/Base/Vector3.hpp b/source/Base/Vector3.hpp index 39c7f9a4..18a763b1 100644 --- a/source/Base/Vector3.hpp +++ b/source/Base/Vector3.hpp @@ -336,7 +336,7 @@ struct Vector3 /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate random values for all components of this instance. @@ -493,12 +493,12 @@ struct Vector3 /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector3 type from a string. */ - static const Vector3 & Get(const StackStrF & str); + static const Vector3 & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector3 type from a string. */ - static const Vector3 & GetEx(SQChar delim, const StackStrF & str); + static const Vector3 & GetEx(SQChar delim, StackStrF & str); }; diff --git a/source/Base/Vector4.cpp b/source/Base/Vector4.cpp index 8f692833..b2f59867 100644 --- a/source/Base/Vector4.cpp +++ b/source/Base/Vector4.cpp @@ -416,7 +416,7 @@ void Vector4::SetQuaternionEx(Value nx, Value ny, Value nz, Value nw) } // ------------------------------------------------------------------------------------------------ -void Vector4::SetStr(SQChar delim, const StackStrF & values) +void Vector4::SetStr(SQChar delim, StackStrF & values) { SetVector4(Vector4::GetEx(delim, values)); } @@ -465,13 +465,13 @@ Vector4 Vector4::Abs() const } // ------------------------------------------------------------------------------------------------ -const Vector4 & Vector4::Get(const StackStrF & str) +const Vector4 & Vector4::Get(StackStrF & str) { return Vector4::GetEx(Vector4::Delim, str); } // ------------------------------------------------------------------------------------------------ -const Vector4 & Vector4::GetEx(SQChar delim, const StackStrF & str) +const Vector4 & Vector4::GetEx(SQChar delim, StackStrF & str) { // The format specifications that will be used to scan the string static SQChar fs[] = _SC(" %f , %f , %f , %f "); diff --git a/source/Base/Vector4.hpp b/source/Base/Vector4.hpp index e3a714cf..dd2729da 100644 --- a/source/Base/Vector4.hpp +++ b/source/Base/Vector4.hpp @@ -334,7 +334,7 @@ struct Vector4 /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter. */ - void SetStr(SQChar delim, const StackStrF & values); + void SetStr(SQChar delim, StackStrF & values); /* -------------------------------------------------------------------------------------------- * Generate random values for all components of this instance. @@ -367,12 +367,12 @@ struct Vector4 /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector4 type from a string. */ - static const Vector4 & Get(const StackStrF & str); + static const Vector4 & Get(StackStrF & str); /* -------------------------------------------------------------------------------------------- * Extract the values for components of the Vector4 type from a string. */ - static const Vector4 & GetEx(SQChar delim, const StackStrF & str); + static const Vector4 & GetEx(SQChar delim, StackStrF & str); }; diff --git a/source/Core.cpp b/source/Core.cpp index eb5f63c2..a320d894 100644 --- a/source/Core.cpp +++ b/source/Core.cpp @@ -51,6 +51,8 @@ extern void TerminateTasks(); extern void TerminateRoutines(); extern void TerminateCommands(); extern void TerminateSignals(); +extern void MgInitialize(); +extern void MgTerminate(); // ------------------------------------------------------------------------------------------------ extern Buffer GetRealFilePath(CSStr path); @@ -372,6 +374,9 @@ bool Core::Initialize() InitializeRoutines(); InitializeTasks(); + // Initialize the Mongoose library + //MgInitialize(); + // Initialization successful return true; } @@ -534,6 +539,8 @@ void Core::Terminate(bool shutdown) // Tell modules to do their monkey business _Func->SendPluginCommand(SQMOD_RELEASED_CMD, ""); } + // Terminate the Mongoose manager + //MgTerminate(); OutputMessage("Squirrel plug-in was successfully terminated"); } diff --git a/source/Entity/Blip.cpp b/source/Entity/Blip.cpp index c63b6371..97324777 100644 --- a/source/Entity/Blip.cpp +++ b/source/Entity/Blip.cpp @@ -52,7 +52,7 @@ const String & CBlip::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CBlip::SetTag(const StackStrF & tag) +void CBlip::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -65,7 +65,7 @@ void CBlip::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CBlip & CBlip::ApplyTag(const StackStrF & tag) +CBlip & CBlip::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Blip.hpp b/source/Entity/Blip.hpp index 8e2e315d..6270b863 100644 --- a/source/Entity/Blip.hpp +++ b/source/Entity/Blip.hpp @@ -119,12 +119,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CBlip & ApplyTag(const StackStrF & tag); + CBlip & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Checkpoint.cpp b/source/Entity/Checkpoint.cpp index 613af6d9..aecac5bc 100644 --- a/source/Entity/Checkpoint.cpp +++ b/source/Entity/Checkpoint.cpp @@ -55,7 +55,7 @@ const String & CCheckpoint::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CCheckpoint::SetTag(const StackStrF & tag) +void CCheckpoint::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -68,7 +68,7 @@ void CCheckpoint::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CCheckpoint & CCheckpoint::ApplyTag(const StackStrF & tag) +CCheckpoint & CCheckpoint::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Checkpoint.hpp b/source/Entity/Checkpoint.hpp index a81ff774..be4368ae 100644 --- a/source/Entity/Checkpoint.hpp +++ b/source/Entity/Checkpoint.hpp @@ -133,12 +133,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CCheckpoint & ApplyTag(const StackStrF & tag); + CCheckpoint & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Keybind.cpp b/source/Entity/Keybind.cpp index 1f66bff9..135c7b00 100644 --- a/source/Entity/Keybind.cpp +++ b/source/Entity/Keybind.cpp @@ -52,7 +52,7 @@ const String & CKeybind::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CKeybind::SetTag(const StackStrF & tag) +void CKeybind::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -65,7 +65,7 @@ void CKeybind::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CKeybind & CKeybind::ApplyTag(const StackStrF & tag) +CKeybind & CKeybind::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Keybind.hpp b/source/Entity/Keybind.hpp index 799de2eb..4b20365c 100644 --- a/source/Entity/Keybind.hpp +++ b/source/Entity/Keybind.hpp @@ -119,12 +119,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CKeybind & ApplyTag(const StackStrF & tag); + CKeybind & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Object.cpp b/source/Entity/Object.cpp index ad186c10..bf1ed884 100644 --- a/source/Entity/Object.cpp +++ b/source/Entity/Object.cpp @@ -61,7 +61,7 @@ const String & CObject::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CObject::SetTag(const StackStrF & tag) +void CObject::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -74,7 +74,7 @@ void CObject::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CObject & CObject::ApplyTag(const StackStrF & tag) +CObject & CObject::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Object.hpp b/source/Entity/Object.hpp index 0e91487d..c8d99cb6 100644 --- a/source/Entity/Object.hpp +++ b/source/Entity/Object.hpp @@ -152,12 +152,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CObject & ApplyTag(const StackStrF & tag); + CObject & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Pickup.cpp b/source/Entity/Pickup.cpp index 9b8b7ddb..2fe766e7 100644 --- a/source/Entity/Pickup.cpp +++ b/source/Entity/Pickup.cpp @@ -54,7 +54,7 @@ const String & CPickup::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CPickup::SetTag(const StackStrF & tag) +void CPickup::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -67,7 +67,7 @@ void CPickup::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CPickup & CPickup::ApplyTag(const StackStrF & tag) +CPickup & CPickup::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Pickup.hpp b/source/Entity/Pickup.hpp index 2cb5e379..261cf9d0 100644 --- a/source/Entity/Pickup.hpp +++ b/source/Entity/Pickup.hpp @@ -136,12 +136,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CPickup & ApplyTag(const StackStrF & tag); + CPickup & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Player.cpp b/source/Entity/Player.cpp index 12d55ee6..682f2493 100644 --- a/source/Entity/Player.cpp +++ b/source/Entity/Player.cpp @@ -84,7 +84,7 @@ const String & CPlayer::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CPlayer::SetTag(const StackStrF & tag) +void CPlayer::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -97,7 +97,7 @@ void CPlayer::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CPlayer & CPlayer::ApplyTag(const StackStrF & tag) +CPlayer & CPlayer::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; @@ -314,7 +314,7 @@ CSStr CPlayer::GetName() const } // ------------------------------------------------------------------------------------------------ -void CPlayer::SetName(const StackStrF & name) const +void CPlayer::SetName(StackStrF & name) const { // Validate the managed identifier Validate(); @@ -1378,8 +1378,8 @@ void CPlayer::Unspectate() const } // ------------------------------------------------------------------------------------------------ -void CPlayer::Redirect(const StackStrF & ip, Uint32 port, const StackStrF & nick, - const StackStrF & server_pass, const StackStrF & user_pass) +void CPlayer::Redirect(StackStrF & ip, Uint32 port, StackStrF & nick, + StackStrF & server_pass, StackStrF & user_pass) { // Validate the managed identifier Validate(); @@ -1565,7 +1565,7 @@ const String & CPlayer::GetMessagePrefix(Uint32 index) const } // ------------------------------------------------------------------------------------------------ -void CPlayer::SetMessagePrefix(Uint32 index, const StackStrF & prefix) +void CPlayer::SetMessagePrefix(Uint32 index, StackStrF & prefix) { // Perform a range check on the specified prefix index if (index >= SQMOD_PLAYER_MSG_PREFIXES) @@ -1742,7 +1742,7 @@ void CPlayer::StreamFloat(SQFloat val) } // ------------------------------------------------------------------------------------------------ -void CPlayer::StreamString(const StackStrF & val) +void CPlayer::StreamString(StackStrF & val) { // Validate the managed identifier Validate(); @@ -1756,7 +1756,7 @@ void CPlayer::StreamString(const StackStrF & val) } // ------------------------------------------------------------------------------------------------ -void CPlayer::StreamRawString(const StackStrF & val) +void CPlayer::StreamRawString(StackStrF & val) { // Validate the managed identifier Validate(); diff --git a/source/Entity/Player.hpp b/source/Entity/Player.hpp index d5129dc0..2779a605 100644 --- a/source/Entity/Player.hpp +++ b/source/Entity/Player.hpp @@ -203,12 +203,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CPlayer & ApplyTag(const StackStrF & tag); + CPlayer & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. @@ -298,7 +298,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the nick name of the managed player entity. */ - void SetName(const StackStrF & name) const; + void SetName(StackStrF & name) const; /* -------------------------------------------------------------------------------------------- * Retrieve the current state of the managed player entity. @@ -743,8 +743,8 @@ public: /* -------------------------------------------------------------------------------------------- * Redirect the managed player entity to the specified server. */ - void Redirect(const StackStrF & ip, Uint32 port, const StackStrF & nick, - const StackStrF & server_pass, const StackStrF & user_pass); + void Redirect(StackStrF & ip, Uint32 port, StackStrF & nick, + StackStrF & server_pass, StackStrF & user_pass); /* -------------------------------------------------------------------------------------------- * Request a list of the modules loaded into the client session. @@ -814,7 +814,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the message prefix at the specified index for the managed player entity. */ - void SetMessagePrefix(Uint32 index, const StackStrF & prefix); + void SetMessagePrefix(Uint32 index, StackStrF & prefix); /* -------------------------------------------------------------------------------------------- * Retrieve the amount of tracked position changes for the managed player entity. @@ -909,12 +909,12 @@ public: /* -------------------------------------------------------------------------------------------- * Write a string to the stream buffer. */ - void StreamString(const StackStrF & val); + void StreamString(StackStrF & val); /* -------------------------------------------------------------------------------------------- * Write a raw string to the stream buffer. */ - void StreamRawString(const StackStrF & val); + void StreamRawString(StackStrF & val); /* -------------------------------------------------------------------------------------------- * Send the data in the stream buffer to the client. diff --git a/source/Entity/Vehicle.cpp b/source/Entity/Vehicle.cpp index 69e26cff..56ccfbf3 100644 --- a/source/Entity/Vehicle.cpp +++ b/source/Entity/Vehicle.cpp @@ -57,7 +57,7 @@ const String & CVehicle::GetTag() const } // ------------------------------------------------------------------------------------------------ -void CVehicle::SetTag(const StackStrF & tag) +void CVehicle::SetTag(StackStrF & tag) { if (tag.mLen > 0) { @@ -70,7 +70,7 @@ void CVehicle::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CVehicle & CVehicle::ApplyTag(const StackStrF & tag) +CVehicle & CVehicle::ApplyTag(StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Vehicle.hpp b/source/Entity/Vehicle.hpp index e3fdbbf5..01487f18 100644 --- a/source/Entity/Vehicle.hpp +++ b/source/Entity/Vehicle.hpp @@ -139,12 +139,12 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag); + void SetTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CVehicle & ApplyTag(const StackStrF & tag); + CVehicle & ApplyTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Library/String.cpp b/source/Library/String.cpp index 1f8649ce..616aeecc 100644 --- a/source/Library/String.cpp +++ b/source/Library/String.cpp @@ -16,7 +16,7 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ -static LightObj SqLeftStr(SQChar f, Uint32 w, const StackStrF & s) +static LightObj SqLeftStr(SQChar f, Uint32 w, StackStrF & s) { // Is the specified width valid? if (!w) @@ -46,7 +46,7 @@ static LightObj SqLeftStr(SQChar f, Uint32 w, const StackStrF & s) } // ------------------------------------------------------------------------------------------------ -static LightObj SqLeftOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF & s) +static LightObj SqLeftOffsetStr(SQChar f, Uint32 w, Uint32 o, StackStrF & s) { // Is the specified width valid? if (!w) @@ -90,7 +90,7 @@ static LightObj SqLeftOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF & } // ------------------------------------------------------------------------------------------------ -static LightObj SqRightStr(SQChar f, Uint32 w, const StackStrF & s) +static LightObj SqRightStr(SQChar f, Uint32 w, StackStrF & s) { // Is the specified width valid? if (!w) @@ -129,7 +129,7 @@ static LightObj SqRightStr(SQChar f, Uint32 w, const StackStrF & s) } // ------------------------------------------------------------------------------------------------ -static LightObj SqRightOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF & s) +static LightObj SqRightOffsetStr(SQChar f, Uint32 w, Uint32 o, StackStrF & s) { // Is the specified width valid? if (!w) @@ -173,7 +173,7 @@ static LightObj SqRightOffsetStr(SQChar f, Uint32 w, Uint32 o, const StackStrF & } // ------------------------------------------------------------------------------------------------ -static LightObj SqCenterStr(SQChar f, Uint32 w, const StackStrF & s) +static LightObj SqCenterStr(SQChar f, Uint32 w, StackStrF & s) { // Is the specified width valid? if (!w) @@ -261,7 +261,7 @@ CSStr StrJustAlphaNum(CSStr str) } // ------------------------------------------------------------------------------------------------ -static LightObj SqJustAlphaNum(const StackStrF & s) +static LightObj SqJustAlphaNum(StackStrF & s) { const Buffer b(StrJustAlphaNumImpl(s.mPtr, s.mLen)); // Obtain the initial stack size @@ -323,7 +323,7 @@ CSStr StrToLowercase(CSStr str) } // ------------------------------------------------------------------------------------------------ -static LightObj SqToLowercase(const StackStrF & s) +static LightObj SqToLowercase(StackStrF & s) { const Buffer b(StrToLowercaseImpl(s.mPtr, s.mLen)); // Obtain the initial stack size @@ -385,7 +385,7 @@ CSStr StrToUppercase(CSStr str) } // ------------------------------------------------------------------------------------------------ -static LightObj SqToUppercase(const StackStrF & s) +static LightObj SqToUppercase(StackStrF & s) { const Buffer b(StrToUppercaseImpl(s.mPtr, s.mLen)); // Obtain the initial stack size @@ -399,7 +399,7 @@ static LightObj SqToUppercase(const StackStrF & s) /* ------------------------------------------------------------------------------------------------ * Checks if all the characters in the specified string are of the specified class or not. */ -template < int (*Fn)(int) > static bool SqAllChars(const StackStrF & s) +template < int (*Fn)(int) > static bool SqAllChars(StackStrF & s) { // See if we actually have something to search for if (!s.mLen) @@ -424,7 +424,7 @@ template < int (*Fn)(int) > static bool SqAllChars(const StackStrF & s) /* ------------------------------------------------------------------------------------------------ * Find the position of the first character that matches the specified class. */ -template < int (*Fn)(int), bool Neg > static LightObj SqFirstChar(const StackStrF & s) +template < int (*Fn)(int), bool Neg > static LightObj SqFirstChar(StackStrF & s) { // See if we actually have something to search for if (s.mLen) @@ -452,7 +452,7 @@ template < int (*Fn)(int), bool Neg > static LightObj SqFirstChar(const StackStr /* ------------------------------------------------------------------------------------------------ * Find the position of the last character that matches the specified class. */ -template < int (*Fn)(int), bool Neg > static LightObj SqLastChar(const StackStrF & s) +template < int (*Fn)(int), bool Neg > static LightObj SqLastChar(StackStrF & s) { // See if we actually have something to search for if (s.mLen) diff --git a/source/Main.cpp b/source/Main.cpp index 2d67277d..bb2b1900 100644 --- a/source/Main.cpp +++ b/source/Main.cpp @@ -6,6 +6,11 @@ // ------------------------------------------------------------------------------------------------ #include +// ------------------------------------------------------------------------------------------------ +#ifdef SQMOD_OS_WINDOWS + #include +#endif // SQMOD_OS_WINDOWS + // ------------------------------------------------------------------------------------------------ namespace SqMod { diff --git a/source/Misc/Areas.cpp b/source/Misc/Areas.cpp index 34d1e221..f7f9f573 100644 --- a/source/Misc/Areas.cpp +++ b/source/Misc/Areas.cpp @@ -421,14 +421,14 @@ void Register_Areas(HSQUIRRELVM vm) Class< Area >(vm, AreaTypename::Str) // Constructors .Ctor() - .Ctor< const StackStrF & >() - .Ctor< SQInteger, const StackStrF & >() + .Ctor< StackStrF & >() + .Ctor< SQInteger, StackStrF & >() .Ctor< const Vector2 &, const Vector2 &, const Vector2 & >() - .Ctor< const Vector2 &, const Vector2 &, const Vector2 &, const StackStrF & >() - .Ctor< const Vector2 &, const Vector2 &, const Vector2 &, SQInteger, const StackStrF & >() + .Ctor< const Vector2 &, const Vector2 &, const Vector2 &, StackStrF & >() + .Ctor< const Vector2 &, const Vector2 &, const Vector2 &, SQInteger, StackStrF & >() .Ctor< float, float, float, float, float, float >() - .Ctor< float, float, float, float, float, float, const StackStrF & >() - .Ctor< float, float, float, float, float, float, SQInteger, const StackStrF & >() + .Ctor< float, float, float, float, float, float, StackStrF & >() + .Ctor< float, float, float, float, float, float, SQInteger, StackStrF & >() // Meta-methods .SquirrelFunc(_SC("_typename"), &AreaTypename::Fn) .Func(_SC("_tostring"), &Area::ToString) diff --git a/source/Misc/Areas.hpp b/source/Misc/Areas.hpp index f44d1133..2d87fd03 100644 --- a/source/Misc/Areas.hpp +++ b/source/Misc/Areas.hpp @@ -74,7 +74,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Named constructor. */ - Area(const StackStrF & name) + Area(StackStrF & name) : Area(16, name) { //... @@ -82,7 +82,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Default constructor. */ - Area(SQInteger sz, const StackStrF & name) + Area(SQInteger sz, StackStrF & name) : mL(DEF_L), mB(DEF_B), mR(DEF_R), mT(DEF_T), mPoints(), mID(0), mCells() , mName(name.mPtr, name.mLen <= 0 ? 0 : name.mLen) @@ -97,7 +97,7 @@ struct Area * Vector2 constructor. */ Area(const Vector2 & a, const Vector2 & b, const Vector2 & c) - : Area(a.x, a.y, b.x, b.y, c.x, c.y, 16, StackStrF()) + : Area(a.x, a.y, b.x, b.y, c.x, c.y, 16, StackStrF::Dummy()) { //... } @@ -105,7 +105,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Vector2 constructor with name. */ - Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, const StackStrF & name) + Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, StackStrF & name) : Area(a.x, a.y, b.x, b.y, c.x, c.y, 16, name) { //... @@ -114,7 +114,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Vector2 constructor with name and memory to reserve. */ - Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, SQInteger sz, const StackStrF & name) + Area(const Vector2 & a, const Vector2 & b, const Vector2 & c, SQInteger sz, StackStrF & name) : Area(a.x, a.y, b.x, b.y, c.x, c.y, sz, name) { //... @@ -124,7 +124,7 @@ struct Area * Extended constructor. */ Area(float ax, float ay, float bx, float by, float cx, float cy) - : Area(ax, ay, bx, by, cx, cy, 16, StackStrF()) + : Area(ax, ay, bx, by, cx, cy, 16, StackStrF::Dummy()) { //... } @@ -132,7 +132,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Extended constructor with name. */ - Area(float ax, float ay, float bx, float by, float cx, float cy, const StackStrF & name) + Area(float ax, float ay, float bx, float by, float cx, float cy, StackStrF & name) : Area(ax, ay, bx, by, cx, cy, 16, name) { //... @@ -141,7 +141,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Base constructor. */ - Area(float ax, float ay, float bx, float by, float cx, float cy, SQInteger sz, const StackStrF & name) + Area(float ax, float ay, float bx, float by, float cx, float cy, SQInteger sz, StackStrF & name) : mL(DEF_L), mB(DEF_B), mR(DEF_R), mT(DEF_T), mPoints(), mID(0), mCells() , mName(name.mPtr, name.mLen <= 0 ? 0 : name.mLen) { @@ -219,7 +219,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Modify the name of this area. */ - void SetName(const StackStrF & name) + void SetName(StackStrF & name) { if (name.mLen <= 0) { @@ -235,7 +235,7 @@ struct Area /* -------------------------------------------------------------------------------------------- * Modify the name of this area. (allows chaining function calls) */ - Area & ApplyName(const StackStrF & name) + Area & ApplyName(StackStrF & name) { SetName(name); return *this; diff --git a/source/Misc/Functions.cpp b/source/Misc/Functions.cpp index 881a6aff..6f3ef82c 100644 --- a/source/Misc/Functions.cpp +++ b/source/Misc/Functions.cpp @@ -108,7 +108,7 @@ CSStr GetKeyCodeName(Uint8 keycode) } // ------------------------------------------------------------------------------------------------ -void SetKeyCodeName(Uint8 keycode, const StackStrF & name) +void SetKeyCodeName(Uint8 keycode, StackStrF & name) { CS_Keycode_Names[keycode].assign(name.mPtr); } @@ -162,13 +162,13 @@ Table GetPluginInfo(Int32 plugin_id) } // ------------------------------------------------------------------------------------------------ -Int32 FindPlugin(const StackStrF & name) +Int32 FindPlugin(StackStrF & name) { return _Func->FindPlugin(name.mPtr); } // ------------------------------------------------------------------------------------------------ -void SendPluginCommand(Uint32 identifier, const StackStrF & payload) +void SendPluginCommand(Uint32 identifier, StackStrF & payload) { _Func->SendPluginCommand(identifier, payload.mPtr); } @@ -180,7 +180,7 @@ const ULongInt & GetTime() } // ------------------------------------------------------------------------------------------------ -void SendLogMessage(const StackStrF & msg) +void SendLogMessage(StackStrF & msg) { if (_Func->LogMessage("%s", msg.mPtr) == vcmpErrorTooLargeInput) { @@ -276,7 +276,7 @@ CSStr GetServerName() } // ------------------------------------------------------------------------------------------------ -void SetServerName(const StackStrF & name) +void SetServerName(StackStrF & name) { _Func->SetServerName(name.mPtr); } @@ -303,7 +303,7 @@ CSStr GetServerPassword() } // ------------------------------------------------------------------------------------------------ -void SetServerPassword(const StackStrF & passwd) +void SetServerPassword(StackStrF & passwd) { _Func->SetServerPassword(passwd.mPtr); } @@ -330,13 +330,13 @@ CSStr GetGameModeText() } // ------------------------------------------------------------------------------------------------ -void SetGameModeText(const StackStrF & text) +void SetGameModeText(StackStrF & text) { _Func->SetGameModeText(text.mPtr); } // ------------------------------------------------------------------------------------------------ -void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url) +void CreateRadioStream(bool listed, StackStrF & name, StackStrF & url) { if (_Func->AddRadioStream(-1, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds) { @@ -345,7 +345,7 @@ void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & ur } // ------------------------------------------------------------------------------------------------ -void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url) +void CreateRadioStreamEx(Int32 id, bool listed, StackStrF & name, StackStrF & url) { if (_Func->AddRadioStream(id, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds) { @@ -774,25 +774,25 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z) } // ------------------------------------------------------------------------------------------------ -void BanIP(const StackStrF & addr) +void BanIP(StackStrF & addr) { _Func->BanIP(const_cast< SStr >(addr.mPtr)); } // ------------------------------------------------------------------------------------------------ -bool UnbanIP(const StackStrF & addr) +bool UnbanIP(StackStrF & addr) { return _Func->UnbanIP(const_cast< SStr >(addr.mPtr)); } // ------------------------------------------------------------------------------------------------ -bool IsIPBanned(const StackStrF & addr) +bool IsIPBanned(StackStrF & addr) { return _Func->IsIPBanned(const_cast< SStr >(addr.mPtr)); } // ------------------------------------------------------------------------------------------------ -Int32 GetPlayerIdFromName(const StackStrF & name) +Int32 GetPlayerIdFromName(StackStrF & name) { return _Func->GetPlayerIdFromName(name.mPtr); } diff --git a/source/Misc/Functions.hpp b/source/Misc/Functions.hpp index e48bda09..a9d16786 100644 --- a/source/Misc/Functions.hpp +++ b/source/Misc/Functions.hpp @@ -15,7 +15,7 @@ CSStr GetKeyCodeName(Uint8 keycode); /* ------------------------------------------------------------------------------------------------ * Modify the name of a certain key-code. */ -void SetKeyCodeName(Uint8 keycode, const StackStrF & name); +void SetKeyCodeName(Uint8 keycode, StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Retrieve the server version. @@ -40,12 +40,12 @@ Table GetPluginInfo(Int32 plugin_id); /* ------------------------------------------------------------------------------------------------ * Attempt to find a plug-in identifier by it's name. */ -Int32 FindPlugin(const StackStrF & name); +Int32 FindPlugin(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Send a custom command to the loaded plug-ins. */ -void SendPluginCommand(Uint32 identifier, const StackStrF & payload); +void SendPluginCommand(Uint32 identifier, StackStrF & payload); /* ------------------------------------------------------------------------------------------------ * Retrieve the server time. @@ -55,7 +55,7 @@ const ULongInt & GetTime(); /* ------------------------------------------------------------------------------------------------ * Send a log message to the server. */ -void SendLogMessage(const StackStrF & msg); +void SendLogMessage(StackStrF & msg); /* ------------------------------------------------------------------------------------------------ * Retrieve the last error that occurred on the server. @@ -115,7 +115,7 @@ CSStr GetServerName(); /* ------------------------------------------------------------------------------------------------ * Modify the server name. */ -void SetServerName(const StackStrF & name); +void SetServerName(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Retrieve the server password. @@ -125,7 +125,7 @@ CSStr GetServerPassword(); /* ------------------------------------------------------------------------------------------------ * Modify the server password. */ -void SetServerPassword(const StackStrF & passwd); +void SetServerPassword(StackStrF & passwd); /* ------------------------------------------------------------------------------------------------ * Retrieve the game-mode text. @@ -135,17 +135,17 @@ CSStr GetGameModeText(); /* ------------------------------------------------------------------------------------------------ * Modify the game-mode text. */ -void SetGameModeText(const StackStrF & text); +void SetGameModeText(StackStrF & text); /* ------------------------------------------------------------------------------------------------ * Create a radio stream. */ -void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url); +void CreateRadioStream(bool listed, StackStrF & name, StackStrF & url); /* ------------------------------------------------------------------------------------------------ * Create a radio stream. */ -void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url); +void CreateRadioStreamEx(Int32 id, bool listed, StackStrF & name, StackStrF & url); /* ------------------------------------------------------------------------------------------------ * Remove a radio stream. @@ -427,22 +427,22 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z); /* ------------------------------------------------------------------------------------------------ * Ban an IP address from the server. */ -void BanIP(const StackStrF & addr); +void BanIP(StackStrF & addr); /* ------------------------------------------------------------------------------------------------ * Unban an IP address from the server. */ -bool UnbanIP(const StackStrF & addr); +bool UnbanIP(StackStrF & addr); /* ------------------------------------------------------------------------------------------------ * See if an IP address is banned from the server. */ -bool IsIPBanned(const StackStrF & addr); +bool IsIPBanned(StackStrF & addr); /* ------------------------------------------------------------------------------------------------ * Retrieve the identifier of the player with the specified name. */ -Int32 GetPlayerIdFromName(const StackStrF & name); +Int32 GetPlayerIdFromName(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See if a player with the specified identifier is connected. diff --git a/source/Misc/Model.cpp b/source/Misc/Model.cpp index 3e7c9d52..513a999a 100644 --- a/source/Misc/Model.cpp +++ b/source/Misc/Model.cpp @@ -16,7 +16,7 @@ CSStr GetModelName(Int32 /*id*/) } // ------------------------------------------------------------------------------------------------ -void SetModelName(Int32 /*id*/, const StackStrF & /*name*/) +void SetModelName(Int32 /*id*/, StackStrF & /*name*/) { // @TODO Implement... } diff --git a/source/Misc/Model.hpp b/source/Misc/Model.hpp index afcc9bc3..7d893aab 100644 --- a/source/Misc/Model.hpp +++ b/source/Misc/Model.hpp @@ -15,7 +15,7 @@ CSStr GetModelName(Int32 id); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a model identifier. */ -void SetModelName(Int32 id, const StackStrF & name); +void SetModelName(Int32 id, StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the given model identifier is used a weapon model. diff --git a/source/Misc/Player.cpp b/source/Misc/Player.cpp index 704d8410..7ef40788 100644 --- a/source/Misc/Player.cpp +++ b/source/Misc/Player.cpp @@ -102,7 +102,7 @@ CCStr GetSkinName(Uint32 id) } // ------------------------------------------------------------------------------------------------ -void SetSkinName(Uint32 id, const StackStrF & name) +void SetSkinName(Uint32 id, StackStrF & name) { if (id <= 159) { @@ -111,7 +111,7 @@ void SetSkinName(Uint32 id, const StackStrF & name) } // ------------------------------------------------------------------------------------------------ -Int32 GetSkinID(const StackStrF & name) +Int32 GetSkinID(StackStrF & name) { // Clone the string into an editable version String str(name.mPtr, name.mLen); diff --git a/source/Misc/Player.hpp b/source/Misc/Player.hpp index fd0a5611..2b4226aa 100644 --- a/source/Misc/Player.hpp +++ b/source/Misc/Player.hpp @@ -15,12 +15,12 @@ CCStr GetSkinName(Uint32 id); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a skin model identifier. */ -void SetSkinName(Uint32 id, const StackStrF & name); +void SetSkinName(Uint32 id, StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Convert a vehicle model name to a skin model identifier. */ -Int32 GetSkinID(const StackStrF & name); +Int32 GetSkinID(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the specified skin model identifier is valid. diff --git a/source/Misc/Routine.cpp b/source/Misc/Routine.cpp index e31d3764..0b59bd50 100644 --- a/source/Misc/Routine.cpp +++ b/source/Misc/Routine.cpp @@ -232,7 +232,7 @@ SQInteger Routine::Create(HSQUIRRELVM vm) } // ------------------------------------------------------------------------------------------------ -bool Routine::IsWithTag(const StackStrF & tag) +bool Routine::IsWithTag(StackStrF & tag) { // Is the specified tag valid? if (tag.mPtr != nullptr) diff --git a/source/Misc/Routine.hpp b/source/Misc/Routine.hpp index 75a78502..fab5a38a 100644 --- a/source/Misc/Routine.hpp +++ b/source/Misc/Routine.hpp @@ -285,7 +285,7 @@ public: /* -------------------------------------------------------------------------------------------- * Retrieve the number of used routine slots. */ - static const LightObj & FindByTag(const StackStrF & tag) + static const LightObj & FindByTag(StackStrF & tag) { // Is the specified tag valid? if (!tag.mPtr) @@ -308,7 +308,7 @@ public: /* -------------------------------------------------------------------------------------------- * Check if a routine with a certain tag exists. */ - static bool IsWithTag(const StackStrF & tag); + static bool IsWithTag(StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Process all active routines and update elapsed time. */ @@ -384,7 +384,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag) + void SetTag(StackStrF & tag) { GetValid().mTag.assign(tag.mPtr, ClampMin(tag.mLen, 0)); } diff --git a/source/Misc/Signal.cpp b/source/Misc/Signal.cpp index 9f0898ad..10bab258 100644 --- a/source/Misc/Signal.cpp +++ b/source/Misc/Signal.cpp @@ -1528,7 +1528,7 @@ LightObj Signal::CreateFree() } // ------------------------------------------------------------------------------------------------ -LightObj Signal::Create(const StackStrF & name) +LightObj Signal::Create(StackStrF & name) { // Validate the signal name if (name.mLen <= 0) @@ -1564,7 +1564,7 @@ LightObj Signal::Create(const StackStrF & name) } // ------------------------------------------------------------------------------------------------ -void Signal::Remove(const StackStrF & name) +void Signal::Remove(StackStrF & name) { // Validate the signal name if (name.mLen <= 0) @@ -1598,7 +1598,7 @@ void Signal::Remove(const StackStrF & name) } // ------------------------------------------------------------------------------------------------ -const LightObj & Signal::Fetch(const StackStrF & name) +const LightObj & Signal::Fetch(StackStrF & name) { // Validate the signal name if (name.mLen <= 0) diff --git a/source/Misc/Signal.hpp b/source/Misc/Signal.hpp index 29acb878..f2c95d5c 100644 --- a/source/Misc/Signal.hpp +++ b/source/Misc/Signal.hpp @@ -706,17 +706,17 @@ public: /* -------------------------------------------------------------------------------------------- * Create a new signal with the specified name. */ - static LightObj Create(const StackStrF & name); + static LightObj Create(StackStrF & name); /* -------------------------------------------------------------------------------------------- * Remove the signal with the specified name. */ - static void Remove(const StackStrF & name); + static void Remove(StackStrF & name); /* -------------------------------------------------------------------------------------------- * Retrieve the signal with the specified name. */ - static const LightObj & Fetch(const StackStrF & name); + static const LightObj & Fetch(StackStrF & name); /* -------------------------------------------------------------------------------------------- * Emit a signal from the module. diff --git a/source/Misc/Tasks.cpp b/source/Misc/Tasks.cpp index 101737f1..e0dcae43 100644 --- a/source/Misc/Tasks.cpp +++ b/source/Misc/Tasks.cpp @@ -451,7 +451,7 @@ SQInteger Tasks::Exists(Int32 id, Int32 type, HSQUIRRELVM vm) } // ------------------------------------------------------------------------------------------------ -const Tasks::Task & Tasks::FindByTag(Int32 id, Int32 type, const StackStrF & tag) +const Tasks::Task & Tasks::FindByTag(Int32 id, Int32 type, StackStrF & tag) { // Attempt to find the requested task for (const auto & t : s_Tasks) diff --git a/source/Misc/Tasks.hpp b/source/Misc/Tasks.hpp index 42331078..9eb7348e 100644 --- a/source/Misc/Tasks.hpp +++ b/source/Misc/Tasks.hpp @@ -148,7 +148,7 @@ private: /* ---------------------------------------------------------------------------------------- * Modify the associated user tag. */ - void SetTag(const StackStrF & tag) + void SetTag(StackStrF & tag) { mTag.assign(tag.mPtr, ClampMin(tag.mLen, 0)); } @@ -358,7 +358,7 @@ protected: /* -------------------------------------------------------------------------------------------- * Cleanup all tasks associated with the specified entity. */ - static const Task & FindByTag(Int32 id, Int32 type, const StackStrF & tag); + static const Task & FindByTag(Int32 id, Int32 type, StackStrF & tag); public: diff --git a/source/Misc/Vehicle.cpp b/source/Misc/Vehicle.cpp index 32759e8b..fa55478e 100644 --- a/source/Misc/Vehicle.cpp +++ b/source/Misc/Vehicle.cpp @@ -102,7 +102,7 @@ String GetAutomobileName(Uint32 id) } // ------------------------------------------------------------------------------------------------ -void SetAutomobileName(Uint32 id, const StackStrF & name) +void SetAutomobileName(Uint32 id, StackStrF & name) { if (id > 129 && id < 237) { @@ -119,7 +119,7 @@ void SetAutomobileName(Uint32 id, const StackStrF & name) } // ------------------------------------------------------------------------------------------------ -Int32 GetAutomobileID(const StackStrF & name) +Int32 GetAutomobileID(StackStrF & name) { // Clone the string into an editable version String str(name.mPtr, name.mLen); diff --git a/source/Misc/Vehicle.hpp b/source/Misc/Vehicle.hpp index 467456a9..2d88b31d 100644 --- a/source/Misc/Vehicle.hpp +++ b/source/Misc/Vehicle.hpp @@ -15,12 +15,12 @@ String GetAutomobileName(Uint32 id); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a vehicle model identifier. */ -void SetAutomobileName(Uint32 id, const StackStrF & name); +void SetAutomobileName(Uint32 id, StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Convert a vehicle model name to a vehicle model identifier. */ -Int32 GetAutomobileID(const StackStrF & name); +Int32 GetAutomobileID(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the specified vehicle model identifier is valid. diff --git a/source/Misc/Weapon.cpp b/source/Misc/Weapon.cpp index a3b94c55..0674e6ad 100644 --- a/source/Misc/Weapon.cpp +++ b/source/Misc/Weapon.cpp @@ -81,7 +81,7 @@ CCStr GetWeaponName(Uint32 id) } // ------------------------------------------------------------------------------------------------ -void SetWeaponName(Uint32 id, const StackStrF & name) +void SetWeaponName(Uint32 id, StackStrF & name) { // Can we consider this a custom weapon ID? if (IsCustomWeapon(id)) @@ -109,7 +109,7 @@ void ClearCustomWeaponNamePool() } // ------------------------------------------------------------------------------------------------ -Int32 GetWeaponID(const StackStrF & name) +Int32 GetWeaponID(StackStrF & name) { // Clone the string into an editable version String str(name.mPtr, name.mLen); diff --git a/source/Misc/Weapon.hpp b/source/Misc/Weapon.hpp index 97457131..4bb292fa 100644 --- a/source/Misc/Weapon.hpp +++ b/source/Misc/Weapon.hpp @@ -15,7 +15,7 @@ CSStr GetWeaponName(Uint32 id); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a weapon identifier. */ -void SetWeaponName(Uint32 id, const StackStrF & name); +void SetWeaponName(Uint32 id, StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Retrieve the total number of identifiers in the pool of custom weapon names. @@ -30,12 +30,12 @@ void ClearCustomWeaponNamePool(); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a weapon identifier. */ -void SetWeaponName(Uint32 id, const StackStrF & name); +void SetWeaponName(Uint32 id, StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Convert a weapon name to a weapon identifier. */ -Int32 GetWeaponID(const StackStrF & name); +Int32 GetWeaponID(StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the specified weapon identifier is valid.