mirror of https://github.com/google/benchmark.git
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:
parent
2fa4b26e58
commit
8e1823d6f5
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue