Skip to content

Commit

Permalink
Correct std::hash return type sizes (eclipse-cyclonedds#102)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll authored Feb 18, 2020
1 parent 275d3dd commit 7d4e172
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rmw_cyclonedds_cpp/src/serdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,10 @@ bool sertopic_rmw_equal(
uint32_t sertopic_rmw_hash(const struct ddsi_sertopic * tpcmn)
{
const struct sertopic_rmw * tp = static_cast<const struct sertopic_rmw *>(tpcmn);
uint32_t h2 = std::hash<bool>{} (tp->is_request_header);
uint32_t h1 = std::hash<std::string>{} (std::string(tp->type_support.typesupport_identifier_));
uint32_t h2 = static_cast<uint32_t>(std::hash<bool>{} (tp->is_request_header));
uint32_t h1 =
static_cast<uint32_t>(std::hash<std::string>{} (std::string(
tp->type_support.typesupport_identifier_)));
return h1 ^ h2;
}
#endif
Expand Down

0 comments on commit 7d4e172

Please sign in to comment.