Skip to content

Commit 074489b

Browse files
committed
more fixes
1 parent ddf1ec9 commit 074489b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/benchmark_register.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typename std::vector<T>::iterator AddPowers(std::vector<T>* dst, T lo, T hi,
2424
static const T kmax = std::numeric_limits<T>::max();
2525

2626
// Space out the values in multiples of "mult"
27-
for (T i = static_cast<T>(1); i <= hi; i *= static_cast<T>(mult)) {
27+
for (T i = static_cast<T>(1); i <= hi; i = static_cast<T>(i * mult)) {
2828
if (i >= lo) {
2929
dst->push_back(i);
3030
}
@@ -52,7 +52,7 @@ void AddNegatedPowers(std::vector<T>* dst, T lo, T hi, int mult) {
5252

5353
const auto it = AddPowers(dst, hi_complement, lo_complement, mult);
5454

55-
std::for_each(it, dst->end(), [](T& t) { t *= -1; });
55+
std::for_each(it, dst->end(), [](T& t) { t = static_cast<T>(t * -1); });
5656
std::reverse(it, dst->end());
5757
}
5858

src/cycleclock.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
7070
// frequency scaling). Also note that when the Mac sleeps, this
7171
// counter pauses; it does not continue counting, nor does it
7272
// reset to zero.
73-
return mach_absolute_time();
73+
return static_cast<int64_t>(mach_absolute_time());
7474
#elif defined(BENCHMARK_OS_EMSCRIPTEN)
7575
// this goes above x86-specific code because old versions of Emscripten
7676
// define __x86_64__, although they have nothing to do with it.

0 commit comments

Comments
 (0)