Skip to content

Commit

Permalink
Fix C-style typecasting in QNX-specific code (#1739)
Browse files Browse the repository at this point in the history
C-style typecasting breaks the build due to `-Werror=old-style-cast` which should remain in place.
  • Loading branch information
Arech authored Jan 16, 2024
1 parent ea71a14 commit 3d293cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,9 @@ double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
kstat_close(kc);
return clock_hz;
#elif defined(BENCHMARK_OS_QNX)
return static_cast<double>((int64_t)(SYSPAGE_ENTRY(cpuinfo)->speed) *
(int64_t)(1000 * 1000));
return static_cast<double>(
static_cast<int64_t>(SYSPAGE_ENTRY(cpuinfo)->speed) *
static_cast<int64_t>(1000 * 1000));
#elif defined(BENCHMARK_OS_QURT)
// QuRT doesn't provide any API to query Hexagon frequency.
return 1000000000;
Expand Down

0 comments on commit 3d293cd

Please sign in to comment.