cycleclock: Fix type conversion to match function return type on riscv64 (#1802)

Fixes builds with clang

src/cycleclock.h:213:10: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Werror,-Wsign-conversion]
     213 |   return cycles;
         |   ~~~~~~ ^~~~~~
   1 error generated.
This commit is contained in:
Khem Raj 2024-06-11 05:37:35 -07:00 committed by GitHub
parent 2fa4b26e58
commit 8e1823d6f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
#else #else
uint64_t cycles; uint64_t cycles;
asm volatile("rdtime %0" : "=r"(cycles)); asm volatile("rdtime %0" : "=r"(cycles));
return cycles; return static_cast<int64_t>(cycles);
#endif #endif
#elif defined(__e2k__) || defined(__elbrus__) #elif defined(__e2k__) || defined(__elbrus__)
struct timeval tv; struct timeval tv;