diff --git a/rmw_fastrtps_shared_cpp/src/TypeSupport_impl.cpp b/rmw_fastrtps_shared_cpp/src/TypeSupport_impl.cpp index 3212b4a76..32a658207 100644 --- a/rmw_fastrtps_shared_cpp/src/TypeSupport_impl.cpp +++ b/rmw_fastrtps_shared_cpp/src/TypeSupport_impl.cpp @@ -179,9 +179,9 @@ uint32_t TypeSupport::calculate_serialized_size( uint32_t ser_size {0}; if (ser_data->type == FASTDDS_SERIALIZED_DATA_TYPE_CDR_BUFFER) { auto ser = static_cast(ser_data->data); - ser_size = ser->get_serialized_data_length(); + ser_size = static_cast(ser->get_serialized_data_length()); } else { - ser_size = this->getEstimatedSerializedSize(ser_data->data, ser_data->impl); + ser_size = static_cast(this->getEstimatedSerializedSize(ser_data->data, ser_data->impl)); } return ser_size; }