mirror of https://github.com/google/benchmark.git
remove old-style (C-style) casts (#1614)
Remove old-style (C-style) casts This is required by the Google C++ style guide: https://google.github.io/styleguide/cppguide.html#Casting
This commit is contained in:
parent
b323288cba
commit
1d25c2e3be
|
@ -49,6 +49,10 @@ cc_library(
|
|||
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
||||
"//conditions:default": ["-pthread"],
|
||||
}),
|
||||
copts = select({
|
||||
":windows": [],
|
||||
"//conditions:default": ["-Werror=old-style-cast"],
|
||||
}),
|
||||
strip_include_prefix = "include",
|
||||
visibility = ["//visibility:public"],
|
||||
# Only static linking is allowed; no .so will be produced.
|
||||
|
|
|
@ -175,6 +175,7 @@ else()
|
|||
add_cxx_compiler_flag(-Wextra)
|
||||
add_cxx_compiler_flag(-Wshadow)
|
||||
add_cxx_compiler_flag(-Wfloat-equal)
|
||||
add_cxx_compiler_flag(-Wold-style-cast)
|
||||
if(BENCHMARK_ENABLE_WERROR)
|
||||
add_cxx_compiler_flag(-Werror)
|
||||
endif()
|
||||
|
|
|
@ -229,7 +229,7 @@ void State::PauseTiming() {
|
|||
for (const auto& name_and_measurement : measurements) {
|
||||
auto name = name_and_measurement.first;
|
||||
auto measurement = name_and_measurement.second;
|
||||
BM_CHECK_EQ(std::fpclassify((double)counters[name]), FP_ZERO);
|
||||
BM_CHECK_EQ(std::fpclassify(double{counters[name]}), FP_ZERO);
|
||||
counters[name] = Counter(measurement, Counter::kAvgIterations);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue