Marked some functions as safebuffers since realistically QueryPerformanceCounter won't ever cause a buffer overrun and it's a quite time critical function

This commit is contained in:
Silent 2019-01-04 00:47:05 +01:00
parent 69086b1a82
commit 80242b42f7
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1
3 changed files with 4 additions and 4 deletions

View file

@ -296,7 +296,7 @@ void __declspec(naked) RadarBoundsCheckEntityBlip()
extern char** ppUserFilesDir = AddressByVersion<char**>(0x580C16, 0x580F66, 0x580E66); extern char** ppUserFilesDir = AddressByVersion<char**>(0x580C16, 0x580F66, 0x580E66);
static LARGE_INTEGER FrameTime; static LARGE_INTEGER FrameTime;
int32_t GetTimeSinceLastFrame() __declspec(safebuffers) int32_t GetTimeSinceLastFrame()
{ {
LARGE_INTEGER curTime; LARGE_INTEGER curTime;
QueryPerformanceCounter(&curTime); QueryPerformanceCounter(&curTime);

View file

@ -763,7 +763,7 @@ char* GetMyDocumentsPathSA()
} }
static LARGE_INTEGER FrameTime; static LARGE_INTEGER FrameTime;
int32_t GetTimeSinceLastFrame() __declspec(safebuffers) int32_t GetTimeSinceLastFrame()
{ {
LARGE_INTEGER curTime; LARGE_INTEGER curTime;
QueryPerformanceCounter(&curTime); QueryPerformanceCounter(&curTime);
@ -2134,7 +2134,7 @@ DarkVehiclesFix4_MakeItDark:
} }
// 1.0 ONLY ENDS HERE // 1.0 ONLY ENDS HERE
static int _Timers_ftol_internal( double timer, double& remainder ) __declspec(safebuffers) static int _Timers_ftol_internal( double timer, double& remainder )
{ {
double integral; double integral;
remainder = modf( timer + remainder, &integral ); remainder = modf( timer + remainder, &integral );

View file

@ -161,7 +161,7 @@ void __declspec(naked) CreateInstance_BikeFix()
extern char** ppUserFilesDir = AddressByVersion<char**>(0x6022AA, 0x60228A, 0x601ECA); extern char** ppUserFilesDir = AddressByVersion<char**>(0x6022AA, 0x60228A, 0x601ECA);
static LARGE_INTEGER FrameTime; static LARGE_INTEGER FrameTime;
int32_t GetTimeSinceLastFrame() __declspec(safebuffers) int32_t GetTimeSinceLastFrame()
{ {
LARGE_INTEGER curTime; LARGE_INTEGER curTime;
QueryPerformanceCounter(&curTime); QueryPerformanceCounter(&curTime);