Skip to content

Commit 60967e1

Browse files
committed
Fix wrong use of ret code enumeration in logs
Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com>
1 parent ecfc750 commit 60967e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cpp_utils/include/cpp_utils/ReturnCode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ReturnCode
8282
protected:
8383

8484
//! Link every ReturnCode available with a string to deserialize
85-
static const std::map<ReturnCode, std::string> to_string_conversion_;
85+
static const std::map<ReturnCodeValue, std::string> to_string_conversion_;
8686

8787
//! \c ReturnCode value
8888
std::uint32_t value_;

cpp_utils/src/cpp/ReturnCode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool ReturnCode::operator !() const noexcept
8989
return value_ != ReturnCode::RETCODE_OK;
9090
}
9191

92-
const std::map<ReturnCode, std::string> ReturnCode::to_string_conversion_ =
92+
const std::map<ReturnCode::ReturnCodeValue, std::string> ReturnCode::to_string_conversion_ =
9393
{
9494
{ReturnCode::RETCODE_OK, "Ok"},
9595
{ReturnCode::RETCODE_ERROR, "Error"},
@@ -103,7 +103,7 @@ std::ostream& operator <<(
103103
std::ostream& os,
104104
const ReturnCode& code)
105105
{
106-
auto it = ReturnCode::to_string_conversion_.find(code);
106+
auto it = ReturnCode::to_string_conversion_.find(static_cast<ReturnCode::ReturnCodeValue>((code())));
107107
assert(it != ReturnCode::to_string_conversion_.end());
108108
os << "{" << it->second << "}";
109109
return os;

0 commit comments

Comments
 (0)