Skip to content

Commit

Permalink
Move CI to more modern platforms
Browse files Browse the repository at this point in the history
1. Advance linux to bionic
2. Advance mac to xcode 11.3; that correlates with macOS 10.14.6 which is a
   common contemporary of bionic.
3. Appveyor accesses eigen via gitlab (instead of bitbucket).
4. Clean up:
  - HierarchyTree::SortByMorton had "maybe" uninitialized values. Cleaned
    up initialization and instantiation (using RAII).
  • Loading branch information
SeanCurtis-TRI committed Aug 26, 2020
1 parent 1bddc98 commit c56461b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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% .. &&
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: required
dist: trusty
dist: bionic
cache:
apt: true

Expand All @@ -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

Expand Down
23 changes: 5 additions & 18 deletions include/fcl/broadphase/detail/hierarchy_tree_array-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ void HierarchyTree<BV>::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;
Expand Down Expand Up @@ -208,10 +205,7 @@ void HierarchyTree<BV>::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;
Expand Down Expand Up @@ -255,10 +249,7 @@ void HierarchyTree<BV>::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;
Expand Down Expand Up @@ -722,9 +713,7 @@ size_t HierarchyTree<BV>::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)
Expand Down Expand Up @@ -771,9 +760,7 @@ size_t HierarchyTree<BV>::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)
Expand Down
7 changes: 5 additions & 2 deletions include/fcl/broadphase/detail/hierarchy_tree_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -77,8 +80,8 @@ class FCL_EXPORT HierarchyTree
return false;
}

NodeType* nodes;
uint32 split;
NodeType* nodes{};
uint32 split{};
};

public:
Expand Down
15 changes: 0 additions & 15 deletions include/fcl/common/warning.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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

0 comments on commit c56461b

Please sign in to comment.