Revert "fix some warnings" (#1762)

This reverts commit 1576991177.
This commit is contained in:
Roman Lebedev 2024-03-06 15:40:31 +03:00 committed by GitHub
parent 1576991177
commit ef88520d6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,7 +71,7 @@ void BM_Complexity_O1(benchmark::State &state) {
for (auto _ : state) {
// This test requires a non-zero CPU time to avoid divide-by-zero
benchmark::DoNotOptimize(state.iterations());
long tmp = state.iterations();
double tmp = state.iterations();
benchmark::DoNotOptimize(tmp);
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
benchmark::DoNotOptimize(state.iterations());
@ -120,7 +120,7 @@ void BM_Complexity_O_N(benchmark::State &state) {
for (auto _ : state) {
// This test requires a non-zero CPU time to avoid divide-by-zero
benchmark::DoNotOptimize(state.iterations());
long tmp = state.iterations();
double tmp = state.iterations();
benchmark::DoNotOptimize(tmp);
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
benchmark::DoNotOptimize(state.iterations());
@ -129,7 +129,7 @@ void BM_Complexity_O_N(benchmark::State &state) {
}
// 1ns per iteration per entry
state.SetIterationTime(static_cast<double>(state.range(0)) * 42.0 * 1e-9);
state.SetIterationTime(state.range(0) * 42 * 1e-9);
}
state.SetComplexityN(state.range(0));
}
@ -178,7 +178,7 @@ static void BM_Complexity_O_N_log_N(benchmark::State &state) {
for (auto _ : state) {
// This test requires a non-zero CPU time to avoid divide-by-zero
benchmark::DoNotOptimize(state.iterations());
long tmp = state.iterations();
double tmp = state.iterations();
benchmark::DoNotOptimize(tmp);
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
benchmark::DoNotOptimize(state.iterations());
@ -186,8 +186,8 @@ static void BM_Complexity_O_N_log_N(benchmark::State &state) {
benchmark::DoNotOptimize(tmp);
}
state.SetIterationTime(static_cast<double>(state.range(0)) * kLog2E *
std::log(state.range(0)) * 42.0 * 1e-9);
state.SetIterationTime(state.range(0) * kLog2E * std::log(state.range(0)) *
42 * 1e-9);
}
state.SetComplexityN(state.range(0));
}
@ -238,7 +238,7 @@ void BM_ComplexityCaptureArgs(benchmark::State &state, int n) {
for (auto _ : state) {
// This test requires a non-zero CPU time to avoid divide-by-zero
benchmark::DoNotOptimize(state.iterations());
long tmp = state.iterations();
double tmp = state.iterations();
benchmark::DoNotOptimize(tmp);
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
benchmark::DoNotOptimize(state.iterations());
@ -246,7 +246,7 @@ void BM_ComplexityCaptureArgs(benchmark::State &state, int n) {
benchmark::DoNotOptimize(tmp);
}
state.SetIterationTime(static_cast<double>(state.range(0)) * 42.0 * 1e-9);
state.SetIterationTime(state.range(0) * 42 * 1e-9);
}
state.SetComplexityN(n);
}