mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 23:03:01 +05:00
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:
parent
69086b1a82
commit
80242b42f7
3 changed files with 4 additions and 4 deletions
|
@ -296,7 +296,7 @@ void __declspec(naked) RadarBoundsCheckEntityBlip()
|
|||
extern char** ppUserFilesDir = AddressByVersion<char**>(0x580C16, 0x580F66, 0x580E66);
|
||||
|
||||
static LARGE_INTEGER FrameTime;
|
||||
int32_t GetTimeSinceLastFrame()
|
||||
__declspec(safebuffers) int32_t GetTimeSinceLastFrame()
|
||||
{
|
||||
LARGE_INTEGER curTime;
|
||||
QueryPerformanceCounter(&curTime);
|
||||
|
|
|
@ -763,7 +763,7 @@ char* GetMyDocumentsPathSA()
|
|||
}
|
||||
|
||||
static LARGE_INTEGER FrameTime;
|
||||
int32_t GetTimeSinceLastFrame()
|
||||
__declspec(safebuffers) int32_t GetTimeSinceLastFrame()
|
||||
{
|
||||
LARGE_INTEGER curTime;
|
||||
QueryPerformanceCounter(&curTime);
|
||||
|
@ -2134,7 +2134,7 @@ DarkVehiclesFix4_MakeItDark:
|
|||
}
|
||||
// 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;
|
||||
remainder = modf( timer + remainder, &integral );
|
||||
|
|
|
@ -161,7 +161,7 @@ void __declspec(naked) CreateInstance_BikeFix()
|
|||
extern char** ppUserFilesDir = AddressByVersion<char**>(0x6022AA, 0x60228A, 0x601ECA);
|
||||
|
||||
static LARGE_INTEGER FrameTime;
|
||||
int32_t GetTimeSinceLastFrame()
|
||||
__declspec(safebuffers) int32_t GetTimeSinceLastFrame()
|
||||
{
|
||||
LARGE_INTEGER curTime;
|
||||
QueryPerformanceCounter(&curTime);
|
||||
|
|
Loading…
Reference in a new issue