diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2024-01-21 19:34:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 20:34:19 +0100 |
commit | 7f84bdf8fd5c93286f000bc5f9314eab81128cee (patch) | |
tree | d97974691eb50b7cd8a2bf8a7cbc342fdc7bdd44 /primedev | |
parent | e72f0cbbac6ffcbfbf0c52f14a2a3cb7c18ba8fc (diff) | |
download | NorthstarLauncher-7f84bdf8fd5c93286f000bc5f9314eab81128cee.tar.gz NorthstarLauncher-7f84bdf8fd5c93286f000bc5f9314eab81128cee.zip |
Address C4267 compiler warnings (#647)v1.22.2-rc1
Implicit conversion from `size_t` to a smaller type
Diffstat (limited to 'primedev')
24 files changed, 57 insertions, 57 deletions
diff --git a/primedev/client/audio.cpp b/primedev/client/audio.cpp index aa32e390..099fdcee 100644 --- a/primedev/client/audio.cpp +++ b/primedev/client/audio.cpp @@ -445,7 +445,7 @@ bool, __fastcall, (void* sample, void* audioBuffer, unsigned int audioBufferLeng else { data = dat->second.get(); - dataLength = dat->first; + dataLength = (unsigned int)dat->first; } } diff --git a/primedev/config/profile.cpp b/primedev/config/profile.cpp index d5361efa..f1d3f81c 100644 --- a/primedev/config/profile.cpp +++ b/primedev/config/profile.cpp @@ -15,15 +15,15 @@ void InitialiseNorthstarPrefix() std::string cla = std::string(clachar); if (strncmp(cla.substr(9, 1).c_str(), "\"", 1)) { - int space = cla.find(" "); + size_t space = cla.find(" "); std::string dirname = cla.substr(9, space - 9); NORTHSTAR_FOLDER_PREFIX = dirname; } else { std::string quote = "\""; - int quote1 = cla.find(quote); - int quote2 = (cla.substr(quote1 + 1)).find(quote); + size_t quote1 = cla.find(quote); + size_t quote2 = (cla.substr(quote1 + 1)).find(quote); std::string dirname = cla.substr(quote1 + 1, quote2); NORTHSTAR_FOLDER_PREFIX = dirname; } diff --git a/primedev/core/convar/convar.cpp b/primedev/core/convar/convar.cpp index e77ae1fd..94e41fee 100644 --- a/primedev/core/convar/convar.cpp +++ b/primedev/core/convar/convar.cpp @@ -382,7 +382,7 @@ void ConVar::ChangeStringValue(const char* pszTempVal, float flOldValue) if (pszTempVal) { - int len = strlen(pszTempVal) + 1; + size_t len = strlen(pszTempVal) + 1; if (len > m_Value.m_iStringLength) { diff --git a/primedev/core/hooks.cpp b/primedev/core/hooks.cpp index 26b3fe57..7ea435fe 100644 --- a/primedev/core/hooks.cpp +++ b/primedev/core/hooks.cpp @@ -77,7 +77,7 @@ void __fileAutohook::Dispatch() void __fileAutohook::DispatchForModule(const char* pModuleName) { - const int iModuleNameLen = strlen(pModuleName); + const size_t iModuleNameLen = strlen(pModuleName); for (__autohook* hook : hooks) if ((hook->iAddressResolutionMode == __autohook::OFFSET_STRING && !strncmp(pModuleName, hook->pAddrString, iModuleNameLen)) || @@ -87,14 +87,14 @@ void __fileAutohook::DispatchForModule(const char* pModuleName) ManualHook::ManualHook(const char* funcName, LPVOID func) : pHookFunc(func), ppOrigFunc(nullptr) { - const int iFuncNameStrlen = strlen(funcName); + const size_t iFuncNameStrlen = strlen(funcName); pFuncName = new char[iFuncNameStrlen]; memcpy(pFuncName, funcName, iFuncNameStrlen); } ManualHook::ManualHook(const char* funcName, LPVOID* orig, LPVOID func) : pHookFunc(func), ppOrigFunc(orig) { - const int iFuncNameStrlen = strlen(funcName); + const size_t iFuncNameStrlen = strlen(funcName); pFuncName = new char[iFuncNameStrlen]; memcpy(pFuncName, funcName, iFuncNameStrlen); } @@ -141,7 +141,7 @@ uintptr_t ParseDLLOffsetString(const char* pAddrString) uintptr_t iOffset = 0; int iOffsetBegin = iDllNameEnd; - int iOffsetEnd = strlen(pAddrString); + size_t iOffsetEnd = strlen(pAddrString); // seek until we hit the start of the number offset for (; !(pAddrString[iOffsetBegin] >= '0' && pAddrString[iOffsetBegin] <= '9') && pAddrString[iOffsetBegin]; iOffsetBegin++) diff --git a/primedev/core/hooks.h b/primedev/core/hooks.h index 15edbf0b..7c1b001c 100644 --- a/primedev/core/hooks.h +++ b/primedev/core/hooks.h @@ -119,7 +119,7 @@ public: { iAddressResolutionMode = ABSOLUTE_ADDR; - const int iFuncNameStrlen = strlen(funcName) + 1; + const size_t iFuncNameStrlen = strlen(funcName) + 1; pFuncName = new char[iFuncNameStrlen]; memcpy(pFuncName, funcName, iFuncNameStrlen); @@ -131,11 +131,11 @@ public: { iAddressResolutionMode = OFFSET_STRING; - const int iFuncNameStrlen = strlen(funcName) + 1; + const size_t iFuncNameStrlen = strlen(funcName) + 1; pFuncName = new char[iFuncNameStrlen]; memcpy(pFuncName, funcName, iFuncNameStrlen); - const int iAddrStrlen = strlen(addrString) + 1; + const size_t iAddrStrlen = strlen(addrString) + 1; pAddrString = new char[iAddrStrlen]; memcpy(pAddrString, addrString, iAddrStrlen); @@ -147,15 +147,15 @@ public: { iAddressResolutionMode = PROCADDRESS; - const int iFuncNameStrlen = strlen(funcName) + 1; + const size_t iFuncNameStrlen = strlen(funcName) + 1; pFuncName = new char[iFuncNameStrlen]; memcpy(pFuncName, funcName, iFuncNameStrlen); - const int iModuleNameStrlen = strlen(moduleName) + 1; + const size_t iModuleNameStrlen = strlen(moduleName) + 1; pModuleName = new char[iModuleNameStrlen]; memcpy(pModuleName, moduleName, iModuleNameStrlen); - const int iProcNameStrlen = strlen(procName) + 1; + const size_t iProcNameStrlen = strlen(procName) + 1; pProcName = new char[iProcNameStrlen]; memcpy(pProcName, procName, iProcNameStrlen); @@ -293,7 +293,7 @@ public: { m_pTarget = pTarget; - const int iAddrStrlen = strlen(pAddrString) + 1; + const size_t iAddrStrlen = strlen(pAddrString) + 1; m_pAddrString = new char[iAddrStrlen]; memcpy(m_pAddrString, pAddrString, iAddrStrlen); diff --git a/primedev/core/math/bitbuf.h b/primedev/core/math/bitbuf.h index 5ca75455..a06dab17 100644 --- a/primedev/core/math/bitbuf.h +++ b/primedev/core/math/bitbuf.h @@ -630,7 +630,7 @@ public: // at the head to make reading and detecting the end efficient. int nHead = m_DataBytes & 3; - int posBytes = startPos / 8; + size_t posBytes = startPos / 8; if ((m_DataBytes < 4) || (nHead && (posBytes < nHead))) { // partial first dword @@ -652,7 +652,7 @@ public: } else { - int adjustedPos = startPos - (nHead << 3); + size_t adjustedPos = startPos - (nHead << 3); m_DataIn = reinterpret_cast<u32 const*>(reinterpret_cast<u8 const*>(m_Data) + ((adjustedPos / 32) << 2) + nHead); diff --git a/primedev/core/memory.cpp b/primedev/core/memory.cpp index 3770586f..41110aee 100644 --- a/primedev/core/memory.cpp +++ b/primedev/core/memory.cpp @@ -103,7 +103,7 @@ inline std::vector<uint8_t> HexBytesToString(const char* pHexString) { std::vector<uint8_t> ret; - int size = strlen(pHexString); + size_t size = strlen(pHexString); for (int i = 0; i < size; i++) { // If this is a space character, ignore it @@ -289,7 +289,7 @@ inline std::pair<std::vector<uint8_t>, std::string> MaskedBytesFromPattern(const std::vector<uint8_t> vRet; std::string sMask; - int size = strlen(pPatternString); + size_t size = strlen(pPatternString); for (int i = 0; i < size; i++) { // If this is a space character, ignore it diff --git a/primedev/logging/logging.cpp b/primedev/logging/logging.cpp index 3416bb8c..ef9a6737 100644 --- a/primedev/logging/logging.cpp +++ b/primedev/logging/logging.cpp @@ -95,18 +95,18 @@ void ExternalConsoleSink::custom_sink_it_(const custom_log_msg& msg) std::string name {msg.logger_name.begin(), msg.logger_name.end()}; std::string name_str = "[NAME]"; - int name_pos = str.find(name_str); + size_t name_pos = str.find(name_str); str.replace(name_pos, name_str.length(), msg.origin->ANSIColor + "[" + name + "]" + default_color); std::string level_str = "[LVL]"; - int level_pos = str.find(level_str); + size_t level_pos = str.find(level_str); str.replace(level_pos, level_str.length(), levelColor + "[" + std::string(level_names[msg.level]) + "]" + default_color); out += str; } // print the string to the console - this is definitely bad i think HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); - auto ignored = WriteConsoleA(handle, out.c_str(), std::strlen(out.c_str()), nullptr, nullptr); + auto ignored = WriteConsoleA(handle, out.c_str(), (DWORD)std::strlen(out.c_str()), nullptr, nullptr); (void)ignored; } diff --git a/primedev/masterserver/masterserver.cpp b/primedev/masterserver/masterserver.cpp index d7e48324..a2d9f00e 100644 --- a/primedev/masterserver/masterserver.cpp +++ b/primedev/masterserver/masterserver.cpp @@ -635,7 +635,7 @@ void MasterServerManager::AuthenticateWithServer(const char* uid, const char* pl curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); { - char* escapedPassword = curl_easy_escape(curl, passwordStr.c_str(), passwordStr.length()); + char* escapedPassword = curl_easy_escape(curl, passwordStr.c_str(), (int)passwordStr.length()); curl_easy_setopt( curl, @@ -924,7 +924,7 @@ void MasterServerManager::ProcessConnectionlessPacketSigreq1(std::string data) CURL* curl = curl_easy_init(); SetCommonHttpClientOptions(curl); - char* rejectEnc = curl_easy_escape(curl, reject.c_str(), reject.length()); + char* rejectEnc = curl_easy_escape(curl, reject.c_str(), (int)reject.length()); if (!rejectEnc) { spdlog::error("failed to handle Atlas connect request {}: failed to escape reject", token); diff --git a/primedev/mods/autodownload/moddownloader.cpp b/primedev/mods/autodownload/moddownloader.cpp index 1e3c6af6..960f435a 100644 --- a/primedev/mods/autodownload/moddownloader.cpp +++ b/primedev/mods/autodownload/moddownloader.cpp @@ -23,18 +23,18 @@ ModDownloader::ModDownloader() if (clachar) { std::string url; - int iFlagStringLength = strlen(CUSTOM_MODS_URL_FLAG); + size_t iFlagStringLength = strlen(CUSTOM_MODS_URL_FLAG); std::string cla = std::string(clachar); if (strncmp(cla.substr(iFlagStringLength, 1).c_str(), "\"", 1)) { - int space = cla.find(" "); + size_t space = cla.find(" "); url = cla.substr(iFlagStringLength, space - iFlagStringLength); } else { std::string quote = "\""; - int quote1 = cla.find(quote); - int quote2 = (cla.substr(quote1 + 1)).find(quote); + size_t quote1 = cla.find(quote); + size_t quote2 = (cla.substr(quote1 + 1)).find(quote); url = cla.substr(quote1 + 1, quote2); } spdlog::info("Found custom verified mods URL in command line argument: {}", url); diff --git a/primedev/plugins/plugins.cpp b/primedev/plugins/plugins.cpp index 72b64566..311285e1 100644 --- a/primedev/plugins/plugins.cpp +++ b/primedev/plugins/plugins.cpp @@ -188,7 +188,7 @@ std::optional<Plugin> PluginManager::LoadPlugin(fs::path path, PluginInitFuncs* plugin.run_frame = (PLUGIN_RUNFRAME)GetProcAddress(pluginLib, "PLUGIN_RUNFRAME"); - plugin.handle = m_vLoadedPlugins.size(); + plugin.handle = (int)m_vLoadedPlugins.size(); plugin.logger = std::make_shared<ColoredLogger>(plugin.displayName.c_str(), NS::Colors::PLUGIN); RegisterLogger(plugin.logger); NS::log::PLUGINSYS->info("Loading plugin {} version {}", plugin.displayName, plugin.version); diff --git a/primedev/primelauncher/main.cpp b/primedev/primelauncher/main.cpp index ae745672..96c96c04 100644 --- a/primedev/primelauncher/main.cpp +++ b/primedev/primelauncher/main.cpp @@ -281,7 +281,7 @@ bool LoadNorthstar() std::string cla = std::string(clachar); if (strncmp(cla.substr(9, 1).c_str(), "\"", 1)) { - int space = cla.find(" "); + size_t space = cla.find(" "); std::string dirname = cla.substr(9, space - 9); std::cout << "[*] Found profile in command line arguments: " << dirname << std::endl; strProfile = dirname.c_str(); @@ -289,8 +289,8 @@ bool LoadNorthstar() else { std::string quote = "\""; - int quote1 = cla.find(quote); - int quote2 = (cla.substr(quote1 + 1)).find(quote); + size_t quote1 = cla.find(quote); + size_t quote2 = (cla.substr(quote1 + 1)).find(quote); std::string dirname = cla.substr(quote1 + 1, quote2); std::cout << "[*] Found profile in command line arguments: " << dirname << std::endl; strProfile = dirname; diff --git a/primedev/scripts/client/scriptserverbrowser.cpp b/primedev/scripts/client/scriptserverbrowser.cpp index a142c3f4..21324535 100644 --- a/primedev/scripts/client/scriptserverbrowser.cpp +++ b/primedev/scripts/client/scriptserverbrowser.cpp @@ -26,7 +26,7 @@ ADD_SQFUNC("bool", NSMasterServerConnectionSuccessful, "", "", ScriptContext::UI ADD_SQFUNC("int", NSGetServerCount, "", "", ScriptContext::UI) { - g_pSquirrel<context>->pushinteger(sqvm, g_pMasterServerManager->m_vRemoteServers.size()); + g_pSquirrel<context>->pushinteger(sqvm, (SQInteger)g_pMasterServerManager->m_vRemoteServers.size()); return SQRESULT_NOTNULL; } @@ -146,7 +146,7 @@ ADD_SQFUNC("array<ServerInfo>", NSGetGameServers, "", "", ScriptContext::UI) g_pSquirrel<context>->pushnewstructinstance(sqvm, 11); // index - g_pSquirrel<context>->pushinteger(sqvm, i); + g_pSquirrel<context>->pushinteger(sqvm, (SQInteger)i); g_pSquirrel<context>->sealstructslot(sqvm, 0); // id diff --git a/primedev/scripts/scriptdatatables.cpp b/primedev/scripts/scriptdatatables.cpp index 87a26dca..865b6243 100644 --- a/primedev/scripts/scriptdatatables.cpp +++ b/primedev/scripts/scriptdatatables.cpp @@ -308,7 +308,7 @@ REPLACE_SQFUNC(GetDataTableRowCount, (ScriptContext::UI | ScriptContext::CLIENT return g_pSquirrel<context>->m_funcOriginals["GetDatatableRowCount"](sqvm); CSVData* csv = *pData; - g_pSquirrel<context>->pushinteger(sqvm, csv->dataPointers.size()); + g_pSquirrel<context>->pushinteger(sqvm, (SQInteger)csv->dataPointers.size()); return SQRESULT_NOTNULL; } diff --git a/primedev/scripts/scripthttprequesthandler.cpp b/primedev/scripts/scripthttprequesthandler.cpp index aa75127a..69828a5a 100644 --- a/primedev/scripts/scripthttprequesthandler.cpp +++ b/primedev/scripts/scripthttprequesthandler.cpp @@ -320,11 +320,11 @@ template <ScriptContext context> int HttpRequestHandler::MakeHttpRequest(const H bool isFirstValue = true; for (const auto& kv : requestParameters.queryParameters) { - char* key = curl_easy_escape(curl, kv.first.c_str(), kv.first.length()); + char* key = curl_easy_escape(curl, kv.first.c_str(), (int)kv.first.length()); for (const std::string& queryValue : kv.second) { - char* value = curl_easy_escape(curl, queryValue.c_str(), queryValue.length()); + char* value = curl_easy_escape(curl, queryValue.c_str(), (int)queryValue.length()); if (isFirstValue && !bUrlContainsQuery) { diff --git a/primedev/server/auth/bansystem.cpp b/primedev/server/auth/bansystem.cpp index 6e4d1644..59bb6067 100644 --- a/primedev/server/auth/bansystem.cpp +++ b/primedev/server/auth/bansystem.cpp @@ -222,8 +222,8 @@ int ConCommand_banCompletion(const char* const partial, char commands[COMMAND_CO const char* cmdName = partial; const char* query = partial + (space == nullptr ? 0 : space - partial) + 1; - const int queryLength = strlen(query); - const int cmdLength = strlen(cmdName) - queryLength; + const size_t queryLength = strlen(query); + const size_t cmdLength = strlen(cmdName) - queryLength; int numCompletions = 0; for (int i = 0; i < GetMaxPlayers() && numCompletions < COMMAND_COMPLETION_MAXITEMS - 2; i++) diff --git a/primedev/server/auth/serverauthentication.cpp b/primedev/server/auth/serverauthentication.cpp index 0d46426f..7d656820 100644 --- a/primedev/server/auth/serverauthentication.cpp +++ b/primedev/server/auth/serverauthentication.cpp @@ -291,7 +291,7 @@ void,, (CBaseClient* self)) { g_pServerAuthentication->m_bForceResetLocalPlayerPersistence = false; g_pServerAuthentication->WritePersistentData(self); - g_pServerPresence->SetPlayerCount(g_pServerAuthentication->m_PlayerAuthenticationData.size()); + g_pServerPresence->SetPlayerCount((int)g_pServerAuthentication->m_PlayerAuthenticationData.size()); } CBaseClient__ActivatePlayer(self); @@ -326,7 +326,7 @@ void,, (CBaseClient* self, uint32_t unknownButAlways1, const char* pReason, ...) g_pServerLimits->RemovePlayer(self); } - g_pServerPresence->SetPlayerCount(g_pServerAuthentication->m_PlayerAuthenticationData.size()); + g_pServerPresence->SetPlayerCount((int)g_pServerAuthentication->m_PlayerAuthenticationData.size()); _CBaseClient__Disconnect(self, unknownButAlways1, buf); } diff --git a/primedev/shared/exploit_fixes/exploitfixes.cpp b/primedev/shared/exploit_fixes/exploitfixes.cpp index 8064d5ac..44651b3c 100644 --- a/primedev/shared/exploit_fixes/exploitfixes.cpp +++ b/primedev/shared/exploit_fixes/exploitfixes.cpp @@ -262,7 +262,7 @@ bool, __fastcall, (const char* pModName)) // 48 83 EC 28 48 8B 0D ? ? ? ? 48 8D // clang-format on { // somewhat temp, store the modname here, since we don't have a proper ptr in engine to it rn - int iSize = strlen(pModName); + size_t iSize = strlen(pModName); g_pModName = new char[iSize + 1]; strcpy(g_pModName, pModName); @@ -323,7 +323,7 @@ bool, __fastcall, (CBaseClient* self, uint32_t unknown, const char* pCommandStri "load_recent_checkpoint" // This is the instant-respawn exploit, literally just calls RespawnPlayer() }; - int iCmdLength = strlen(tempCommand.Arg(0)); + size_t iCmdLength = strlen(tempCommand.Arg(0)); bool bIsBadCommand = false; for (auto& blockedCommand : blockedCommands) diff --git a/primedev/shared/misccommands.cpp b/primedev/shared/misccommands.cpp index 15da6767..648525b9 100644 --- a/primedev/shared/misccommands.cpp +++ b/primedev/shared/misccommands.cpp @@ -60,7 +60,7 @@ void ConCommand_cvar_setdefaultvalue(const CCommand& arg) } // unfortunately no way for us to not leak memory here, as default value might not be in writeable memory by default - int nLen = strlen(arg.Arg(2)); + size_t nLen = strlen(arg.Arg(2)); char* pBuf = new char[nLen + 1]; strncpy_s(pBuf, nLen + 1, arg.Arg(2), nLen); @@ -83,7 +83,7 @@ void ConCommand_cvar_setvalueanddefaultvalue(const CCommand& arg) } // unfortunately no way for us to not leak memory here, as default value might not be in writeable memory by default - int nLen = strlen(arg.Arg(2)); + size_t nLen = strlen(arg.Arg(2)); char* pBuf = new char[nLen + 1]; strncpy_s(pBuf, nLen + 1, arg.Arg(2), nLen); diff --git a/primedev/squirrel/squirrel.cpp b/primedev/squirrel/squirrel.cpp index 43e43398..affedebb 100644 --- a/primedev/squirrel/squirrel.cpp +++ b/primedev/squirrel/squirrel.cpp @@ -659,7 +659,7 @@ template <ScriptContext context> void SquirrelManager<context>::ProcessMessageBu pushobject(m_pSQVM->sqvm, &functionobj); // Push the function object pushroottable(m_pSQVM->sqvm); - int argsAmount = message.args.size(); + size_t argsAmount = message.args.size(); if (message.isExternal && message.externalFunc != NULL) { @@ -674,7 +674,7 @@ template <ScriptContext context> void SquirrelManager<context>::ProcessMessageBu } } - _call(m_pSQVM->sqvm, argsAmount); + _call(m_pSQVM->sqvm, (SQInteger)argsAmount); } } diff --git a/primedev/squirrel/squirrel.h b/primedev/squirrel/squirrel.h index a4932044..17f4186d 100644 --- a/primedev/squirrel/squirrel.h +++ b/primedev/squirrel/squirrel.h @@ -399,7 +399,7 @@ public: v(); } - return _call(m_pSQVM->sqvm, functionVector.size()); + return _call(m_pSQVM->sqvm, (SQInteger)functionVector.size()); } #pragma endregion @@ -470,7 +470,7 @@ template <ScriptContext context, typename T> requires (std::convertible_to<T, std::string> || std::is_constructible_v<std::string, T>) inline VoidFunction SQMessageBufferPushArg(T& arg) { auto converted = std::string(arg); - return [converted]{ g_pSquirrel<context>->pushstring(g_pSquirrel<context>->m_pSQVM->sqvm, converted.c_str(), converted.length()); }; + return [converted]{ g_pSquirrel<context>->pushstring(g_pSquirrel<context>->m_pSQVM->sqvm, converted.c_str(), (int)converted.length()); }; } // Assets template <ScriptContext context> diff --git a/primedev/util/printcommands.cpp b/primedev/util/printcommands.cpp index 34d56666..20ebfffc 100644 --- a/primedev/util/printcommands.cpp +++ b/primedev/util/printcommands.cpp @@ -52,12 +52,12 @@ void PrintCommandHelpDialogue(const ConCommandBase* command, const char* name) void TryPrintCvarHelpForCommand(const char* pCommand) { // try to display help text for an inputted command string from the console - int pCommandLen = strlen(pCommand); + size_t pCommandLen = strlen(pCommand); char* pCvarStr = new char[pCommandLen]; strcpy(pCvarStr, pCommand); // trim whitespace from right - for (int i = pCommandLen - 1; i; i--) + for (size_t i = pCommandLen - 1; i; i--) { if (isspace(pCvarStr[i])) pCvarStr[i] = '\0'; diff --git a/primedev/util/printmaps.cpp b/primedev/util/printmaps.cpp index d3253605..906bed06 100644 --- a/primedev/util/printmaps.cpp +++ b/primedev/util/printmaps.cpp @@ -136,9 +136,9 @@ int, __fastcall, (const char *const cmdname, const char *const partial, char com RefreshMapList(); // use a custom autocomplete func for all map loading commands - const int cmdLength = strlen(cmdname); + const size_t cmdLength = strlen(cmdname); const char* query = partial + cmdLength; - const int queryLength = strlen(query); + const size_t queryLength = strlen(query); int numMaps = 0; for (int i = 0; i < vMapList.size() && numMaps < COMMAND_COMPLETION_MAXITEMS; i++) diff --git a/primedev/wsockproxy/loader.cpp b/primedev/wsockproxy/loader.cpp index 3e46c1a6..0a299ba8 100644 --- a/primedev/wsockproxy/loader.cpp +++ b/primedev/wsockproxy/loader.cpp @@ -54,7 +54,7 @@ bool LoadNorthstar() std::string cla = std::string(clachar); if (strncmp(cla.substr(9, 1).c_str(), "\"", 1)) { - int space = cla.find(" "); + size_t space = cla.find(" "); std::string dirname = cla.substr(9, space - 9); std::cout << "[*] Found profile in command line arguments: " << dirname << std::endl; strProfile = dirname.c_str(); @@ -62,8 +62,8 @@ bool LoadNorthstar() else { std::string quote = "\""; - int quote1 = cla.find(quote); - int quote2 = (cla.substr(quote1 + 1)).find(quote); + size_t quote1 = cla.find(quote); + size_t quote2 = (cla.substr(quote1 + 1)).find(quote); std::string dirname = cla.substr(quote1 + 1, quote2); std::cout << "[*] Found profile in command line arguments: " << dirname << std::endl; strProfile = dirname; |