Use integer to obtain cpufrequency in OSX

Using a double to try to obtain cpufrequency in OSX seems to not produce anything useful (integer representation in a double).  Using int64 seems to work.
This commit is contained in:
Thomas Green 2021-07-20 23:51:17 +01:00 committed by GitHub
parent d4932f753e
commit 3503dd2f17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,8 @@ double Sys_ClockTicksPerSecond()
{
static bool init = false;
static double ret;
size_t len = sizeof( ret );
int64_t temp;
size_t len = sizeof( temp );
int status;
if( init )
@ -105,7 +106,8 @@ double Sys_ClockTicksPerSecond()
return ret;
}
status = sysctlbyname( "hw.cpufrequency", &ret, &len, NULL, 0 );
status = sysctlbyname( "hw.cpufrequency", &temp, &len, NULL, 0 );
ret = double(temp);
if( status == -1 )
{