Skip to content
Snippets Groups Projects
Commit 971b5001 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Fix warnings with GCC 7

parent 50433e76
No related merge requests found
...@@ -301,9 +301,10 @@ public: ...@@ -301,9 +301,10 @@ public:
void test_convert_counts_to_frequency_for_each_item_sparse() { void test_convert_counts_to_frequency_for_each_item_sparse() {
double total = 0; double total = 0;
double floor = static_cast<double>(histSize) - 5.0;
for (size_t i = 0; i < nHists; i++) { for (size_t i = 0; i < nHists; i++) {
for (auto &item : m_hist) { for (auto &item : m_hist) {
if (item.counts() > histSize - 5) if (item.counts() > floor)
total += item.frequency(); total += item.frequency();
} }
} }
...@@ -311,11 +312,12 @@ public: ...@@ -311,11 +312,12 @@ public:
void test_convert_counts_to_frequency_once_per_histogram_sparse() { void test_convert_counts_to_frequency_once_per_histogram_sparse() {
double total = 0; double total = 0;
double floor = static_cast<double>(histSize) - 5.0;
for (size_t i = 0; i < nHists; i++) { for (size_t i = 0; i < nHists; i++) {
const auto &counts = m_hist.counts(); const auto &counts = m_hist.counts();
const auto &frequencies = m_hist.frequencies(); const auto &frequencies = m_hist.frequencies();
for (size_t j = 0; j < histSize; ++j) for (size_t j = 0; j < histSize; ++j)
if (counts[j] > histSize - 5) if (counts[j] > floor)
total += frequencies[j]; total += frequencies[j];
} }
} }
......
...@@ -16,6 +16,7 @@ ExternalProject_Add(googletest ...@@ -16,6 +16,7 @@ ExternalProject_Add(googletest
COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_override.patch" COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_override.patch"
COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_static.patch" COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_static.patch"
COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_msvc_cpp11.patch" COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_msvc_cpp11.patch"
COMMAND "@GIT_EXECUTABLE@" apply --whitespace fix "@CMAKE_SOURCE_DIR@/buildconfig/CMake/googletest_wconversion.patch"
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" INSTALL_COMMAND ""
......
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 33b37a7..fbb5734 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -1620,8 +1620,13 @@ class VariadicMatcher {
}
private:
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
typedef MatcherList<sizeof...(Args), Args...> MatcherListType;
-
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic warning "-Wconversion"
+#endif
const typename MatcherListType::ListType matchers_;
GTEST_DISALLOW_ASSIGN_(VariadicMatcher);
...@@ -697,7 +697,8 @@ bool ReflDataProcessorPresenter::parseUniform(TimeSlicingInfo &slicing, ...@@ -697,7 +697,8 @@ bool ReflDataProcessorPresenter::parseUniform(TimeSlicingInfo &slicing,
if (mws != nullptr) { if (mws != nullptr) {
const auto run = mws->run(); const auto run = mws->run();
const auto totalDuration = run.endTime() - run.startTime(); const auto totalDuration = run.endTime() - run.startTime();
double totalDurationSec = totalDuration.total_seconds(); double totalDurationSec =
static_cast<double>(totalDuration.total_seconds());
double sliceDuration = .0; double sliceDuration = .0;
size_t numSlices = 0; size_t numSlices = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment