Minor cppcheck lint fixes

This commit is contained in:
Simon Lindholm 2023-10-16 20:05:04 +02:00
parent 4bf81a9ec9
commit 90101d8bc1
3 changed files with 5 additions and 3 deletions

View File

@ -2043,7 +2043,6 @@ static void *resolveByName(const char *name) {
if (strcmp(name, "InitOnceBeginInitialize") == 0) return (void *) kernel32::InitOnceBeginInitialize;
if (strcmp(name, "AcquireSRWLockShared") == 0) return (void *) kernel32::AcquireSRWLockShared;
if (strcmp(name, "ReleaseSRWLockShared") == 0) return (void *) kernel32::ReleaseSRWLockShared;
if (strcmp(name, "ReleaseSRWLockShared") == 0) return (void *) kernel32::AcquireSRWLockShared;
if (strcmp(name, "AcquireSRWLockExclusive") == 0) return (void *) kernel32::AcquireSRWLockExclusive;
if (strcmp(name, "ReleaseSRWLockExclusive") == 0) return (void *) kernel32::ReleaseSRWLockExclusive;
if (strcmp(name, "TryAcquireSRWLockExclusive") == 0) return (void *) kernel32::TryAcquireSRWLockExclusive;

View File

@ -107,6 +107,7 @@ uint32_t read32(FILE *file) {
wibo::Executable::Executable() {
imageBuffer = nullptr;
imageSize = 0;
entryPoint = nullptr;
rsrcBase = 0;
}

View File

@ -127,7 +127,8 @@ void wibo::freeModule(HMODULE module) { delete static_cast<ModuleInfo *>(module)
void *wibo::resolveFuncByName(HMODULE module, const char *funcName) {
auto *info = static_cast<ModuleInfo *>(module);
if (info && info->module && info->module->byName) {
assert(info);
if (info->module && info->module->byName) {
void *func = info->module->byName(funcName);
if (func)
return func;
@ -137,7 +138,8 @@ void *wibo::resolveFuncByName(HMODULE module, const char *funcName) {
void *wibo::resolveFuncByOrdinal(HMODULE module, uint16_t ordinal) {
auto *info = static_cast<ModuleInfo *>(module);
if (info && info->module && info->module->byOrdinal) {
assert(info);
if (info->module && info->module->byOrdinal) {
void *func = info->module->byOrdinal(ordinal);
if (func)
return func;