diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2023-09-27 16:30:57 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-09-27 16:30:57 +0000 |
commit | 83836ea18fd8db8d60e4d1a1dcf96109e1447611 (patch) | |
tree | cbcc19fcf98479dce5ad3e7954427bd82961a348 /src/benchmark_register.h | |
parent | db4553b1a39ef8ef84a097dfa2e795c0a4df60d8 (diff) | |
parent | 04b856c2d7d03d4db84ad8d715921f158564f472 (diff) | |
download | google-benchmark-83836ea18fd8db8d60e4d1a1dcf96109e1447611.tar.gz |
Upgrade google-benchmark to v1.8.3 am: f45c56f9b5 am: 04b856c2d7
Original change: https://android-review.googlesource.com/c/platform/external/google-benchmark/+/2760806
Change-Id: Ic5d3b824601d71be387abeb546bf8bea23542794
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'src/benchmark_register.h')
-rw-r--r-- | src/benchmark_register.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/benchmark_register.h b/src/benchmark_register.h index c774e6f..53367c7 100644 --- a/src/benchmark_register.h +++ b/src/benchmark_register.h @@ -1,6 +1,7 @@ #ifndef BENCHMARK_REGISTER_H #define BENCHMARK_REGISTER_H +#include <algorithm> #include <limits> #include <vector> @@ -12,18 +13,18 @@ namespace internal { // Append the powers of 'mult' in the closed interval [lo, hi]. // Returns iterator to the start of the inserted range. template <typename T> -typename std::vector<T>::iterator -AddPowers(std::vector<T>* dst, T lo, T hi, int mult) { - CHECK_GE(lo, 0); - CHECK_GE(hi, lo); - CHECK_GE(mult, 2); +typename std::vector<T>::iterator AddPowers(std::vector<T>* dst, T lo, T hi, + int mult) { + BM_CHECK_GE(lo, 0); + BM_CHECK_GE(hi, lo); + BM_CHECK_GE(mult, 2); const size_t start_offset = dst->size(); static const T kmax = std::numeric_limits<T>::max(); // Space out the values in multiples of "mult" - for (T i = 1; i <= hi; i *= mult) { + for (T i = static_cast<T>(1); i <= hi; i *= static_cast<T>(mult)) { if (i >= lo) { dst->push_back(i); } @@ -32,16 +33,16 @@ AddPowers(std::vector<T>* dst, T lo, T hi, int mult) { if (i > kmax / mult) break; } - return dst->begin() + start_offset; + return dst->begin() + static_cast<int>(start_offset); } template <typename T> void AddNegatedPowers(std::vector<T>* dst, T lo, T hi, int mult) { // We negate lo and hi so we require that they cannot be equal to 'min'. - CHECK_GT(lo, std::numeric_limits<T>::min()); - CHECK_GT(hi, std::numeric_limits<T>::min()); - CHECK_GE(hi, lo); - CHECK_LE(hi, 0); + BM_CHECK_GT(lo, std::numeric_limits<T>::min()); + BM_CHECK_GT(hi, std::numeric_limits<T>::min()); + BM_CHECK_GE(hi, lo); + BM_CHECK_LE(hi, 0); // Add positive powers, then negate and reverse. // Casts necessary since small integers get promoted @@ -60,8 +61,8 @@ void AddRange(std::vector<T>* dst, T lo, T hi, int mult) { static_assert(std::is_integral<T>::value && std::is_signed<T>::value, "Args type must be a signed integer"); - CHECK_GE(hi, lo); - CHECK_GE(mult, 2); + BM_CHECK_GE(hi, lo); + BM_CHECK_GE(mult, 2); // Add "lo" dst->push_back(lo); |