mirror of
https://github.com/anrieff/libcpuid
synced 2024-11-10 22:59:13 +00:00
Shut up a warning in cpu_clock_by_ic().
Namely, printing a uint64_t with printf(...%llu...) is considered bad practice; you need to use the format specifier PRIu64, defined in inttypes.h. Apparently, it's not safe to assume that uint64_t == unsigned long long. However, I don't like this kind of formatting uglyness. The td variable on my machine is ~30k - and conceivably can't go above 1M. Moreover, this printf is only for detailed debug purposes. So it's safe to cast the var to int and print it with %d.
This commit is contained in:
parent
cc1cce5ec8
commit
4e224776e6
1 changed files with 1 additions and 1 deletions
|
@ -275,7 +275,7 @@ int cpu_clock_by_ic(int millis, int runs)
|
|||
sys_precise_clock(&t1);
|
||||
} while (t1 - t0 < tl * (uint64_t) 8);
|
||||
// cpu_Hz = cycles_inner * cycles_outer * 256 / (t1 - t0) * 1000000
|
||||
debugf(2, "c = %d, td = %llu\n", c, t1 - t0);
|
||||
debugf(2, "c = %d, td = %d\n", c, (int) (t1 - t0));
|
||||
hz = ((uint64_t) cycles_inner * (uint64_t) 256 + 12) *
|
||||
(uint64_t) cycles_outer * (uint64_t) multiplier_numerator * (uint64_t) c * (uint64_t) 1000000
|
||||
/ ((t1 - t0) * (uint64_t) multiplier_denom);
|
||||
|
|
Loading…
Reference in a new issue