1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-21 14:54:14 +01:00

Re-add dummy, cast to void

This commit is contained in:
Headline 2018-07-31 21:14:08 -07:00 committed by Michael Flaherty
parent 96695e209e
commit 2418a49e7d
No known key found for this signature in database
GPG Key ID: 2C2807BC629325CD

View File

@ -322,8 +322,11 @@ namespace SourceHook
prevHandler = signal(SIGSEGV, BadReadHandler);
volatile const char *p = reinterpret_cast<const char*>(addr);
char dummy;
for (size_t i = 0; i < len; i++)
p[i];
dummy = p[i];
(void)dummy; // silence unused var, we must read from p
g_BadReadCalled = false;
@ -344,8 +347,11 @@ namespace SourceHook
return false;
volatile const char *p = reinterpret_cast<const char *>(addr);
char dummy;
for (size_t i = 0; i < len; i++)
p[i];
dummy = p[i];
(void)dummy; // silence unused var, we must read from p
g_BadReadCalled = false;