diff --git a/.appveyor.yml b/.appveyor.yml index 4131300de..99cde2fc0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,9 +38,9 @@ before_build: cd ..\.. ) else (echo Using cached libccd) - cmd: if not exist C:\"Program Files"\Eigen\include\eigen3\Eigen\Core ( - curl -L -o eigen-eigen-dc6cfdf9bcec.tar.gz https://bitbucket.org/eigen/eigen/get/3.2.9.tar.gz && - cmake -E tar zxf eigen-eigen-dc6cfdf9bcec.tar.gz && - cd eigen-eigen-dc6cfdf9bcec && + curl -LO https://gitlab.com/libeigen/eigen/-/archive/3.2.9/eigen-3.2.9.tar.gz && + cmake -E tar zxf eigen-3.2.9.tar.gz && + cd eigen-3.2.9 && mkdir build && cd build && cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%Configuration% .. && diff --git a/.travis.yml b/.travis.yml index 13725ace4..283319551 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ sudo: required -dist: trusty +dist: bionic cache: apt: true @@ -20,11 +20,11 @@ matrix: compiler: clang env: BUILD_TYPE=Release COVERALLS=OFF - os: osx - osx_image: xcode9 + osx_image: xcode11.3 compiler: clang env: BUILD_TYPE=Debug COVERALLS=OFF - os: osx - osx_image: xcode9 + osx_image: xcode11.3 compiler: clang env: BUILD_TYPE=Release COVERALLS=OFF diff --git a/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h b/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h index 6e9d33498..961b605ea 100644 --- a/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h +++ b/include/fcl/broadphase/detail/hierarchy_tree_array-inl.h @@ -161,10 +161,7 @@ void HierarchyTree::init_1(NodeType* leaves, int n_leaves_) for(size_t i = 0; i < n_leaves; ++i) ids[i] = i; - FCL_SUPPRESS_MAYBE_UNINITIALIZED_BEGIN - SortByMorton comp; - FCL_SUPPRESS_MAYBE_UNINITIALIZED_END - comp.nodes = nodes; + const SortByMorton comp{nodes}; std::sort(ids, ids + n_leaves, comp); root_node = mortonRecurse_0(ids, ids + n_leaves, (1 << (coder.bits()-1)), coder.bits()-1); delete [] ids; @@ -208,10 +205,7 @@ void HierarchyTree::init_2(NodeType* leaves, int n_leaves_) for(size_t i = 0; i < n_leaves; ++i) ids[i] = i; - FCL_SUPPRESS_MAYBE_UNINITIALIZED_BEGIN - SortByMorton comp; - FCL_SUPPRESS_MAYBE_UNINITIALIZED_END - comp.nodes = nodes; + const SortByMorton comp{nodes}; std::sort(ids, ids + n_leaves, comp); root_node = mortonRecurse_1(ids, ids + n_leaves, (1 << (coder.bits()-1)), coder.bits()-1); delete [] ids; @@ -255,10 +249,7 @@ void HierarchyTree::init_3(NodeType* leaves, int n_leaves_) for(size_t i = 0; i < n_leaves; ++i) ids[i] = i; - FCL_SUPPRESS_MAYBE_UNINITIALIZED_BEGIN - SortByMorton comp; - FCL_SUPPRESS_MAYBE_UNINITIALIZED_END - comp.nodes = nodes; + const SortByMorton comp{nodes}; std::sort(ids, ids + n_leaves, comp); root_node = mortonRecurse_2(ids, ids + n_leaves); delete [] ids; @@ -722,9 +713,7 @@ size_t HierarchyTree::mortonRecurse_0(size_t* lbeg, size_t* lend, const uint { if(bits > 0) { - SortByMorton comp; - comp.nodes = nodes; - comp.split = split; + const SortByMorton comp{nodes, split}; size_t* lcenter = std::lower_bound(lbeg, lend, NULL_NODE, comp); if(lcenter == lbeg) @@ -771,9 +760,7 @@ size_t HierarchyTree::mortonRecurse_1(size_t* lbeg, size_t* lend, const uint { if(bits > 0) { - SortByMorton comp; - comp.nodes = nodes; - comp.split = split; + const SortByMorton comp{nodes, split}; size_t* lcenter = std::lower_bound(lbeg, lend, NULL_NODE, comp); if(lcenter == lbeg) diff --git a/include/fcl/broadphase/detail/hierarchy_tree_array.h b/include/fcl/broadphase/detail/hierarchy_tree_array.h index b55f1e85e..85e80feaf 100644 --- a/include/fcl/broadphase/detail/hierarchy_tree_array.h +++ b/include/fcl/broadphase/detail/hierarchy_tree_array.h @@ -65,6 +65,9 @@ class FCL_EXPORT HierarchyTree struct SortByMorton { + SortByMorton(NodeType* nodes_in) : nodes(nodes_in) {} + SortByMorton(NodeType* nodes_in, uint32 split_in) + : nodes(nodes_in), split(split_in) {} bool operator() (size_t a, size_t b) const { if((a != NULL_NODE) && (b != NULL_NODE)) @@ -77,8 +80,8 @@ class FCL_EXPORT HierarchyTree return false; } - NodeType* nodes; - uint32 split; + NodeType* nodes{}; + uint32 split{}; }; public: diff --git a/include/fcl/common/warning.h b/include/fcl/common/warning.h index f4ec7ee7d..8b93d2684 100644 --- a/include/fcl/common/warning.h +++ b/include/fcl/common/warning.h @@ -68,13 +68,6 @@ #define FCL_SUPPRESS_UNINITIALIZED_END \ _Pragma("GCC diagnostic pop") - #define FCL_SUPPRESS_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") - - #define FCL_SUPPRESS_MAYBE_UNINITIALIZED_END \ - _Pragma("GCC diagnostic pop") - #elif defined (FCL_COMPILER_CLANG) #define FCL_SUPPRESS_DEPRECATED_BEGIN \ @@ -91,10 +84,6 @@ #define FCL_SUPPRESS_UNINITIALIZED_END \ _Pragma("clang diagnostic pop") - #define FCL_SUPPRESS_MAYBE_UNINITIALIZED_BEGIN - - #define FCL_SUPPRESS_MAYBE_UNINITIALIZED_END - #elif defined (FCL_COMPILER_MSVC) #define FCL_SUPPRESS_DEPRECATED_BEGIN \ @@ -108,10 +97,6 @@ #define FCL_SUPPRESS_UNINITIALIZED_END // TODO - #define FCL_SUPPRESS_MAYBE_UNINITIALIZED_BEGIN // TODO - - #define FCL_SUPPRESS_MAYBE_UNINITIALIZED_END // TODO - #endif #endif // FCL_COMMON_WARNING_H