Skip to content

Commit

Permalink
Changing void* to AbstractOcTreeNode*
Browse files Browse the repository at this point in the history
  • Loading branch information
ahornung committed Jan 12, 2016
1 parent 09d95b8 commit 175754a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions octomap/include/octomap/OcTreeBaseImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@


namespace octomap {

// forward declaration for NODE children array
class AbstractOcTreeNode;


/**
Expand Down
2 changes: 1 addition & 1 deletion octomap/include/octomap/OcTreeBaseImpl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ namespace octomap {
}
assert (node->children[childIdx] == NULL);
NODE* newNode = new NODE();
node->children[childIdx] = static_cast<void*>(newNode);
node->children[childIdx] = static_cast<AbstractOcTreeNode*>(newNode);
return newNode;
}

Expand Down
3 changes: 2 additions & 1 deletion octomap/include/octomap/OcTreeDataNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ namespace octomap {

/// pointer to array of children, may be NULL
/// @note The tree class manages this pointer, the array, and the memory for it!
void** children;
/// The children of a node are always enforced to be the same type as the node
AbstractOcTreeNode** children;
/// stored data (payload)
T value;

Expand Down
2 changes: 1 addition & 1 deletion octomap/include/octomap/OcTreeDataNode.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace octomap {
// ============================================================
template <typename T>
void OcTreeDataNode<T>::allocChildren() {
children = new void*[8];
children = new AbstractOcTreeNode*[8];
for (unsigned int i=0; i<8; i++) {
children[i] = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion octomap/valgrind_memcheck.supp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Suppresses the "leaks" by the static member initializer which cannot be avoided.
#
# You can run valgrind on an OctoMap binary (e.g. a unit test) with:
# valgrind --tool=memcheck --leak-check=full --suppressions=valgrind_memcheck.supp bin/test_....
# valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --suppressions=valgrind_memcheck.supp bin/test_....
#

{
Expand Down

0 comments on commit 175754a

Please sign in to comment.