Skip to content

Commit ef88520

Browse files
authored
Revert "fix some warnings" (#1762)
This reverts commit 1576991.
1 parent 1576991 commit ef88520

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/complexity_test.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void BM_Complexity_O1(benchmark::State &state) {
7171
for (auto _ : state) {
7272
// This test requires a non-zero CPU time to avoid divide-by-zero
7373
benchmark::DoNotOptimize(state.iterations());
74-
long tmp = state.iterations();
74+
double tmp = state.iterations();
7575
benchmark::DoNotOptimize(tmp);
7676
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
7777
benchmark::DoNotOptimize(state.iterations());
@@ -120,7 +120,7 @@ void BM_Complexity_O_N(benchmark::State &state) {
120120
for (auto _ : state) {
121121
// This test requires a non-zero CPU time to avoid divide-by-zero
122122
benchmark::DoNotOptimize(state.iterations());
123-
long tmp = state.iterations();
123+
double tmp = state.iterations();
124124
benchmark::DoNotOptimize(tmp);
125125
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
126126
benchmark::DoNotOptimize(state.iterations());
@@ -129,7 +129,7 @@ void BM_Complexity_O_N(benchmark::State &state) {
129129
}
130130

131131
// 1ns per iteration per entry
132-
state.SetIterationTime(static_cast<double>(state.range(0)) * 42.0 * 1e-9);
132+
state.SetIterationTime(state.range(0) * 42 * 1e-9);
133133
}
134134
state.SetComplexityN(state.range(0));
135135
}
@@ -178,16 +178,16 @@ static void BM_Complexity_O_N_log_N(benchmark::State &state) {
178178
for (auto _ : state) {
179179
// This test requires a non-zero CPU time to avoid divide-by-zero
180180
benchmark::DoNotOptimize(state.iterations());
181-
long tmp = state.iterations();
181+
double tmp = state.iterations();
182182
benchmark::DoNotOptimize(tmp);
183183
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
184184
benchmark::DoNotOptimize(state.iterations());
185185
tmp *= state.iterations();
186186
benchmark::DoNotOptimize(tmp);
187187
}
188188

189-
state.SetIterationTime(static_cast<double>(state.range(0)) * kLog2E *
190-
std::log(state.range(0)) * 42.0 * 1e-9);
189+
state.SetIterationTime(state.range(0) * kLog2E * std::log(state.range(0)) *
190+
42 * 1e-9);
191191
}
192192
state.SetComplexityN(state.range(0));
193193
}
@@ -238,15 +238,15 @@ void BM_ComplexityCaptureArgs(benchmark::State &state, int n) {
238238
for (auto _ : state) {
239239
// This test requires a non-zero CPU time to avoid divide-by-zero
240240
benchmark::DoNotOptimize(state.iterations());
241-
long tmp = state.iterations();
241+
double tmp = state.iterations();
242242
benchmark::DoNotOptimize(tmp);
243243
for (benchmark::IterationCount i = 0; i < state.iterations(); ++i) {
244244
benchmark::DoNotOptimize(state.iterations());
245245
tmp *= state.iterations();
246246
benchmark::DoNotOptimize(tmp);
247247
}
248248

249-
state.SetIterationTime(static_cast<double>(state.range(0)) * 42.0 * 1e-9);
249+
state.SetIterationTime(state.range(0) * 42 * 1e-9);
250250
}
251251
state.SetComplexityN(n);
252252
}

0 commit comments

Comments
 (0)