From ef24624ce4c81183aefbeaa09694c14458919fc0 Mon Sep 17 00:00:00 2001 From: Son Dinh Date: Wed, 21 Aug 2024 09:33:20 -0500 Subject: [PATCH] Loss of data warnings --- dds/DCPS/RTPS/RtpsDiscoveryConfig.cpp | 30 +++++++++---------- .../transport/multicast/MulticastInst.cpp | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dds/DCPS/RTPS/RtpsDiscoveryConfig.cpp b/dds/DCPS/RTPS/RtpsDiscoveryConfig.cpp index b3b142ff236..c652c45e9e6 100644 --- a/dds/DCPS/RTPS/RtpsDiscoveryConfig.cpp +++ b/dds/DCPS/RTPS/RtpsDiscoveryConfig.cpp @@ -192,8 +192,8 @@ void RtpsDiscoveryConfig::sedp_port_mode(PortMode value) DDS::UInt16 RtpsDiscoveryConfig::pb() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("PB").c_str(), - default_port_base); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("PB").c_str(), + default_port_base)); } void @@ -206,8 +206,8 @@ RtpsDiscoveryConfig::pb(DDS::UInt16 port_base) DDS::UInt16 RtpsDiscoveryConfig::dg() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("DG").c_str(), - default_domain_gain); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("DG").c_str(), + default_domain_gain)); } void @@ -220,8 +220,8 @@ RtpsDiscoveryConfig::dg(DDS::UInt16 domain_gain) DDS::UInt16 RtpsDiscoveryConfig::pg() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("PG").c_str(), - default_part_gain); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("PG").c_str(), + default_part_gain)); } void @@ -241,8 +241,8 @@ RtpsDiscoveryConfig::d0() const default_value = static_cast(std::atoi(from_env)); } #endif - return TheServiceParticipant->config_store()->get_uint32(config_key("D0").c_str(), - default_value); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("D0").c_str(), + default_value)); } void @@ -255,8 +255,8 @@ RtpsDiscoveryConfig::d0(DDS::UInt16 spdp_multicast_offset) DDS::UInt16 RtpsDiscoveryConfig::d1() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("D1").c_str(), - default_spdp_unicast_offset); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("D1").c_str(), + default_spdp_unicast_offset)); } void @@ -268,8 +268,8 @@ RtpsDiscoveryConfig::d1(DDS::UInt16 spdp_unicast_offset) DDS::UInt16 RtpsDiscoveryConfig::dx() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("DX").c_str(), - default_sedp_multicast_offset); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("DX").c_str(), + default_sedp_multicast_offset)); } void @@ -282,8 +282,8 @@ RtpsDiscoveryConfig::dx(DDS::UInt16 sedp_multicast_offset) DDS::UInt16 RtpsDiscoveryConfig::dy() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("DY").c_str(), - default_sedp_unicast_offset); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("DY").c_str(), + default_sedp_unicast_offset)); } void @@ -309,7 +309,7 @@ bool RtpsDiscoveryConfig::set_spdp_unicast_port(DCPS::NetworkAddress& addr, bool unsigned char RtpsDiscoveryConfig::ttl() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("TTL").c_str(), 1); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("TTL").c_str(), 1)); } void diff --git a/dds/DCPS/transport/multicast/MulticastInst.cpp b/dds/DCPS/transport/multicast/MulticastInst.cpp index ddb8bc73838..02e99629799 100644 --- a/dds/DCPS/transport/multicast/MulticastInst.cpp +++ b/dds/DCPS/transport/multicast/MulticastInst.cpp @@ -156,7 +156,7 @@ MulticastInst::port_offset(u_short po) u_short MulticastInst::port_offset() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("PORT_OFFSET").c_str(), DEFAULT_PORT_OFFSET); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("PORT_OFFSET").c_str(), DEFAULT_PORT_OFFSET)); } void @@ -338,7 +338,7 @@ MulticastInst::ttl(unsigned char t) unsigned char MulticastInst::ttl() const { - return TheServiceParticipant->config_store()->get_uint32(config_key("TTL").c_str(), DEFAULT_TTL); + return static_cast(TheServiceParticipant->config_store()->get_uint32(config_key("TTL").c_str(), DEFAULT_TTL)); } void