aboutsummaryrefslogtreecommitdiff
path: root/primedev/core/hooks.cpp
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2024-01-21 19:34:19 +0000
committerGitHub <noreply@github.com>2024-01-21 20:34:19 +0100
commit7f84bdf8fd5c93286f000bc5f9314eab81128cee (patch)
treed97974691eb50b7cd8a2bf8a7cbc342fdc7bdd44 /primedev/core/hooks.cpp
parente72f0cbbac6ffcbfbf0c52f14a2a3cb7c18ba8fc (diff)
downloadNorthstarLauncher-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/core/hooks.cpp')
-rw-r--r--primedev/core/hooks.cpp8
1 files changed, 4 insertions, 4 deletions
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++)