Skip to content

Commit

Permalink
Revert "fix some warnings" (#1762)
Browse files Browse the repository at this point in the history
This reverts commit 1576991.
  • Loading branch information
LebedevRI authored Mar 6, 2024
1 parent 1576991 commit ef88520
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/complexity_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand All @@ -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));
}
Expand Down Expand Up @@ -178,16 +178,16 @@ 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());
tmp *= state.iterations();
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));
}
Expand Down Expand Up @@ -238,15 +238,15 @@ 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());
tmp *= state.iterations();
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);
}
Expand Down

0 comments on commit ef88520

Please sign in to comment.