we're now C friendly
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13630 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f84e00e27c
commit
ca383c429e
@ -209,14 +209,16 @@ int32
|
||||
get_rounded_cpu_speed(void)
|
||||
{
|
||||
system_info sys_info;
|
||||
get_system_info(&sys_info);
|
||||
|
||||
int target = sys_info.cpu_clock_speed / 1000000;
|
||||
int frac = target % 100;
|
||||
int delta = -frac;
|
||||
int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 };
|
||||
uint x;
|
||||
|
||||
for (uint x = 0; x < sizeof(freqs) / sizeof(freqs[0]); x++) {
|
||||
get_system_info(&sys_info);
|
||||
|
||||
for (x = 0; x < sizeof(freqs) / sizeof(freqs[0]); x++) {
|
||||
int ndelta = freqs[x] - frac;
|
||||
if (abs(ndelta) < abs(delta))
|
||||
delta = ndelta;
|
||||
|
Loading…
x
Reference in New Issue
Block a user