From 7f84bdf8fd5c93286f000bc5f9314eab81128cee Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sun, 21 Jan 2024 19:34:19 +0000 Subject: Address C4267 compiler warnings (#647) Implicit conversion from `size_t` to a smaller type --- primedev/scripts/client/scriptserverbrowser.cpp | 4 ++-- primedev/scripts/scriptdatatables.cpp | 2 +- primedev/scripts/scripthttprequesthandler.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'primedev/scripts') 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->pushinteger(sqvm, g_pMasterServerManager->m_vRemoteServers.size()); + g_pSquirrel->pushinteger(sqvm, (SQInteger)g_pMasterServerManager->m_vRemoteServers.size()); return SQRESULT_NOTNULL; } @@ -146,7 +146,7 @@ ADD_SQFUNC("array", NSGetGameServers, "", "", ScriptContext::UI) g_pSquirrel->pushnewstructinstance(sqvm, 11); // index - g_pSquirrel->pushinteger(sqvm, i); + g_pSquirrel->pushinteger(sqvm, (SQInteger)i); g_pSquirrel->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->m_funcOriginals["GetDatatableRowCount"](sqvm); CSVData* csv = *pData; - g_pSquirrel->pushinteger(sqvm, csv->dataPointers.size()); + g_pSquirrel->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 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) { -- cgit v1.2.3