Skip to content

Commit

Permalink
fix(autoware_pointcloud_preprocessor): fix cppcheck warnings of funct…
Browse files Browse the repository at this point in the history
…ionStatic (autowarefoundation#8163)

fix: deal with functionStatic warnings

Signed-off-by: taisa1 <kento.osa@tier4.jp>
Co-authored-by: Yi-Hsiang Fang (Vivid) <146902905+vividf@users.noreply.github.com>
  • Loading branch information
2 people authored and esteve committed Aug 13, 2024
1 parent be98ef4 commit 4e1f224
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ template <typename T, size_t MinSize, size_t MaxSize>
struct NodeAllocator<T, MinSize, MaxSize, true>
{
// we are not using the data, so just free it.
void addOrFree(void * ptr, size_t ROBIN_HOOD_UNUSED(numBytes) /*unused*/) noexcept
static void addOrFree(void * ptr, size_t ROBIN_HOOD_UNUSED(numBytes) /*unused*/) noexcept
{
ROBIN_HOOD_LOG("std::free")
std::free(ptr);
Expand Down Expand Up @@ -1051,8 +1051,8 @@ class Table
}

// doesn't do anything
void destroy(M & ROBIN_HOOD_UNUSED(map) /*unused*/) noexcept {}
void destroyDoNotDeallocate() noexcept {}
static void destroy(M & ROBIN_HOOD_UNUSED(map) /*unused*/) noexcept {}
static void destroyDoNotDeallocate() noexcept {}

value_type const * operator->() const noexcept { return &mData; }
value_type * operator->() noexcept { return &mData; }
Expand Down Expand Up @@ -1262,15 +1262,15 @@ class Table
template <typename M>
struct Destroyer<M, true>
{
void nodes(M & m) const noexcept { m.mNumElements = 0; }
static void nodes(M & m) noexcept { m.mNumElements = 0; }

void nodesDoNotDeallocate(M & m) const noexcept { m.mNumElements = 0; }
static void nodesDoNotDeallocate(M & m) noexcept { m.mNumElements = 0; }
};

template <typename M>
struct Destroyer<M, false>
{
void nodes(M & m) const noexcept
static void nodes(M & m) noexcept
{
m.mNumElements = 0;
// clear also resets mInfo to 0, that's sometimes not necessary.
Expand All @@ -1285,7 +1285,7 @@ class Table
}
}

void nodesDoNotDeallocate(M & m) const noexcept
static void nodesDoNotDeallocate(M & m) noexcept
{
m.mNumElements = 0;
// clear also resets mInfo to 0, that's sometimes not necessary.
Expand Down

0 comments on commit 4e1f224

Please sign in to comment.