From 5f8c2f6cc500de997d5ba52581570391f2f1cb25 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Wed, 16 Nov 2016 15:10:33 +0200 Subject: [PATCH] Update all existing code to always receive StackStrF as a const reference. --- source/Command.hpp | 16 ++++++++-------- source/Entity/Blip.cpp | 2 +- source/Entity/Blip.hpp | 2 +- source/Entity/Checkpoint.cpp | 2 +- source/Entity/Checkpoint.hpp | 2 +- source/Entity/Keybind.cpp | 2 +- source/Entity/Keybind.hpp | 2 +- source/Entity/Object.cpp | 2 +- source/Entity/Object.hpp | 2 +- source/Entity/Pickup.cpp | 2 +- source/Entity/Pickup.hpp | 2 +- source/Entity/Player.cpp | 10 +++++----- source/Entity/Player.hpp | 10 +++++----- source/Entity/Vehicle.cpp | 2 +- source/Entity/Vehicle.hpp | 2 +- source/Misc/Functions.cpp | 26 +++++++++++++------------- source/Misc/Functions.hpp | 26 +++++++++++++------------- source/Misc/Model.cpp | 2 +- source/Misc/Model.hpp | 2 +- source/Misc/Player.cpp | 4 ++-- source/Misc/Player.hpp | 4 ++-- source/Misc/Signal.cpp | 6 +++--- source/Misc/Signal.hpp | 6 +++--- source/Misc/Vehicle.cpp | 4 ++-- source/Misc/Vehicle.hpp | 4 ++-- source/Misc/Weapon.cpp | 4 ++-- source/Misc/Weapon.hpp | 4 ++-- source/Routine.cpp | 2 +- source/Routine.hpp | 2 +- 29 files changed, 78 insertions(+), 78 deletions(-) diff --git a/source/Command.hpp b/source/Command.hpp index 84c34de1..acab84c1 100644 --- a/source/Command.hpp +++ b/source/Command.hpp @@ -888,7 +888,7 @@ public: /* -------------------------------------------------------------------------------------------- * Run a command under a specific invoker. */ - Int32 Run(Object & invoker, StackStrF & command) + Int32 Run(Object & invoker, const StackStrF & command) { return GetValid()->Run(Guard(m_Controller, invoker), command.mPtr); } @@ -920,7 +920,7 @@ public: /* -------------------------------------------------------------------------------------------- * Locate and retrieve a command listener by name. */ - const Object & FindByName(StackStrF & name) + const Object & FindByName(const StackStrF & name) { // Validate the specified name if (name.mLen <= 0) @@ -1229,7 +1229,7 @@ public: m_ArgSpec[n] = CMDARG_ANY; } // Apply the specified argument rules/specifications - SetSpec(const_cast< StackStrF & >(spec)); // guaranteed the value will not be modified! + SetSpec(spec); // guaranteed the value will not be modified! // Extract the specified argument tags SetArgTags(tags); // Set the specified minimum and maximum allowed arguments @@ -1416,7 +1416,7 @@ public: /* -------------------------------------------------------------------------------------------- * Retrieve the name that triggers this command listener instance. */ - void SetName(StackStrF & name) + void SetName(const StackStrF & name) { // Validate the specified name ValidateName(name.mPtr); @@ -1464,7 +1464,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the argument specification string. */ - void SetSpec(StackStrF & spec) + void SetSpec(const StackStrF & spec) { // Attempt to process the specified string ProcSpec(spec.mPtr); @@ -1543,7 +1543,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the help message associated with this command listener instance. */ - void SetHelp(StackStrF & help) + void SetHelp(const StackStrF & help) { if (help.mLen > 0) { @@ -1566,7 +1566,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the informational message associated with this command listener instance. */ - void SetInfo(StackStrF & info) + void SetInfo(const StackStrF & info) { if (info.mLen > 0) { @@ -1831,7 +1831,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the tag of a certain argument. */ - void SetArgTag(Uint32 arg, StackStrF & name) + void SetArgTag(Uint32 arg, const StackStrF & name) { // Perform a range check on the specified argument index if (arg >= SQMOD_MAX_CMD_ARGS) diff --git a/source/Entity/Blip.cpp b/source/Entity/Blip.cpp index a679145c..d3e56141 100644 --- a/source/Entity/Blip.cpp +++ b/source/Entity/Blip.cpp @@ -64,7 +64,7 @@ void CBlip::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CBlip & CBlip::ApplyTag(StackStrF & tag) +CBlip & CBlip::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Blip.hpp b/source/Entity/Blip.hpp index ac90d1ed..278e276b 100644 --- a/source/Entity/Blip.hpp +++ b/source/Entity/Blip.hpp @@ -124,7 +124,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CBlip & ApplyTag(StackStrF & tag); + CBlip & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Checkpoint.cpp b/source/Entity/Checkpoint.cpp index a9742b18..86b16b8e 100644 --- a/source/Entity/Checkpoint.cpp +++ b/source/Entity/Checkpoint.cpp @@ -77,7 +77,7 @@ void CCheckpoint::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CCheckpoint & CCheckpoint::ApplyTag(StackStrF & tag) +CCheckpoint & CCheckpoint::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Checkpoint.hpp b/source/Entity/Checkpoint.hpp index 9ddfb5be..1aab4591 100644 --- a/source/Entity/Checkpoint.hpp +++ b/source/Entity/Checkpoint.hpp @@ -145,7 +145,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CCheckpoint & ApplyTag(StackStrF & tag); + CCheckpoint & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Keybind.cpp b/source/Entity/Keybind.cpp index 530851c5..29989913 100644 --- a/source/Entity/Keybind.cpp +++ b/source/Entity/Keybind.cpp @@ -64,7 +64,7 @@ void CKeybind::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CKeybind & CKeybind::ApplyTag(StackStrF & tag) +CKeybind & CKeybind::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Keybind.hpp b/source/Entity/Keybind.hpp index 1c612d64..a8143926 100644 --- a/source/Entity/Keybind.hpp +++ b/source/Entity/Keybind.hpp @@ -124,7 +124,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CKeybind & ApplyTag(StackStrF & tag); + CKeybind & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Object.cpp b/source/Entity/Object.cpp index 5a34dd72..333311f2 100644 --- a/source/Entity/Object.cpp +++ b/source/Entity/Object.cpp @@ -77,7 +77,7 @@ void CObject::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CObject & CObject::ApplyTag(StackStrF & tag) +CObject & CObject::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Object.hpp b/source/Entity/Object.hpp index 81ce1c9f..125731bd 100644 --- a/source/Entity/Object.hpp +++ b/source/Entity/Object.hpp @@ -161,7 +161,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CObject & ApplyTag(StackStrF & tag); + CObject & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Pickup.cpp b/source/Entity/Pickup.cpp index 5545cdee..87cb7366 100644 --- a/source/Entity/Pickup.cpp +++ b/source/Entity/Pickup.cpp @@ -69,7 +69,7 @@ void CPickup::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CPickup & CPickup::ApplyTag(StackStrF & tag) +CPickup & CPickup::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Pickup.hpp b/source/Entity/Pickup.hpp index 248a96b4..90f38991 100644 --- a/source/Entity/Pickup.hpp +++ b/source/Entity/Pickup.hpp @@ -143,7 +143,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CPickup & ApplyTag(StackStrF & tag); + CPickup & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Entity/Player.cpp b/source/Entity/Player.cpp index 131d3397..f6057b52 100644 --- a/source/Entity/Player.cpp +++ b/source/Entity/Player.cpp @@ -99,7 +99,7 @@ void CPlayer::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CPlayer & CPlayer::ApplyTag(StackStrF & tag) +CPlayer & CPlayer::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; @@ -331,7 +331,7 @@ CSStr CPlayer::GetName() const } // ------------------------------------------------------------------------------------------------ -void CPlayer::SetName(StackStrF & name) const +void CPlayer::SetName(const StackStrF & name) const { // Validate the managed identifier Validate(); @@ -1469,7 +1469,7 @@ const String & CPlayer::GetMessagePrefix(Uint32 index) const } // ------------------------------------------------------------------------------------------------ -void CPlayer::SetMessagePrefix(Uint32 index, StackStrF & prefix) +void CPlayer::SetMessagePrefix(Uint32 index, const StackStrF & prefix) { // Perform a range check on the specified prefix index if (index >= SQMOD_PLAYER_MSG_PREFIXES) @@ -1646,7 +1646,7 @@ void CPlayer::StreamFloat(SQFloat val) } // ------------------------------------------------------------------------------------------------ -void CPlayer::StreamString(StackStrF & val) +void CPlayer::StreamString(const StackStrF & val) { // Validate the managed identifier Validate(); @@ -1660,7 +1660,7 @@ void CPlayer::StreamString(StackStrF & val) } // ------------------------------------------------------------------------------------------------ -void CPlayer::StreamRawString(StackStrF & val) +void CPlayer::StreamRawString(const StackStrF & val) { // Validate the managed identifier Validate(); diff --git a/source/Entity/Player.hpp b/source/Entity/Player.hpp index 3819d8b1..edf6f0fb 100644 --- a/source/Entity/Player.hpp +++ b/source/Entity/Player.hpp @@ -212,7 +212,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CPlayer & ApplyTag(StackStrF & tag); + CPlayer & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. @@ -302,7 +302,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the nick name of the managed player entity. */ - void SetName(StackStrF & name) const; + void SetName(const StackStrF & name) const; /* -------------------------------------------------------------------------------------------- * Retrieve the current state of the managed player entity. @@ -783,7 +783,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the message prefix at the specified index for the managed player entity. */ - void SetMessagePrefix(Uint32 index, StackStrF & prefix); + void SetMessagePrefix(Uint32 index, const StackStrF & prefix); /* -------------------------------------------------------------------------------------------- * Retrieve the amount of tracked position changes for the managed player entity. @@ -878,12 +878,12 @@ public: /* -------------------------------------------------------------------------------------------- * Write a string to the stream buffer. */ - void StreamString(StackStrF & val); + void StreamString(const StackStrF & val); /* -------------------------------------------------------------------------------------------- * Write a raw string to the stream buffer. */ - void StreamRawString(StackStrF & val); + void StreamRawString(const 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 a4e7a6ab..0873d7ad 100644 --- a/source/Entity/Vehicle.cpp +++ b/source/Entity/Vehicle.cpp @@ -73,7 +73,7 @@ void CVehicle::SetTag(const StackStrF & tag) } // ------------------------------------------------------------------------------------------------ -CVehicle & CVehicle::ApplyTag(StackStrF & tag) +CVehicle & CVehicle::ApplyTag(const StackStrF & tag) { SetTag(tag); return *this; diff --git a/source/Entity/Vehicle.hpp b/source/Entity/Vehicle.hpp index 20bfc6a6..8919271c 100644 --- a/source/Entity/Vehicle.hpp +++ b/source/Entity/Vehicle.hpp @@ -149,7 +149,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag. */ - CVehicle & ApplyTag(StackStrF & tag); + CVehicle & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Retrieve the associated user data. diff --git a/source/Misc/Functions.cpp b/source/Misc/Functions.cpp index 9e19cd3e..c381a682 100644 --- a/source/Misc/Functions.cpp +++ b/source/Misc/Functions.cpp @@ -108,7 +108,7 @@ CSStr GetKeyCodeName(Uint8 keycode) } // ------------------------------------------------------------------------------------------------ -void SetKeyCodeName(Uint8 keycode, StackStrF & name) +void SetKeyCodeName(Uint8 keycode, const StackStrF & name) { CS_Keycode_Names[keycode].assign(name.mPtr); } @@ -162,13 +162,13 @@ Table GetPluginInfo(Int32 plugin_id) } // ------------------------------------------------------------------------------------------------ -Int32 FindPlugin(StackStrF & name) +Int32 FindPlugin(const StackStrF & name) { return _Func->FindPlugin(name.mPtr); } // ------------------------------------------------------------------------------------------------ -void SendPluginCommand(Uint32 identifier, StackStrF & payload) +void SendPluginCommand(Uint32 identifier, const StackStrF & payload) { _Func->SendPluginCommand(identifier, payload.mPtr); } @@ -180,7 +180,7 @@ const ULongInt & GetTime() } // ------------------------------------------------------------------------------------------------ -void SendLogMessage(StackStrF & msg) +void SendLogMessage(const StackStrF & msg) { if (_Func->LogMessage("%s", msg.mPtr) == vcmpErrorTooLargeInput) { @@ -267,7 +267,7 @@ CSStr GetServerName() } // ------------------------------------------------------------------------------------------------ -void SetServerName(StackStrF & name) +void SetServerName(const StackStrF & name) { _Func->SetServerName(name.mPtr); } @@ -285,7 +285,7 @@ CSStr GetServerPassword() } // ------------------------------------------------------------------------------------------------ -void SetServerPassword(StackStrF & passwd) +void SetServerPassword(const StackStrF & passwd) { _Func->SetServerPassword(passwd.mPtr); } @@ -303,13 +303,13 @@ CSStr GetGameModeText() } // ------------------------------------------------------------------------------------------------ -void SetGameModeText(StackStrF & text) +void SetGameModeText(const StackStrF & text) { _Func->SetGameModeText(text.mPtr); } // ------------------------------------------------------------------------------------------------ -void CreateRadioStream(bool listed, const StackStrF & name, StackStrF & url) +void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url) { if (_Func->AddRadioStream(-1, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds) { @@ -318,7 +318,7 @@ void CreateRadioStream(bool listed, const StackStrF & name, StackStrF & url) } // ------------------------------------------------------------------------------------------------ -void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, StackStrF & url) +void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url) { if (_Func->AddRadioStream(id, name.mPtr, url.mPtr, listed) == vcmpErrorArgumentOutOfBounds) { @@ -744,25 +744,25 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z) } // ------------------------------------------------------------------------------------------------ -void BanIP(StackStrF & addr) +void BanIP(const StackStrF & addr) { _Func->BanIP(const_cast< SStr >(addr.mPtr)); } // ------------------------------------------------------------------------------------------------ -bool UnbanIP(StackStrF & addr) +bool UnbanIP(const StackStrF & addr) { return _Func->UnbanIP(const_cast< SStr >(addr.mPtr)); } // ------------------------------------------------------------------------------------------------ -bool IsIPBanned(StackStrF & addr) +bool IsIPBanned(const StackStrF & addr) { return _Func->IsIPBanned(const_cast< SStr >(addr.mPtr)); } // ------------------------------------------------------------------------------------------------ -Int32 GetPlayerIdFromName(StackStrF & name) +Int32 GetPlayerIdFromName(const StackStrF & name) { return _Func->GetPlayerIdFromName(name.mPtr); } diff --git a/source/Misc/Functions.hpp b/source/Misc/Functions.hpp index 7b9466fa..6baf3948 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, StackStrF & name); +void SetKeyCodeName(Uint8 keycode, const 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(StackStrF & name); +Int32 FindPlugin(const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Send a custom command to the loaded plug-ins. */ -void SendPluginCommand(Uint32 identifier, StackStrF & payload); +void SendPluginCommand(Uint32 identifier, const StackStrF & payload); /* ------------------------------------------------------------------------------------------------ * Retrieve the server time. @@ -55,7 +55,7 @@ const ULongInt & GetTime(); /* ------------------------------------------------------------------------------------------------ * Send a log message to the server. */ -void SendLogMessage(StackStrF & msg); +void SendLogMessage(const StackStrF & msg); /* ------------------------------------------------------------------------------------------------ * Retrieve the last error that occurred on the server. @@ -115,7 +115,7 @@ CSStr GetServerName(); /* ------------------------------------------------------------------------------------------------ * Modify the server name. */ -void SetServerName(StackStrF & name); +void SetServerName(const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Retrieve the server password. @@ -125,7 +125,7 @@ CSStr GetServerPassword(); /* ------------------------------------------------------------------------------------------------ * Modify the server password. */ -void SetServerPassword(StackStrF & passwd); +void SetServerPassword(const StackStrF & passwd); /* ------------------------------------------------------------------------------------------------ * Retrieve the game-mode text. @@ -135,17 +135,17 @@ CSStr GetGameModeText(); /* ------------------------------------------------------------------------------------------------ * Modify the game-mode text. */ -void SetGameModeText(StackStrF & text); +void SetGameModeText(const StackStrF & text); /* ------------------------------------------------------------------------------------------------ * Create a radio stream. */ -void CreateRadioStream(bool listed, const StackStrF & name, StackStrF & url); +void CreateRadioStream(bool listed, const StackStrF & name, const StackStrF & url); /* ------------------------------------------------------------------------------------------------ * Create a radio stream. */ -void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, StackStrF & url); +void CreateRadioStreamEx(Int32 id, bool listed, const StackStrF & name, const StackStrF & url); /* ------------------------------------------------------------------------------------------------ * Remove a radio stream. @@ -422,22 +422,22 @@ void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z); /* ------------------------------------------------------------------------------------------------ * Ban an IP address from the server. */ -void BanIP(StackStrF & addr); +void BanIP(const StackStrF & addr); /* ------------------------------------------------------------------------------------------------ * Unban an IP address from the server. */ -bool UnbanIP(StackStrF & addr); +bool UnbanIP(const StackStrF & addr); /* ------------------------------------------------------------------------------------------------ * See if an IP address is banned from the server. */ -bool IsIPBanned(StackStrF & addr); +bool IsIPBanned(const StackStrF & addr); /* ------------------------------------------------------------------------------------------------ * Retrieve the identifier of the player with the specified name. */ -Int32 GetPlayerIdFromName(StackStrF & name); +Int32 GetPlayerIdFromName(const 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 513a999a..3e7c9d52 100644 --- a/source/Misc/Model.cpp +++ b/source/Misc/Model.cpp @@ -16,7 +16,7 @@ CSStr GetModelName(Int32 /*id*/) } // ------------------------------------------------------------------------------------------------ -void SetModelName(Int32 /*id*/, StackStrF & /*name*/) +void SetModelName(Int32 /*id*/, const StackStrF & /*name*/) { // @TODO Implement... } diff --git a/source/Misc/Model.hpp b/source/Misc/Model.hpp index 7d893aab..afcc9bc3 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, StackStrF & name); +void SetModelName(Int32 id, const 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 7ef40788..704d8410 100644 --- a/source/Misc/Player.cpp +++ b/source/Misc/Player.cpp @@ -102,7 +102,7 @@ CCStr GetSkinName(Uint32 id) } // ------------------------------------------------------------------------------------------------ -void SetSkinName(Uint32 id, StackStrF & name) +void SetSkinName(Uint32 id, const StackStrF & name) { if (id <= 159) { @@ -111,7 +111,7 @@ void SetSkinName(Uint32 id, StackStrF & name) } // ------------------------------------------------------------------------------------------------ -Int32 GetSkinID(StackStrF & name) +Int32 GetSkinID(const 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 2b4226aa..fd0a5611 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, StackStrF & name); +void SetSkinName(Uint32 id, const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Convert a vehicle model name to a skin model identifier. */ -Int32 GetSkinID(StackStrF & name); +Int32 GetSkinID(const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the specified skin model identifier is valid. diff --git a/source/Misc/Signal.cpp b/source/Misc/Signal.cpp index 300ca202..0344c316 100644 --- a/source/Misc/Signal.cpp +++ b/source/Misc/Signal.cpp @@ -56,7 +56,7 @@ Object Signal::CreateFree() } // ------------------------------------------------------------------------------------------------ -Object Signal::Create(StackStrF & name) +Object Signal::Create(const StackStrF & name) { // Validate the signal name if (name.mLen <= 0) @@ -92,7 +92,7 @@ Object Signal::Create(StackStrF & name) } // ------------------------------------------------------------------------------------------------ -void Signal::Remove(StackStrF & name) +void Signal::Remove(const StackStrF & name) { // Validate the signal name if (name.mLen <= 0) @@ -126,7 +126,7 @@ void Signal::Remove(StackStrF & name) } // ------------------------------------------------------------------------------------------------ -Object Signal::Fetch(StackStrF & name) +Object Signal::Fetch(const StackStrF & name) { // Validate the signal name if (name.mLen <= 0) diff --git a/source/Misc/Signal.hpp b/source/Misc/Signal.hpp index 1d0dffef..7ab589b5 100644 --- a/source/Misc/Signal.hpp +++ b/source/Misc/Signal.hpp @@ -521,17 +521,17 @@ public: /* -------------------------------------------------------------------------------------------- * Create a new signal with the specified name. */ - static Object Create(StackStrF & name); + static Object Create(const StackStrF & name); /* -------------------------------------------------------------------------------------------- * Remove the signal with the specified name. */ - static void Remove(StackStrF & name); + static void Remove(const StackStrF & name); /* -------------------------------------------------------------------------------------------- * Retrieve the signal with the specified name. */ - static Object Fetch(StackStrF & name); + static Object Fetch(const StackStrF & name); }; } // Namespace:: SqMod diff --git a/source/Misc/Vehicle.cpp b/source/Misc/Vehicle.cpp index c111ac81..e7df84ff 100644 --- a/source/Misc/Vehicle.cpp +++ b/source/Misc/Vehicle.cpp @@ -74,7 +74,7 @@ CSStr GetAutomobileName(Uint32 id) } // ------------------------------------------------------------------------------------------------ -void SetAutomobileName(Uint32 id, StackStrF & name) +void SetAutomobileName(Uint32 id, const StackStrF & name) { if (id >= 130 || id <= 236) { @@ -83,7 +83,7 @@ void SetAutomobileName(Uint32 id, StackStrF & name) } // ------------------------------------------------------------------------------------------------ -Int32 GetAutomobileID(StackStrF & name) +Int32 GetAutomobileID(const 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 09d3ea0a..950f2405 100644 --- a/source/Misc/Vehicle.hpp +++ b/source/Misc/Vehicle.hpp @@ -15,12 +15,12 @@ CSStr GetAutomobileName(Uint32 id); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a vehicle model identifier. */ -void SetAutomobileName(Uint32 id, StackStrF & name); +void SetAutomobileName(Uint32 id, const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Convert a vehicle model name to a vehicle model identifier. */ -Int32 GetAutomobileID(StackStrF & name); +Int32 GetAutomobileID(const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the specified vehicle model identifier is valid. diff --git a/source/Misc/Weapon.cpp b/source/Misc/Weapon.cpp index 9694b875..cb153837 100644 --- a/source/Misc/Weapon.cpp +++ b/source/Misc/Weapon.cpp @@ -56,7 +56,7 @@ CCStr GetWeaponName(Uint32 id) } // ------------------------------------------------------------------------------------------------ -void SetWeaponName(Uint32 id, StackStrF & name) +void SetWeaponName(Uint32 id, const StackStrF & name) { if (id <= 70) { @@ -65,7 +65,7 @@ void SetWeaponName(Uint32 id, StackStrF & name) } // ------------------------------------------------------------------------------------------------ -Int32 GetWeaponID(StackStrF & name) +Int32 GetWeaponID(const 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 754e22f8..a1be3d87 100644 --- a/source/Misc/Weapon.hpp +++ b/source/Misc/Weapon.hpp @@ -15,12 +15,12 @@ CSStr GetWeaponName(Uint32 id); /* ------------------------------------------------------------------------------------------------ * Modify the name associated with a weapon identifier. */ -void SetWeaponName(Uint32 id, StackStrF & name); +void SetWeaponName(Uint32 id, const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * Convert a weapon name to a weapon identifier. */ -Int32 GetWeaponID(StackStrF & name); +Int32 GetWeaponID(const StackStrF & name); /* ------------------------------------------------------------------------------------------------ * See whether the specified weapon identifier is valid. diff --git a/source/Routine.cpp b/source/Routine.cpp index 6a35244f..d872721d 100644 --- a/source/Routine.cpp +++ b/source/Routine.cpp @@ -635,7 +635,7 @@ void Routine::SetData(Object & data) } // ------------------------------------------------------------------------------------------------ -Routine & Routine::ApplyTag(StackStrF & tag) +Routine & Routine::ApplyTag(const StackStrF & tag) { if (tag.mLen) { diff --git a/source/Routine.hpp b/source/Routine.hpp index f27660c0..9df38b3d 100644 --- a/source/Routine.hpp +++ b/source/Routine.hpp @@ -332,7 +332,7 @@ public: /* -------------------------------------------------------------------------------------------- * Modify the associated user tag and allow chaining of operations. */ - Routine & ApplyTag(StackStrF & tag); + Routine & ApplyTag(const StackStrF & tag); /* -------------------------------------------------------------------------------------------- * Modify the associated user data and allow chaining of operations.