diff --git a/source/Base/Shared.cpp b/source/Base/Shared.cpp index b0fba0a6..f15cb24e 100644 --- a/source/Base/Shared.cpp +++ b/source/Base/Shared.cpp @@ -390,7 +390,7 @@ const SQChar * LeftStr(const SQChar * t, SQChar f, SQUint32 w) noexcept w = 0; } // Is the string empty? - else if (n < 0) + else if (n == 0) { LogWrn("Invalid string length: %d < 0", n); } @@ -430,7 +430,7 @@ const SQChar * LeftStr(const SQChar * t, SQChar f, SQUint32 w, SQUint32 o) noexc w = 0; } // Is the string empty? - else if (n < 0) + else if (n == 0) { LogWrn("Invalid string length: %d < 0", n); } @@ -471,7 +471,7 @@ const SQChar * RightStr(const SQChar * t, SQChar f, SQUint32 w) noexcept w = 0; } // Is the string empty? - else if (n < 0) + else if (n == 0) { LogWrn("Invalid string length: %d < 0", n); } @@ -511,7 +511,7 @@ const SQChar * RightStr(const SQChar * t, SQChar f, SQUint32 w, SQUint32 o) noex w = 0; } // Is the string empty? - else if (n < 0) + else if (n == 0) { LogWrn("Invalid string length: %d < 0", n); } @@ -552,7 +552,7 @@ const SQChar * CenterStr(const SQChar * t, SQChar f, SQUint32 w) noexcept w = 0; } // Is the string empty? - else if (n < 0) + else if (n == 0) { LogWrn("Invalid string length: %d < 0", n); } diff --git a/source/Common.cpp b/source/Common.cpp index 99bd5dda..192ae988 100644 --- a/source/Common.cpp +++ b/source/Common.cpp @@ -296,6 +296,9 @@ static void VC_PlayerCrashReport(int player, const char * report) noexcept static void VC_ServerPerformanceReport(int count, const char ** description, unsigned long long * millis) noexcept { // Ignored for now... + SQMOD_UNUSED_VAR(count); + SQMOD_UNUSED_VAR(description); + SQMOD_UNUSED_VAR(millis); } static void VC_PlayerName(int player, const char * previous, const char * current) noexcept diff --git a/source/Config.hpp b/source/Config.hpp index 486de4da..4f8df555 100644 --- a/source/Config.hpp +++ b/source/Config.hpp @@ -290,6 +290,9 @@ class LocalEvent; * VARIOUS DEFINES */ +#define SQMOD_DEC_UNUSED_VAR(t, n, v) t n = v; (void)(n) +#define SQMOD_UNUSED_VAR(n) (void)(n) + #define VALID_ENTITY(e) (e >= 0) #define INVALID_ENTITY(e) (e < 0) diff --git a/source/Core.cpp b/source/Core.cpp index d7de69b2..2a64e3f5 100644 --- a/source/Core.cpp +++ b/source/Core.cpp @@ -613,6 +613,7 @@ void Core::PrintCallstack() noexcept // ------------------------------------------------------------------------------------------------ void Core::PrintFunc(HSQUIRRELVM vm, const SQChar * str, ...) noexcept { + SQMOD_UNUSED_VAR(vm); // Prepare the arguments list va_list args; va_start(args, str); @@ -654,6 +655,7 @@ void Core::PrintFunc(HSQUIRRELVM vm, const SQChar * str, ...) noexcept void Core::ErrorFunc(HSQUIRRELVM vm, const SQChar * str, ...) noexcept { + SQMOD_UNUSED_VAR(vm); // Prepare the arguments list va_list args; va_start(args, str); @@ -729,6 +731,7 @@ SQInteger Core::RuntimeErrorHandler(HSQUIRRELVM vm) noexcept void Core::CompilerErrorHandler(HSQUIRRELVM vm, const SQChar * desc, const SQChar * src, SQInteger line, SQInteger column) noexcept { + SQMOD_UNUSED_VAR(vm); try { _Core->m_ErrorMsg.assign(ToStringF("%s : %s:%d : %s", src, line, column, desc)); @@ -1558,6 +1561,7 @@ void Core::OnLogMessage(SQInt32 type, const SQChar * message) noexcept // ------------------------------------------------------------------------------------------------ void Core::OnPlayerUpdate(SQInt32 player, SQInt32 type) noexcept { + SQMOD_UNUSED_VAR(type); Vector3 pos; // Is this player instance tracked for the first time if (m_PlayerTrack[player].Fresh) @@ -1617,6 +1621,7 @@ void Core::OnPlayerUpdate(SQInt32 player, SQInt32 type) noexcept void Core::OnVehicleUpdate(SQInt32 vehicle, SQInt32 type) noexcept { + SQMOD_UNUSED_VAR(type); Vector3 pos; // Is this vehicle instance tracked for the first time if (m_VehicleTrack[vehicle].Fresh) diff --git a/source/Entity.cpp b/source/Entity.cpp index 8c84b306..a42be9ce 100644 --- a/source/Entity.cpp +++ b/source/Entity.cpp @@ -161,6 +161,7 @@ EVehicleCustom & GVehicleCustom() noexcept // ------------------------------------------------------------------------------------------------ bool Register_Entity(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } diff --git a/source/Entity.hpp b/source/Entity.hpp index 05f2d728..0444b94b 100644 --- a/source/Entity.hpp +++ b/source/Entity.hpp @@ -198,6 +198,7 @@ private: inst.Position.y = y; inst.Position.z = z; inst.Color.SetRGBA(color); + SQMOD_UNUSED_VAR(index); } // -------------------------------------------------------------------------------------------- @@ -359,14 +360,24 @@ private: // -------------------------------------------------------------------------------------------- static void Store(Instance & inst) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); } // -------------------------------------------------------------------------------------------- static void Store(Instance & inst, SQInt32 player, SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQUint32 r, SQUint32 g, SQUint32 b, SQUint32 a, SQFloat radius) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); + SQMOD_UNUSED_VAR(player); + SQMOD_UNUSED_VAR(world); + SQMOD_UNUSED_VAR(x); + SQMOD_UNUSED_VAR(y); + SQMOD_UNUSED_VAR(z); + SQMOD_UNUSED_VAR(r); + SQMOD_UNUSED_VAR(g); + SQMOD_UNUSED_VAR(b); + SQMOD_UNUSED_VAR(a); + SQMOD_UNUSED_VAR(radius); } // -------------------------------------------------------------------------------------------- @@ -558,6 +569,7 @@ private: inst.Secondary = secondary; inst.Alternative = alternative; inst.Release = release; + SQMOD_UNUSED_VAR(slot); } // -------------------------------------------------------------------------------------------- @@ -727,14 +739,20 @@ private: // -------------------------------------------------------------------------------------------- static void Store(Instance & inst) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); } // -------------------------------------------------------------------------------------------- static void Store(Instance & inst, SQInt32 model, SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQInt32 alpha) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); + SQMOD_UNUSED_VAR(model); + SQMOD_UNUSED_VAR(world); + SQMOD_UNUSED_VAR(x); + SQMOD_UNUSED_VAR(y); + SQMOD_UNUSED_VAR(z); + SQMOD_UNUSED_VAR(alpha); } // -------------------------------------------------------------------------------------------- @@ -905,14 +923,22 @@ private: // -------------------------------------------------------------------------------------------- static void Store(Instance & inst) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); } // -------------------------------------------------------------------------------------------- static void Store(Instance & inst, SQInt32 model, SQInt32 world, SQInt32 quantity, SQFloat x, SQFloat y, SQFloat z, SQInt32 alpha, bool automatic) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); + SQMOD_UNUSED_VAR(model); + SQMOD_UNUSED_VAR(world); + SQMOD_UNUSED_VAR(quantity); + SQMOD_UNUSED_VAR(x); + SQMOD_UNUSED_VAR(y); + SQMOD_UNUSED_VAR(z); + SQMOD_UNUSED_VAR(alpha); + SQMOD_UNUSED_VAR(automatic); } // -------------------------------------------------------------------------------------------- @@ -1142,7 +1168,7 @@ private: // -------------------------------------------------------------------------------------------- static void Store(Instance & inst) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); } // -------------------------------------------------------------------------------------------- @@ -1222,6 +1248,7 @@ private: static void Destroy(SQInt32 id) noexcept { /* @TODO: Implement as kick. */ + SQMOD_UNUSED_VAR(id); } public: @@ -1482,14 +1509,23 @@ private: // -------------------------------------------------------------------------------------------- static void Store(Instance & inst) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); } // -------------------------------------------------------------------------------------------- static void Store(Instance & inst, SQInt32 player, SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQUint32 r, SQUint32 g, SQUint32 b, SQFloat radius) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); + SQMOD_UNUSED_VAR(player); + SQMOD_UNUSED_VAR(world); + SQMOD_UNUSED_VAR(x); + SQMOD_UNUSED_VAR(y); + SQMOD_UNUSED_VAR(z); + SQMOD_UNUSED_VAR(r); + SQMOD_UNUSED_VAR(g); + SQMOD_UNUSED_VAR(b); + SQMOD_UNUSED_VAR(radius); } // -------------------------------------------------------------------------------------------- @@ -1668,6 +1704,14 @@ private: SQInt32 xr, SQInt32 yr, SQFloat angle, SQInt32 alpha, bool rel) noexcept { inst.Path.assign(file); + SQMOD_UNUSED_VAR(index); + SQMOD_UNUSED_VAR(xp); + SQMOD_UNUSED_VAR(yp); + SQMOD_UNUSED_VAR(xr); + SQMOD_UNUSED_VAR(yr); + SQMOD_UNUSED_VAR(angle); + SQMOD_UNUSED_VAR(alpha); + SQMOD_UNUSED_VAR(rel); } // -------------------------------------------------------------------------------------------- @@ -1839,6 +1883,11 @@ private: SQUint32 color, bool rel) noexcept { inst.Text.assign(text); + SQMOD_UNUSED_VAR(index); + SQMOD_UNUSED_VAR(xp); + SQMOD_UNUSED_VAR(yp); + SQMOD_UNUSED_VAR(color); + SQMOD_UNUSED_VAR(rel); } // -------------------------------------------------------------------------------------------- @@ -2006,14 +2055,22 @@ private: // -------------------------------------------------------------------------------------------- static void Store(Instance & inst) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); } // -------------------------------------------------------------------------------------------- static void Store(Instance & inst, SQInt32 model, SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQFloat angle, SQInt32 primary, SQInt32 secondary) noexcept { - /* ... */ + SQMOD_UNUSED_VAR(inst); + SQMOD_UNUSED_VAR(model); + SQMOD_UNUSED_VAR(world); + SQMOD_UNUSED_VAR(x); + SQMOD_UNUSED_VAR(y); + SQMOD_UNUSED_VAR(z); + SQMOD_UNUSED_VAR(angle); + SQMOD_UNUSED_VAR(primary); + SQMOD_UNUSED_VAR(secondary); } // -------------------------------------------------------------------------------------------- @@ -2311,12 +2368,28 @@ public: return m_ID; } + /* -------------------------------------------------------------------------------------------- + * Implicit conversion to an entity identifier. + */ + operator Int64 () const noexcept + { + return _SCI64(m_ID); + } + /* -------------------------------------------------------------------------------------------- * Implicit conversion to an entity identifier. */ operator SQUint32 () const noexcept { - return static_cast< SQUint32 >(m_ID); + return _SCU32(m_ID); + } + + /* -------------------------------------------------------------------------------------------- + * Implicit conversion to an entity identifier. + */ + operator Uint64 () const noexcept + { + return _SCU64(m_ID); } /* -------------------------------------------------------------------------------------------- diff --git a/source/Event/Global.hpp b/source/Event/Global.hpp index 3dbcd892..4c77fb6d 100644 --- a/source/Event/Global.hpp +++ b/source/Event/Global.hpp @@ -1243,6 +1243,7 @@ template < class T > void GlobalFilter< T >::Clear(SQInt32 header) noexcept // Now it's safe to reset the filter m_Filter.reset(); } + SQMOD_UNUSED_VAR(header); } // ------------------------------------------------------------------------------------------------ @@ -1264,6 +1265,7 @@ template < class T > void GlobalFilter< T >::Flip(SQInt32 header) noexcept // Hook from the newly filtered entities Hook(); } + SQMOD_UNUSED_VAR(header); } // ------------------------------------------------------------------------------------------------ diff --git a/source/Event/Local.hpp b/source/Event/Local.hpp index 0e609d24..a2c13af6 100644 --- a/source/Event/Local.hpp +++ b/source/Event/Local.hpp @@ -1257,6 +1257,7 @@ template < class T > void LocalFilter< T >::Clear(SQInt32 header) noexcept // Now it's safe to reset the filter m_Filter.reset(); } + SQMOD_UNUSED_VAR(header); } // ------------------------------------------------------------------------------------------------ @@ -1278,6 +1279,7 @@ template < class T > void LocalFilter< T >::Flip(SQInt32 header) noexcept // Hook from the newly filtered entities Hook(); } + SQMOD_UNUSED_VAR(header); } // ------------------------------------------------------------------------------------------------ diff --git a/source/Event/Shared.cpp b/source/Event/Shared.cpp index 670d0164..bbda3c6b 100644 --- a/source/Event/Shared.cpp +++ b/source/Event/Shared.cpp @@ -1,5 +1,6 @@ // ------------------------------------------------------------------------------------------------ #include "Event/Shared.hpp" +#include "Config.hpp" #include "Register.hpp" // ------------------------------------------------------------------------------------------------ @@ -314,6 +315,7 @@ bool CanBeInversed(SQInt32 type) noexcept // ================================================================================================ bool Register_Event(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } diff --git a/source/Library/Datetime.cpp b/source/Library/Datetime.cpp index 900fd8c3..e738be8c 100644 --- a/source/Library/Datetime.cpp +++ b/source/Library/Datetime.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Datetime(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/FileIO.cpp b/source/Library/FileIO.cpp index af513f14..fb6024ad 100644 --- a/source/Library/FileIO.cpp +++ b/source/Library/FileIO.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_FileIO(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/Format.cpp b/source/Library/Format.cpp index c85fda56..5b43ed9e 100644 --- a/source/Library/Format.cpp +++ b/source/Library/Format.cpp @@ -160,6 +160,7 @@ String GetFormatStr(HSQUIRRELVM vm, const String & fstr, SQInteger arg, SQInteg // ------------------------------------------------------------------------------------------------ bool Register_Format(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } diff --git a/source/Library/INI.cpp b/source/Library/INI.cpp index 4cbd5e35..7428d9a4 100644 --- a/source/Library/INI.cpp +++ b/source/Library/INI.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_INI(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/IRC/Session.cpp b/source/Library/IRC/Session.cpp index 450105ec..c6cc8c43 100644 --- a/source/Library/IRC/Session.cpp +++ b/source/Library/IRC/Session.cpp @@ -55,6 +55,7 @@ Session::~Session() // ------------------------------------------------------------------------------------------------ void Session::Process(SQFloat delta) noexcept { + SQMOD_UNUSED_VAR(delta); // Make sure that the IRC session is connected if (!irc_is_connected(m_Session)) { @@ -197,12 +198,22 @@ void Session::ForwardEvent(Function & listener, unsigned int event, const char * // ------------------------------------------------------------------------------------------------ void Session::ForwardEvent(Function & listener, const char * nick, const char * addr, irc_dcc_t dccid) noexcept { + SQMOD_UNUSED_VAR(listener); + SQMOD_UNUSED_VAR(nick); + SQMOD_UNUSED_VAR(addr); + SQMOD_UNUSED_VAR(dccid); /* @TODO: Implement! */ } // ------------------------------------------------------------------------------------------------ void Session::ForwardEvent(Function & listener, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid) noexcept { + SQMOD_UNUSED_VAR(listener); + SQMOD_UNUSED_VAR(nick); + SQMOD_UNUSED_VAR(addr); + SQMOD_UNUSED_VAR(filename); + SQMOD_UNUSED_VAR(size); + SQMOD_UNUSED_VAR(dccid); /* @TODO: Implement! */ } diff --git a/source/Library/JSON.cpp b/source/Library/JSON.cpp index c95ec3fd..87d143df 100644 --- a/source/Library/JSON.cpp +++ b/source/Library/JSON.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_JSON(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/LongInt.cpp b/source/Library/LongInt.cpp index 5b9ad943..6c89012c 100644 --- a/source/Library/LongInt.cpp +++ b/source/Library/LongInt.cpp @@ -7,6 +7,7 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_LongInt(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); /* Sqrat::RootTable(vm).Bind(_SC("SLongInt"), Sqrat::Class(vm, _SC("SLongInt")) .Ctor() diff --git a/source/Library/Math.cpp b/source/Library/Math.cpp index cb804fc6..a72c1eef 100644 --- a/source/Library/Math.cpp +++ b/source/Library/Math.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Math(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/Numeric.cpp b/source/Library/Numeric.cpp index 2516a77a..2543dc3a 100644 --- a/source/Library/Numeric.cpp +++ b/source/Library/Numeric.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Numeric(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/Shared.cpp b/source/Library/Shared.cpp index 8d69bc92..93194558 100644 --- a/source/Library/Shared.cpp +++ b/source/Library/Shared.cpp @@ -1,12 +1,16 @@ #include "Library/Shared.hpp" #include "Register.hpp" +// ------------------------------------------------------------------------------------------------ +#include "Config.hpp" + // ------------------------------------------------------------------------------------------------ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Library(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } diff --git a/source/Library/String.cpp b/source/Library/String.cpp index f5b51c36..50dfb19a 100644 --- a/source/Library/String.cpp +++ b/source/Library/String.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_String(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/SysPath.cpp b/source/Library/SysPath.cpp index baea1b82..deb74bcf 100644 --- a/source/Library/SysPath.cpp +++ b/source/Library/SysPath.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_SysPath(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/System.cpp b/source/Library/System.cpp index cc5c8d3d..8183efa4 100644 --- a/source/Library/System.cpp +++ b/source/Library/System.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_System(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/Timer.cpp b/source/Library/Timer.cpp index 5fc9b086..bfabd8ca 100644 --- a/source/Library/Timer.cpp +++ b/source/Library/Timer.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Timer(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/Utils.cpp b/source/Library/Utils.cpp index 2f0e8f50..380627de 100644 --- a/source/Library/Utils.cpp +++ b/source/Library/Utils.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Utils(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Library/XML.cpp b/source/Library/XML.cpp index b11ecfc0..e0b0c816 100644 --- a/source/Library/XML.cpp +++ b/source/Library/XML.cpp @@ -7,7 +7,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_XML(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/Automobile.hpp b/source/Misc/Automobile.hpp index 8afcd8f2..e6007bb2 100644 --- a/source/Misc/Automobile.hpp +++ b/source/Misc/Automobile.hpp @@ -102,6 +102,14 @@ public: return m_ID; } + /* -------------------------------------------------------------------------------------------- + * Implicit conversion to model identifier. + */ + operator Int64 () const noexcept + { + return _SCI64(m_ID); + } + /* -------------------------------------------------------------------------------------------- * Implicit conversion to boolean. */ diff --git a/source/Misc/Functions.cpp b/source/Misc/Functions.cpp index 3e08fa69..867c38d1 100644 --- a/source/Misc/Functions.cpp +++ b/source/Misc/Functions.cpp @@ -1,13 +1,17 @@ #include "Misc/Functions.hpp" #include "Register.hpp" +// ------------------------------------------------------------------------------------------------ +#include "Config.hpp" + // ------------------------------------------------------------------------------------------------ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_Functions(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/Model.cpp b/source/Misc/Model.cpp index e8fd7b84..e997e3cf 100644 --- a/source/Misc/Model.cpp +++ b/source/Misc/Model.cpp @@ -214,6 +214,7 @@ const SQChar * CModel::GetName() const noexcept // ------------------------------------------------------------------------------------------------ void CModel::SetName(const SQChar * name) noexcept { + SQMOD_UNUSED_VAR(name); m_ID = -1; /* @TODO Implement! */ } diff --git a/source/Misc/Model.hpp b/source/Misc/Model.hpp index 07892709..74af18c1 100644 --- a/source/Misc/Model.hpp +++ b/source/Misc/Model.hpp @@ -102,6 +102,14 @@ public: return m_ID; } + /* -------------------------------------------------------------------------------------------- + * Implicit conversion to model identifier. + */ + operator Int64 () const noexcept + { + return _SCI64(m_ID); + } + /* -------------------------------------------------------------------------------------------- * Implicit conversion to boolean. */ diff --git a/source/Misc/PlayerImmunity.cpp b/source/Misc/PlayerImmunity.cpp index c2d6b422..3b87dd49 100644 --- a/source/Misc/PlayerImmunity.cpp +++ b/source/Misc/PlayerImmunity.cpp @@ -6,7 +6,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_CPlayerImmunity(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/Radio.cpp b/source/Misc/Radio.cpp index ef031d39..68b63133 100644 --- a/source/Misc/Radio.cpp +++ b/source/Misc/Radio.cpp @@ -6,7 +6,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_CRadio(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/Shared.cpp b/source/Misc/Shared.cpp index c2349c6f..701168c4 100644 --- a/source/Misc/Shared.cpp +++ b/source/Misc/Shared.cpp @@ -2450,10 +2450,9 @@ SQInt32 WeaponToModel(SQInt32 id) bool Register_Misc(HSQUIRRELVM vm) { // Output debugging information - LogDbg("Beginning registration of API"); + LogDbg("Beginning registration of API"); // Attempt to register the specified API Sqrat::RootTable(vm) - .Func(_SC("GetKeyCodeName"), &GetKeyCodeName) .Func(_SC("GetModelName"), &GetModelName) .Func(_SC("IsModelWeapon"), &IsModelWeapon) @@ -2469,12 +2468,12 @@ bool Register_Misc(HSQUIRRELVM vm) .Func(_SC("GetWeaponID"), &GetWeaponID) .Func(_SC("IsWeaponValid"), &IsWeaponValid) .Func(_SC("IsWeaponNatural"), &IsWeaponNatural) - .Func(_SC("WeaponToModel"), &WeaponToModel) + .Func(_SC("WeaponToModel"), &WeaponToModel); /* END REGISTRATION STATEMENT */ ; // Output debugging information - LogDbg("Registration of API was successful"); + LogDbg("Registration of API was successful"); // Registration succeeded return true; } diff --git a/source/Misc/Shared.hpp b/source/Misc/Shared.hpp index b9fd593d..eb473134 100644 --- a/source/Misc/Shared.hpp +++ b/source/Misc/Shared.hpp @@ -14,7 +14,7 @@ namespace SqMod { /* ------------------------------------------------------------------------------------------------ * Attempt to convert the specified key code to a name. */ -const SQChar * GetKeyCodeName(SQInteger keycode); +const SQChar * GetKeyCodeName(SQInt32 keycode); /* ------------------------------------------------------------------------------------------------ * Attemp to convert the specified model identifier to a name. diff --git a/source/Misc/Skin.hpp b/source/Misc/Skin.hpp index 5d09decb..4c2071e5 100644 --- a/source/Misc/Skin.hpp +++ b/source/Misc/Skin.hpp @@ -97,17 +97,34 @@ public: /* -------------------------------------------------------------------------------------------- * Implicit conversion to skin identifier. */ - operator SQInt32 () const noexcept { return m_ID; } + operator SQInt32 () const noexcept + { + return m_ID; + } + + /* -------------------------------------------------------------------------------------------- + * Implicit conversion to skin identifier. + */ + operator Int64 () const noexcept + { + return _SCI64(m_ID); + } /* -------------------------------------------------------------------------------------------- * Implicit conversion to boolean. */ - operator bool () const noexcept { return IsSkinValid(m_ID); } + operator bool () const noexcept + { + return IsSkinValid(m_ID); + } /* -------------------------------------------------------------------------------------------- * Negation operator. */ - bool operator ! () const noexcept { return !IsSkinValid(m_ID); } + bool operator ! () const noexcept + { + return !IsSkinValid(m_ID); + } /* -------------------------------------------------------------------------------------------- * Used by the script to compare two instances of this type. diff --git a/source/Misc/Sound.cpp b/source/Misc/Sound.cpp index 42901fd9..45988f07 100644 --- a/source/Misc/Sound.cpp +++ b/source/Misc/Sound.cpp @@ -6,7 +6,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_CSound(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/VehicleImmunity.cpp b/source/Misc/VehicleImmunity.cpp index 4c8c1ded..9e7d1ecf 100644 --- a/source/Misc/VehicleImmunity.cpp +++ b/source/Misc/VehicleImmunity.cpp @@ -6,7 +6,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_CVehicleImmunity(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/WastedSettings.cpp b/source/Misc/WastedSettings.cpp index a3b33306..a5766c7e 100644 --- a/source/Misc/WastedSettings.cpp +++ b/source/Misc/WastedSettings.cpp @@ -6,7 +6,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_CWastedSettings(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Misc/Weapon.hpp b/source/Misc/Weapon.hpp index 8e9059b2..1a4d2d7d 100644 --- a/source/Misc/Weapon.hpp +++ b/source/Misc/Weapon.hpp @@ -100,13 +100,21 @@ public: bool operator >= (const CWeapon & w) const noexcept; /* -------------------------------------------------------------------------------------------- - * Implicit conversion to model identifier. + * Implicit conversion to weapon identifier. */ operator SQInt32 () const noexcept { return m_ID; } + /* -------------------------------------------------------------------------------------------- + * Implicit conversion to weapon identifier. + */ + operator Int64 () const noexcept + { + return _SCI64(m_ID); + } + /* -------------------------------------------------------------------------------------------- * Implicit conversion to boolean. */ diff --git a/source/Misc/WorldBounds.cpp b/source/Misc/WorldBounds.cpp index 23e8c8c3..5c31de79 100644 --- a/source/Misc/WorldBounds.cpp +++ b/source/Misc/WorldBounds.cpp @@ -6,7 +6,8 @@ namespace SqMod { // ------------------------------------------------------------------------------------------------ bool Register_CWorldBounds(HSQUIRRELVM vm) { + SQMOD_UNUSED_VAR(vm); return true; } -} // Namespace:: SqMod \ No newline at end of file +} // Namespace:: SqMod diff --git a/source/Signal.hpp b/source/Signal.hpp index 636e89d1..6145ea58 100644 --- a/source/Signal.hpp +++ b/source/Signal.hpp @@ -240,29 +240,29 @@ public: } // -------------------------------------------------------------------------------------------- - void Emit(Args &... args) + template void Emit(Uref &&... args) { for (Node * node = m_Nodes.m_Head; node; node = node->m_Next) { - (*node->m_Exec)(node->m_This, std::forward(args)...); + (*node->m_Exec)(node->m_This, std::forward(args)...); } } // -------------------------------------------------------------------------------------------- - template void Query(T && collecter, Args &... args) + template void Query(T && collecter, Uref &&... args) { for (Node * node = m_Nodes.m_Head; node; node = node->m_Next) { - collecter( ( (*node->m_Exec) (node->m_This, std::forward(args)...) ) ); + collecter( ( (*node->m_Exec) (node->m_This, std::forward(args)...) ) ); } } // -------------------------------------------------------------------------------------------- - void operator () (Args &... args) + template void operator () (Uref &&... args) { for (Node * node = m_Nodes.m_Head; node; node = node->m_Next) { - (*node->m_Exec)(node->m_This, std::forward(args)...); + (*node->m_Exec)(node->m_This, std::forward(args)...); } }