Skip to content

Commit

Permalink
fix(autoware_component_monitor): fix unusedFunction (#8582)
Browse files Browse the repository at this point in the history
Signed-off-by: bathteayo <105347690+bathteayo@users.noreply.github.com>
  • Loading branch information
bathteayo authored Sep 10, 2024
1 parent b56f386 commit a1cba1f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions system/autoware_component_monitor/src/unit_conversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,60 @@

namespace autoware::component_monitor::unit_conversions
{
// cppcheck-suppress-begin unusedFunction
template <typename T>
std::uint64_t kib_to_bytes(T kibibytes)
{
static_assert(std::is_arithmetic<T>::value, "Template parameter must be a numeric type");
return static_cast<std::uint64_t>(kibibytes * 1024);
}
// cppcheck-suppress-end unusedFunction

// cppcheck-suppress-begin unusedFunction
template <typename T>
std::uint64_t mib_to_bytes(T mebibytes)
{
static_assert(std::is_arithmetic<T>::value, "Template parameter must be a numeric type");
return static_cast<std::uint64_t>(mebibytes * 1024 * 1024);
}
// cppcheck-suppress-end unusedFunction

// cppcheck-suppress-begin unusedFunction
template <typename T>
std::uint64_t gib_to_bytes(T gibibytes)
{
static_assert(std::is_arithmetic<T>::value, "Template parameter must be a numeric type");
return static_cast<std::uint64_t>(gibibytes * 1024ULL * 1024ULL * 1024ULL);
}
// cppcheck-suppress-end unusedFunction

// cppcheck-suppress-begin unusedFunction
template <typename T>
std::uint64_t tib_to_bytes(T tebibytes)
{
static_assert(std::is_arithmetic<T>::value, "Template parameter must be a numeric type");
return static_cast<std::uint64_t>(tebibytes * 1024ULL * 1024ULL * 1024ULL * 1024ULL);
}
// cppcheck-suppress-end unusedFunction

// cppcheck-suppress-begin unusedFunction
template <typename T>
std::uint64_t pib_to_bytes(T pebibytes)
{
static_assert(std::is_arithmetic<T>::value, "Template parameter must be a numeric type");
return static_cast<std::uint64_t>(pebibytes * 1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL);
}
// cppcheck-suppress-end unusedFunction

// cppcheck-suppress-begin unusedFunction
template <typename T>
std::uint64_t eib_to_bytes(T exbibytes)
{
static_assert(std::is_arithmetic<T>::value, "Template parameter must be a numeric type");
return static_cast<std::uint64_t>(
exbibytes * 1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL);
}
// cppcheck-suppress-end unusedFunction

} // namespace autoware::component_monitor::unit_conversions

Expand Down

0 comments on commit a1cba1f

Please sign in to comment.