diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 2972760d34..14041f3d41 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -127,15 +127,15 @@ void SetIsFramelimiterTempDisabled(bool disable) } std::string GetStateFileName() { return s_state_filename; } -void SetStateFileName(std::string val) { s_state_filename = val; } +void SetStateFileName(const std::string& val) { s_state_filename = val; } // Display messages and return values // Formatted stop message -std::string StopMessage(bool bMainThread, std::string Message) +std::string StopMessage(bool main_thread, const std::string& message) { return StringFromFormat("Stop [%s %i]\t%s\t%s", - bMainThread ? "Main Thread" : "Video Thread", Common::CurrentThreadId(), MemUsage().c_str(), Message.c_str()); + main_thread ? "Main Thread" : "Video Thread", Common::CurrentThreadId(), MemUsage().c_str(), message.c_str()); } void DisplayMessage(const std::string& message, int time_in_ms) diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h index 8fff3efccb..b86168f3f6 100644 --- a/Source/Core/Core/Core.h +++ b/Source/Core/Core/Core.h @@ -40,7 +40,7 @@ enum EState bool Init(); void Stop(); -std::string StopMessage(bool, std::string); +std::string StopMessage(bool, const std::string&); bool IsRunning(); bool IsRunningAndStarted(); // is running and the CPU loop has been entered @@ -59,7 +59,7 @@ void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _ void DisplayMessage(const std::string& message, int time_in_ms); std::string GetStateFileName(); -void SetStateFileName(std::string val); +void SetStateFileName(const std::string& val); void SetBlockStart(u32 addr); diff --git a/Source/Core/Core/CoreParameter.cpp b/Source/Core/Core/CoreParameter.cpp index d8b364893a..5bed7687f7 100644 --- a/Source/Core/Core/CoreParameter.cpp +++ b/Source/Core/Core/CoreParameter.cpp @@ -329,7 +329,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2) return true; } -void SCoreStartupParameter::CheckMemcardPath(std::string& memcardPath, std::string gameRegion, bool isSlotA) +void SCoreStartupParameter::CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion, bool isSlotA) { std::string ext("." + gameRegion + ".raw"); if (memcardPath.empty()) diff --git a/Source/Core/Core/CoreParameter.h b/Source/Core/Core/CoreParameter.h index cb0c81db2e..6c70277c05 100644 --- a/Source/Core/Core/CoreParameter.h +++ b/Source/Core/Core/CoreParameter.h @@ -254,7 +254,7 @@ struct SCoreStartupParameter void LoadDefaults(); bool AutoSetup(EBootBS2 _BootBS2); const std::string &GetUniqueID() const { return m_strUniqueID; } - void CheckMemcardPath(std::string& memcardPath, std::string gameRegion, bool isSlotA); + void CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion, bool isSlotA); DiscIO::IVolume::ELanguage GetCurrentLanguage(bool wii) const; IniFile LoadDefaultGameIni() const; diff --git a/Source/Core/Core/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/HW/EXI_DeviceIPL.cpp index abe415c3b9..1a15b7de2a 100644 --- a/Source/Core/Core/HW/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/HW/EXI_DeviceIPL.cpp @@ -140,7 +140,7 @@ void CEXIIPL::DoState(PointerWrap &p) p.Do(m_FontsLoaded); } -void CEXIIPL::LoadFileToIPL(std::string filename, u32 offset) +void CEXIIPL::LoadFileToIPL(const std::string& filename, u32 offset) { File::IOFile pStream(filename, "rb"); if (pStream) diff --git a/Source/Core/Core/HW/EXI_DeviceIPL.h b/Source/Core/Core/HW/EXI_DeviceIPL.h index 49186ab2f7..b7b80b3a69 100644 --- a/Source/Core/Core/HW/EXI_DeviceIPL.h +++ b/Source/Core/Core/HW/EXI_DeviceIPL.h @@ -68,5 +68,5 @@ private: bool IsWriteCommand() const { return !!(m_uAddress & (1 << 31)); } u32 CommandRegion() const { return (m_uAddress & ~(1 << 31)) >> 8; } - void LoadFileToIPL(std::string filename, u32 offset); + void LoadFileToIPL(const std::string& filename, u32 offset); }; diff --git a/Source/Core/Core/HW/GCMemcardRaw.cpp b/Source/Core/Core/HW/GCMemcardRaw.cpp index df2dc68d54..a5dd50e03f 100644 --- a/Source/Core/Core/HW/GCMemcardRaw.cpp +++ b/Source/Core/Core/HW/GCMemcardRaw.cpp @@ -15,7 +15,7 @@ #define SIZE_TO_Mb (1024 * 8 * 16) #define MC_HDR_SIZE 0xA000 -MemoryCard::MemoryCard(std::string filename, int _card_index, u16 sizeMb) +MemoryCard::MemoryCard(const std::string& filename, int _card_index, u16 sizeMb) : MemoryCardBase(_card_index, sizeMb) , m_filename(filename) { diff --git a/Source/Core/Core/HW/GCMemcardRaw.h b/Source/Core/Core/HW/GCMemcardRaw.h index b337eed440..3fb90a8602 100644 --- a/Source/Core/Core/HW/GCMemcardRaw.h +++ b/Source/Core/Core/HW/GCMemcardRaw.h @@ -17,7 +17,7 @@ class PointerWrap; class MemoryCard : public MemoryCardBase { public: - MemoryCard(std::string filename, int _card_index, u16 sizeMb = MemCard2043Mb); + MemoryCard(const std::string& filename, int _card_index, u16 sizeMb = MemCard2043Mb); ~MemoryCard(); void FlushThread(); void MakeDirty(); diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/IPC_HLE/WII_Socket.cpp index ca8f457738..928e59fff1 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.cpp +++ b/Source/Core/Core/IPC_HLE/WII_Socket.cpp @@ -77,7 +77,7 @@ static s32 TranslateErrorCode(s32 native_error, bool isRW) } } -s32 WiiSockMan::GetNetErrorCode(s32 ret, std::string caller, bool isRW) +s32 WiiSockMan::GetNetErrorCode(s32 ret, const std::string& caller, bool isRW) { #ifdef _WIN32 s32 errorCode = WSAGetLastError(); diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.h b/Source/Core/Core/IPC_HLE/WII_Socket.h index 74084044db..a38d1bb60d 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.h +++ b/Source/Core/Core/IPC_HLE/WII_Socket.h @@ -199,7 +199,7 @@ public: class WiiSockMan : public ::NonCopyable { public: - static s32 GetNetErrorCode(s32 ret, std::string caller, bool isRW); + static s32 GetNetErrorCode(s32 ret, const std::string& caller, bool isRW); static char* DecodeError(s32 ErrorCode); static WiiSockMan& GetInstance() diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index a32b90f477..3177dd193e 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -57,7 +57,7 @@ NetPlayClient::~NetPlayClient() } // called from ---GUI--- thread -NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog, const std::string& name, bool traversal, std::string centralServer, u16 centralPort) +NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog, const std::string& name, bool traversal, const std::string& centralServer, u16 centralPort) : m_state(Failure) , m_dialog(dialog) , m_client(nullptr) diff --git a/Source/Core/Core/NetPlayClient.h b/Source/Core/Core/NetPlayClient.h index 1aa3d2c221..7d3bbf7d73 100644 --- a/Source/Core/Core/NetPlayClient.h +++ b/Source/Core/Core/NetPlayClient.h @@ -49,7 +49,7 @@ public: void ThreadFunc(); void SendAsync(sf::Packet* packet); - NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog, const std::string& name, bool traversal, std::string centralServer, u16 centralPort); + NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog, const std::string& name, bool traversal, const std::string& centralServer, u16 centralPort); ~NetPlayClient(); void GetPlayerList(std::string& list, std::vector& pid_list); diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 7cce306074..f53793f3be 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -52,7 +52,7 @@ NetPlayServer::~NetPlayServer() } // called from ---GUI--- thread -NetPlayServer::NetPlayServer(const u16 port, bool traversal, std::string centralServer, u16 centralPort) +NetPlayServer::NetPlayServer(const u16 port, bool traversal, const std::string& centralServer, u16 centralPort) : is_connected(false) , m_is_running(false) , m_do_loop(false) @@ -717,7 +717,7 @@ std::unordered_set NetPlayServer::GetInterfaceSet() } // called from ---GUI--- thread -std::string NetPlayServer::GetInterfaceHost(const std::string inter) +std::string NetPlayServer::GetInterfaceHost(const std::string& inter) { char buf[16]; sprintf(buf, ":%d", GetPort()); diff --git a/Source/Core/Core/NetPlayServer.h b/Source/Core/Core/NetPlayServer.h index e172e012bd..73f8d6d85e 100644 --- a/Source/Core/Core/NetPlayServer.h +++ b/Source/Core/Core/NetPlayServer.h @@ -23,7 +23,7 @@ public: void ThreadFunc(); void SendAsyncToClients(sf::Packet* packet); - NetPlayServer(const u16 port, bool traversal, std::string centralServer, u16 centralPort); + NetPlayServer(const u16 port, bool traversal, const std::string& centralServer, u16 centralPort); ~NetPlayServer(); bool ChangeGame(const std::string& game); @@ -47,7 +47,7 @@ public: void SetNetPlayUI(NetPlayUI* dialog); std::unordered_set GetInterfaceSet(); - std::string GetInterfaceHost(const std::string inter); + std::string GetInterfaceHost(const std::string& inter); bool is_connected; diff --git a/Source/Core/DiscIO/NANDContentLoader.cpp b/Source/Core/DiscIO/NANDContentLoader.cpp index 715ac6e878..8c123da379 100644 --- a/Source/Core/DiscIO/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/NANDContentLoader.cpp @@ -439,7 +439,7 @@ void cUIDsys::GetTitleIDs(std::vector& _TitleIDs, bool _owned) } } -u64 CNANDContentManager::Install_WiiWAD(std::string &fileName) +u64 CNANDContentManager::Install_WiiWAD(const std::string& fileName) { if (fileName.find(".wad") == std::string::npos) return 0; diff --git a/Source/Core/DiscIO/NANDContentLoader.h b/Source/Core/DiscIO/NANDContentLoader.h index bb380e6dc6..8b309b13f5 100644 --- a/Source/Core/DiscIO/NANDContentLoader.h +++ b/Source/Core/DiscIO/NANDContentLoader.h @@ -69,7 +69,7 @@ class CNANDContentManager { public: static CNANDContentManager& Access() { static CNANDContentManager instance; return instance; } - u64 Install_WiiWAD(std::string &fileName); + u64 Install_WiiWAD(const std::string& fileName); const INANDContentLoader& GetNANDLoader(const std::string& _rName, bool forceReload = false); const INANDContentLoader& GetNANDLoader(u64 _titleId, bool forceReload = false); diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp index abe3043aa1..9837ea74cb 100644 --- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp @@ -92,7 +92,7 @@ public: std::string expr; std::string::iterator it; - Lexer(std::string expr_) : expr(expr_) + Lexer(const std::string& expr_) : expr(expr_) { it = expr.begin(); } @@ -568,7 +568,7 @@ Expression::~Expression() delete node; } -static ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finder, Expression **expr_out) +static ExpressionParseStatus ParseExpressionInner(const std::string& str, ControlFinder &finder, Expression **expr_out) { ExpressionParseStatus status; Expression *expr; @@ -592,7 +592,7 @@ static ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder return EXPRESSION_PARSE_SUCCESS; } -ExpressionParseStatus ParseExpression(std::string str, ControlFinder &finder, Expression **expr_out) +ExpressionParseStatus ParseExpression(const std::string& str, ControlFinder &finder, Expression **expr_out) { // Add compatibility with old simple expressions, which are simple // barewords control names. diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.h b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.h index ca33cc2052..9575ff619d 100644 --- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.h +++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.h @@ -63,7 +63,7 @@ enum ExpressionParseStatus EXPRESSION_PARSE_NO_DEVICE, }; -ExpressionParseStatus ParseExpression(std::string expr, ControlFinder &finder, Expression **expr_out); +ExpressionParseStatus ParseExpression(const std::string& expr, ControlFinder &finder, Expression **expr_out); } } diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp index b86aef5c7e..6777bec627 100644 --- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp @@ -1908,7 +1908,7 @@ namespace GLExtensions _GLVersion = 330; // Get all the fun things } - static void* GetFuncAddress(std::string name, void **func) + static void* GetFuncAddress(const std::string& name, void **func) { *func = GLInterface->GetFuncAddress(name); if (*func == nullptr) diff --git a/Source/Core/VideoCommon/PostProcessing.cpp b/Source/Core/VideoCommon/PostProcessing.cpp index 3841bbfd4f..1ee7e142dd 100644 --- a/Source/Core/VideoCommon/PostProcessing.cpp +++ b/Source/Core/VideoCommon/PostProcessing.cpp @@ -293,7 +293,7 @@ void PostProcessingShaderConfiguration::ReloadShader() m_current_shader = ""; } -void PostProcessingShaderConfiguration::SetOptionf(std::string option, int index, float value) +void PostProcessingShaderConfiguration::SetOptionf(const std::string& option, int index, float value) { auto it = m_options.find(option); @@ -302,7 +302,7 @@ void PostProcessingShaderConfiguration::SetOptionf(std::string option, int index m_any_options_dirty = true; } -void PostProcessingShaderConfiguration::SetOptioni(std::string option, int index, s32 value) +void PostProcessingShaderConfiguration::SetOptioni(const std::string& option, int index, s32 value) { auto it = m_options.find(option); @@ -311,7 +311,7 @@ void PostProcessingShaderConfiguration::SetOptioni(std::string option, int index m_any_options_dirty = true; } -void PostProcessingShaderConfiguration::SetOptionb(std::string option, bool value) +void PostProcessingShaderConfiguration::SetOptionb(const std::string& option, bool value) { auto it = m_options.find(option); diff --git a/Source/Core/VideoCommon/PostProcessing.h b/Source/Core/VideoCommon/PostProcessing.h index 237337f2fa..52ebf1b71b 100644 --- a/Source/Core/VideoCommon/PostProcessing.h +++ b/Source/Core/VideoCommon/PostProcessing.h @@ -68,9 +68,9 @@ public: const ConfigurationOption& GetOption(const std::string& option) { return m_options[option]; } // For updating option's values - void SetOptionf(std::string option, int index, float value); - void SetOptioni(std::string option, int index, s32 value); - void SetOptionb(std::string option, bool value); + void SetOptionf(const std::string& option, int index, float value); + void SetOptioni(const std::string& option, int index, s32 value); + void SetOptionb(const std::string& option, bool value); private: bool m_any_options_dirty;