diff --git a/dds/DCPS/DataReaderImpl_T.h b/dds/DCPS/DataReaderImpl_T.h index e2c8b375c4..6fca0b9589 100644 --- a/dds/DCPS/DataReaderImpl_T.h +++ b/dds/DCPS/DataReaderImpl_T.h @@ -1852,7 +1852,7 @@ void store_instance_data(unique_ptr instance_data, const std::pair bpair = instances_.insert(typename SubscriptionInstanceMapType::value_type(handle, instance)); - if (bpair.second == false) { + if (!bpair.second) { if (DCPS_debug_level > 0) { ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ") @@ -1875,9 +1875,9 @@ void store_instance_data(unique_ptr instance_data, } if (new_handle) { - const std::pair bpair = + const std::pair res = inst->insert(typename InstanceMap::value_type(*instance_data, handle)); - if (!bpair.second) { + if (!res.second) { if (DCPS_debug_level > 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT("(%P|%t) ") @@ -1908,7 +1908,7 @@ void store_instance_data(unique_ptr instance_data, std::pair bpair = instance_map_.insert(typename InstanceMap::value_type(*instance_data, handle)); - if (bpair.second == false) + if (!bpair.second) { if (DCPS_debug_level > 0) { ACE_ERROR ((LM_ERROR, diff --git a/dds/DCPS/RTPS/Spdp.cpp b/dds/DCPS/RTPS/Spdp.cpp index 2fc8944254..5924d62785 100644 --- a/dds/DCPS/RTPS/Spdp.cpp +++ b/dds/DCPS/RTPS/Spdp.cpp @@ -4681,14 +4681,14 @@ DDS::ParticipantBuiltinTopicData Spdp::get_part_bit_data(bool secure) const VendorId_t Spdp::get_vendor_id(const GUID_t& guid) const { - const VendorId_t unknown_vendor = { 0, 0 }; + const VendorId_t unknown_vendor = {{ 0, 0 }}; ACE_GUARD_RETURN(ACE_Thread_Mutex, g, lock_, unknown_vendor); return get_vendor_id_i(guid); } VendorId_t Spdp::get_vendor_id_i(const GUID_t& guid) const { - const VendorId_t unknown_vendor = { 0, 0 }; + const VendorId_t unknown_vendor = {{ 0, 0 }}; DiscoveredParticipantConstIter iter = participants_.find(make_part_guid(guid)); if (iter != participants_.end()) { return iter->second.pdata_.participantProxy.vendorId; diff --git a/dds/DCPS/Serializer.inl b/dds/DCPS/Serializer.inl index f28889fe6a..a7e231db92 100644 --- a/dds/DCPS/Serializer.inl +++ b/dds/DCPS/Serializer.inl @@ -408,7 +408,7 @@ Serializer::skip(size_t n, int size) return false; } - for (size_t len = static_cast(n * size); len;) { + for (size_t len = n * static_cast(size); len;) { if (!current_) { good_bit_ = false; return false; @@ -425,7 +425,7 @@ Serializer::skip(size_t n, int size) } if (good_bit_) { - rpos_ += n * size; + rpos_ += n * static_cast(size); } return good_bit(); } @@ -783,7 +783,7 @@ bool Serializer::align_r(size_t al) } al = (std::min)(al, encoding().max_align()); const size_t len = - (al - ptrdiff_t(current_->rd_ptr()) + align_rshift_) % al; + (al - reinterpret_cast(current_->rd_ptr()) + align_rshift_) % al; return skip(static_cast(len)); } @@ -800,7 +800,7 @@ bool Serializer::align_w(size_t al) } al = (std::min)(al, encoding().max_align()); size_t len = - (al - ptrdiff_t(current_->wr_ptr()) + align_wshift_) % al; + (al - reinterpret_cast(current_->wr_ptr()) + align_wshift_) % al; while (len) { if (!current_) { good_bit_ = false; @@ -830,7 +830,7 @@ bool Serializer::align_w(size_t al) ACE_INLINE unsigned char Serializer::offset(char* index, size_t start, size_t align) { - return static_cast((ptrdiff_t(index) - start) % align); + return static_cast((reinterpret_cast(index) - start) % align); } ACE_INLINE void @@ -838,7 +838,7 @@ Serializer::align_cont_r() { const size_t max_align = encoding().max_align(); const size_t thisblock = - max_align ? (ptrdiff_t(current_->rd_ptr()) - align_rshift_) % max_align : 0; + max_align ? (reinterpret_cast(current_->rd_ptr()) - align_rshift_) % max_align : 0; current_ = current_->cont(); @@ -852,7 +852,7 @@ Serializer::align_cont_w() { const size_t max_align = encoding().max_align(); const size_t thisblock = - max_align ? (ptrdiff_t(current_->wr_ptr()) - align_wshift_) % max_align : 0; + max_align ? (reinterpret_cast(current_->wr_ptr()) - align_wshift_) % max_align : 0; current_ = current_->cont(); diff --git a/dds/idl/marshal_generator.cpp b/dds/idl/marshal_generator.cpp index ef89b37bbc..ce2c6b1a85 100644 --- a/dds/idl/marshal_generator.cpp +++ b/dds/idl/marshal_generator.cpp @@ -768,6 +768,7 @@ namespace { " return strm.read_" << getSerializerName(elem) << "_array(" << get_buffer << ", length);\n"; } + return; } } else if (elem_cls & CL_INTERFACE) { be_global->impl_ <<