Skip to content

Commit

Permalink
More warnings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sonndinh committed Aug 7, 2024
1 parent a0f6cb7 commit f938fa6
Show file tree
Hide file tree
Showing 18 changed files with 111 additions and 115 deletions.
2 changes: 1 addition & 1 deletion dds/DCPS/MultiTopicDataReader_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ MultiTopicDataReader_T<Sample, TypedDataReader>::join(
for (InstanceHandle_t ih = HANDLE_NIL; ret != RETCODE_NO_DATA;) {
GenericData other_data(other_meta, false);
SampleInfo info;
const ReturnCode_t ret = other_dri->read_next_instance_generic(other_data.ptr_,
ret = other_dri->read_next_instance_generic(other_data.ptr_,
info, ih, READ_SAMPLE_STATE, ANY_VIEW_STATE, ALIVE_INSTANCE_STATE);
if (ret != RETCODE_OK && ret != RETCODE_NO_DATA) {
if (log_level >= LogLevel::Notice) {
Expand Down
4 changes: 1 addition & 3 deletions dds/DCPS/NetworkResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,13 +904,11 @@ int locator_to_address(ACE_INET_Addr& dest,
) == -1) {
return -1;
}
dest.set_port_number(locator.port);
dest.set_port_number(static_cast<u_short>(locator.port));
return 0;
default:
return -1; // Unknown kind
}

return -1;
}

OpenDDS_Dcps_Export
Expand Down
10 changes: 4 additions & 6 deletions dds/DCPS/OwnershipManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,10 @@ OwnershipManager::select_owner(const DDS::InstanceHandle_t& instance_handle,
// if strength was changed.
const WriterInfos::iterator the_end = infos.candidates_.end();

for (WriterInfos::iterator iter = infos.candidates_.begin();
iter != the_end; ++iter) {

if (iter->pub_id_ == pub_id) {
if (iter->ownership_strength_ != ownership_strength) {
iter->ownership_strength_ = ownership_strength;
for (WriterInfos::iterator it = infos.candidates_.begin(); it != the_end; ++it) {
if (it->pub_id_ == pub_id) {
if (it->ownership_strength_ != ownership_strength) {
it->ownership_strength_ = ownership_strength;
} else {
sort = false;
}
Expand Down
4 changes: 2 additions & 2 deletions dds/DCPS/PublisherImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ PublisherImpl::set_qos(const DDS::PublisherQos & qos)
for (PublicationMap::iterator iter = publication_map_.begin();
iter != publication_map_.end();
++iter) {
DDS::DataWriterQos qos = iter->second->qos_;
DDS::DataWriterQos dw_qos = iter->second->qos_;
GUID_t id = iter->second->get_guid();
std::pair<DwIdToQosMap::iterator, bool> pair =
idToQosMap.insert(DwIdToQosMap::value_type(id, qos));
idToQosMap.insert(DwIdToQosMap::value_type(id, dw_qos));

if (!pair.second) {
if (DCPS_debug_level > 0) {
Expand Down
6 changes: 3 additions & 3 deletions dds/DCPS/RTPS/Spdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3191,9 +3191,9 @@ Spdp::SpdpTransport::handle_input(ACE_HANDLE h)
plist[len].user_tag(userTag);
}

DCPS::RcHandle<Spdp> outer = outer_.lock();
if (outer) {
outer->data_received(data, plist, remote_na);
DCPS::RcHandle<Spdp> outer_rc = outer_.lock();
if (outer_rc) {
outer_rc->data_received(data, plist, remote_na);
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions dds/DCPS/Service_Participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ String toupper(const String& x)
{
String retval;
for (String::const_iterator pos = x.begin(), limit = x.end(); pos != limit; ++pos) {
retval.push_back(ACE_OS::ace_toupper(*pos));
retval.push_back(static_cast<char>(ACE_OS::ace_toupper(*pos)));
}
return retval;
}
Expand Down Expand Up @@ -296,7 +296,7 @@ DDS::ReturnCode_t Service_Participant::shutdown()
domainRepoMap_.clear();

{
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, network_config_monitor_lock_,
ACE_GUARD_RETURN(ACE_Thread_Mutex, ncm_guard, network_config_monitor_lock_,
DDS::RETCODE_OUT_OF_RESOURCES);
if (network_config_monitor_) {
network_config_monitor_->close();
Expand Down
54 changes: 27 additions & 27 deletions dds/DCPS/StaticDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ StaticEndpointManager::add_publication_i(const GUID_t& writerid,
}
const EndpointRegistry::Writer& writer = pos->second;

for (RepoIdSet::const_iterator pos = writer.best_effort_readers.begin(), limit = writer.best_effort_readers.end();
pos != limit;
++pos) {
const GUID_t& readerid = *pos;
for (RepoIdSet::const_iterator iter = writer.best_effort_readers.begin(), limit = writer.best_effort_readers.end();
iter != limit;
++iter) {
const GUID_t& readerid = *iter;
const EndpointRegistry::Reader& reader = registry_.reader_map.find(readerid)->second;

const ReaderAssociation ra =
Expand All @@ -361,10 +361,10 @@ StaticEndpointManager::add_publication_i(const GUID_t& writerid,
}
}

for (RepoIdSet::const_iterator pos = writer.reliable_readers.begin(), limit = writer.reliable_readers.end();
pos != limit;
++pos) {
const GUID_t& readerid = *pos;
for (RepoIdSet::const_iterator iter = writer.reliable_readers.begin(), limit = writer.reliable_readers.end();
iter != limit;
++iter) {
const GUID_t& readerid = *iter;
const EndpointRegistry::Reader& reader = registry_.reader_map.find(readerid)->second;
DataWriterCallbacks_rch pl = pub.publication_.lock();
if (pl) {
Expand All @@ -388,10 +388,10 @@ StaticEndpointManager::remove_publication_i(const GUID_t& writerid, LocalPublica
ReaderIdSeq ids;
ids.length((CORBA::ULong)writer.reliable_readers.size());
CORBA::ULong idx = 0;
for (RepoIdSet::const_iterator pos = writer.reliable_readers.begin(), limit = writer.reliable_readers.end();
pos != limit;
++pos, ++idx) {
const GUID_t& readerid = *pos;
for (RepoIdSet::const_iterator iter = writer.reliable_readers.begin(), limit = writer.reliable_readers.end();
iter != limit;
++iter, ++idx) {
const GUID_t& readerid = *iter;
ids[idx] = readerid;
DataWriterCallbacks_rch pl = pub.publication_.lock();
if (pl) {
Expand All @@ -417,10 +417,10 @@ StaticEndpointManager::add_subscription_i(const GUID_t& readerid,
}
const EndpointRegistry::Reader& reader = pos->second;

for (RepoIdSet::const_iterator pos = reader.best_effort_writers.begin(), limit = reader.best_effort_writers.end();
pos != limit;
++pos) {
const GUID_t& writerid = *pos;
for (RepoIdSet::const_iterator iter = reader.best_effort_writers.begin(), limit = reader.best_effort_writers.end();
iter != limit;
++iter) {
const GUID_t& writerid = *iter;
const EndpointRegistry::Writer& writer = registry_.writer_map.find(writerid)->second;

DDS::OctetSeq type_info;
Expand All @@ -433,10 +433,10 @@ StaticEndpointManager::add_subscription_i(const GUID_t& readerid,
}
}

for (RepoIdSet::const_iterator pos = reader.reliable_writers.begin(), limit = reader.reliable_writers.end();
pos != limit;
++pos) {
const GUID_t& writerid = *pos;
for (RepoIdSet::const_iterator iter = reader.reliable_writers.begin(), limit = reader.reliable_writers.end();
iter != limit;
++iter) {
const GUID_t& writerid = *iter;
const EndpointRegistry::Writer& writer = registry_.writer_map.find(writerid)->second;
DataReaderCallbacks_rch sl = sub.subscription_.lock();
if (sl) {
Expand All @@ -460,10 +460,10 @@ DDS::ReturnCode_t StaticEndpointManager::remove_subscription_i(
WriterIdSeq ids;
ids.length((CORBA::ULong)reader.reliable_writers.size());
CORBA::ULong idx = 0;
for (RepoIdSet::const_iterator pos = reader.reliable_writers.begin(), limit = reader.reliable_writers.end();
pos != limit;
++pos, ++idx) {
const GUID_t& writerid = *pos;
for (RepoIdSet::const_iterator iter = reader.reliable_writers.begin(), limit = reader.reliable_writers.end();
iter != limit;
++iter, ++idx) {
const GUID_t& writerid = *iter;
ids[idx] = writerid;
DataReaderCallbacks_rch sl = sub.subscription_.lock();
if (sl) {
Expand Down Expand Up @@ -2032,9 +2032,9 @@ StaticDiscovery::parse_endpoints()
const ConfigStoreImpl::StringList sections = config_store->get_section_names("ENDPOINT");

// Loop through the [endpoint/*] sections
for (ConfigStoreImpl::StringList::const_iterator pos = sections.begin(), limit = sections.end();
pos != limit; ++pos) {
const String& endpoint_name = *pos;
for (ConfigStoreImpl::StringList::const_iterator iter = sections.begin(), limit = sections.end();
iter != limit; ++iter) {
const String& endpoint_name = *iter;

if (DCPS_debug_level > 0) {
ACE_DEBUG((LM_NOTICE,
Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/WriteDataContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ WriteDataContainer::reenqueue_all(const GUID_t& reader_id,
total_size);

{
ACE_Guard<ACE_SYNCH_MUTEX> guard(wfa_lock_);
ACE_Guard<ACE_SYNCH_MUTEX> wfa_guard(wfa_lock_);
cached_cumulative_ack_valid_ = false;
DisjointSequence& ds = acked_sequences_[reader_id];
ds = acked_sequences_[GUID_UNKNOWN];
Expand Down
4 changes: 2 additions & 2 deletions dds/DCPS/XTypes/DynamicDataAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ DDS::MemberId DynamicDataAdapter::get_member_id_at_index(DDS::UInt32 index)
} else if (index == 1) {
bool branch_active;
DDS::MemberDescriptor_var active_branch;
DDS::ReturnCode_t rc = get_selected_union_branch(branch_active, active_branch);
rc = get_selected_union_branch(branch_active, active_branch);
if (rc != DDS::RETCODE_OK) {
if (DCPS::log_level >= DCPS::LogLevel::Warning) {
const CORBA::String_var type_name = type_->get_name();
Expand Down Expand Up @@ -158,7 +158,7 @@ DDS::MemberId DynamicDataAdapter::get_member_id_at_index(DDS::UInt32 index)
return get_member_id_at_index_impl(index);
case TK_ARRAY:
{
DDS::ReturnCode_t rc = check_index("get_member_id_at_index", index, bound_total(type_desc_));
rc = check_index("get_member_id_at_index", index, bound_total(type_desc_));
if (rc != DDS::RETCODE_OK) {
if (DCPS::log_level >= DCPS::LogLevel::Warning) {
const CORBA::String_var type_name = type_->get_name();
Expand Down
26 changes: 13 additions & 13 deletions dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ DDS::ReturnCode_t DynamicDataXcdrReadImpl::get_values_from_struct(SequenceType&
}
const LBound bit_bound = etd->bound()[0];
if (bit_bound >= lower && bit_bound <= upper) {
const DDS::ReturnCode_t rc = skip_to_struct_member(md, id);
rc = skip_to_struct_member(md, id);
if (rc != DDS::RETCODE_OK) {
return rc;
}
Expand Down Expand Up @@ -1912,11 +1912,11 @@ bool DynamicDataXcdrReadImpl::get_values_from_sequence(SequenceType& value, Memb
return skip_to_sequence_element(id) && read_values(value, ElementTypeKind);
} else if (nested_elem_tk == enum_or_bitmask) {
// Read from a sequence of sequences of enums or bitmasks.
DDS::TypeDescriptor_var td;
if (nested_elem_type->get_descriptor(td) != DDS::RETCODE_OK) {
DDS::TypeDescriptor_var nested_td;
if (nested_elem_type->get_descriptor(nested_td) != DDS::RETCODE_OK) {
return false;
}
const LBound bit_bound = td->bound()[0];
const LBound bit_bound = nested_td->bound()[0];
return bit_bound >= lower && bit_bound <= upper &&
skip_to_sequence_element(id) && read_values(value, enum_or_bitmask);
}
Expand Down Expand Up @@ -1953,11 +1953,11 @@ bool DynamicDataXcdrReadImpl::get_values_from_array(SequenceType& value, MemberI
if (nested_elem_tk == ElementTypeKind) {
return skip_to_array_element(id) && read_values(value, nested_elem_tk);
} else if (nested_elem_tk == enum_or_bitmask) {
DDS::TypeDescriptor_var td;
if (nested_elem_type->get_descriptor(td) != DDS::RETCODE_OK) {
DDS::TypeDescriptor_var nested_td;
if (nested_elem_type->get_descriptor(neste_td) != DDS::RETCODE_OK) {

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / u22

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / u22_no_features

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / u22_stat

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / u22_android29

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_clang12_i0w1_sec

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_clang10_sec_js0

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_i0_xer0_js0_j17

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w19_p1_stat_js0

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_m13_j_FM-1f

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_ace7_j_qt_ws_sec

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_gcc9_d0w1_cpp03

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / w22_stat

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_m12_o1d0_sec

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_d0i0v1_sec_js0_FM-08

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_p1_asan_sec

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_gcc8_i0_js0_j

‘neste_td’ was not declared in this scope

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / w22_rel

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / w22

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_p1_ubsan_sec

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / w22_rel_stat

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_o1d0v1_xer0_j11

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_p1_tsan_sec

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_w1_j_FM-2f

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_m13_sec

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_w1a1_sec

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_stat_qt_ws_sec

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_j_cft0_FM-37

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w19_re_p1_stat_FM-08

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u22_i0_xer0

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_m12_i0_j_FM-1f

use of undeclared identifier 'neste_td'; did you mean 'nested_td'?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_p1_j8_FM-1f

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_u20_p1_sec

‘neste_td’ was not declared in this scope; did you mean ‘nested_td’?

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w19_re_j_ws_FM-1f

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w19_re_o1p1_sec

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w22_p1

'neste_td': undeclared identifier [D:\a\OpenDDS\OpenDDS\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w22_p1

'neste_td': identifier not found [D:\a\OpenDDS\OpenDDS\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w22_x86_i0_sec

'neste_td': undeclared identifier [C:\OpenDDS\dds\OpenDDS_Dcps.vcxproj]

Check failure on line 1957 in dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp

View workflow job for this annotation

GitHub Actions / build_w22_x86_i0_j_FM-1f

'neste_td': undeclared identifier [C:\OpenDDS\dds\OpenDDS_Dcps.vcxproj]
return false;
}
const LBound bit_bound = td->bound()[0];
const LBound bit_bound = nested_td->bound()[0];
return bit_bound >= lower && bit_bound <= upper &&
skip_to_array_element(id) && read_values(value, nested_elem_tk);
}
Expand Down Expand Up @@ -1993,11 +1993,11 @@ bool DynamicDataXcdrReadImpl::get_values_from_map(SequenceType& value, MemberId
if (nested_elem_tk == ElementTypeKind) {
return skip_to_map_element(id) && read_values(value, nested_elem_tk);
} else if (nested_elem_tk == enum_or_bitmask) {
DDS::TypeDescriptor_var td;
if (nested_elem_type->get_descriptor(td) != DDS::RETCODE_OK) {
DDS::TypeDescriptor_var nested_td;
if (nested_elem_type->get_descriptor(nested_td) != DDS::RETCODE_OK) {
return false;
}
const LBound bit_bound = td->bound()[0];
const LBound bit_bound = nested_td->bound()[0];
return bit_bound >= lower && bit_bound <= upper &&
skip_to_map_element(id) && read_values(value, nested_elem_tk);
}
Expand Down Expand Up @@ -2905,11 +2905,11 @@ bool DynamicDataXcdrReadImpl::check_xcdr1_mutable_i(DDS::DynamicType_ptr dt, Dyn
}
return false;
}
DDS::MemberDescriptor_var descriptor;
if (dtm->get_descriptor(descriptor) != DDS::RETCODE_OK) {
DDS::MemberDescriptor_var mem_desc;
if (dtm->get_descriptor(mem_desc) != DDS::RETCODE_OK) {
return false;
}
if (!check_xcdr1_mutable_i(descriptor->type(), dtns)) {
if (!check_xcdr1_mutable_i(mem_desc->type(), dtns)) {
return false;
}
}
Expand Down
30 changes: 15 additions & 15 deletions dds/DCPS/XTypes/TypeAssignability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,9 @@ bool TypeAssignability::assignable_union(const MinimalTypeObject& ta,
for (unsigned k = 0; k < label_seq_b.length(); ++k) {
for (unsigned t = 0; t < label_seq_a.length(); ++t) {
if (label_seq_b.members[k] == label_seq_a.members[t]) {
const TypeIdentifier& tia = ta.union_type.member_seq[j].common.type_id;
const TypeIdentifier& tib = tb.union_type.member_seq[i].common.type_id;
if (!assignable(tia, tib)) {
const TypeIdentifier& ti_a = ta.union_type.member_seq[j].common.type_id;
const TypeIdentifier& ti_b = tb.union_type.member_seq[i].common.type_id;
if (!assignable(ti_a, ti_b)) {
return false;
}
matched = true;
Expand All @@ -795,18 +795,18 @@ bool TypeAssignability::assignable_union(const MinimalTypeObject& ta,
// the type of the member in T1 is assignable from the type of the default
// member in T2
for (unsigned i = 0; i < tb.union_type.member_seq.length(); ++i) {
const UnionMemberFlag& flags_b = tb.union_type.member_seq[i].common.member_flags;
if ((flags_b & IS_DEFAULT) == IS_DEFAULT) {
const UnionMemberFlag& mem_flags_b = tb.union_type.member_seq[i].common.member_flags;
if ((mem_flags_b & IS_DEFAULT) == IS_DEFAULT) {
const UnionCaseLabelSeq& label_seq_b = tb.union_type.member_seq[i].common.label_seq;
for (unsigned j = 0; j < ta.union_type.member_seq.length(); ++j) {
const UnionCaseLabelSeq& label_seq_a = ta.union_type.member_seq[j].common.label_seq;
bool matched = false;
for (unsigned k = 0; k < label_seq_a.length(); ++k) {
for (unsigned t = 0; t < label_seq_b.length(); ++t) {
if (label_seq_a[k] == label_seq_b[t]) {
const TypeIdentifier& tia = ta.union_type.member_seq[j].common.type_id;
const TypeIdentifier& tib = tb.union_type.member_seq[i].common.type_id;
if (!assignable(tia, tib)) {
const TypeIdentifier& ti_a = ta.union_type.member_seq[j].common.type_id;
const TypeIdentifier& ti_b = tb.union_type.member_seq[i].common.type_id;
if (!assignable(ti_a, ti_b)) {
return false;
}
matched = true;
Expand All @@ -823,14 +823,14 @@ bool TypeAssignability::assignable_union(const MinimalTypeObject& ta,
// If T1 and T2 both have default labels, the type of T1's default member
// is assignable from the type of T2's default member
for (unsigned i = 0; i < ta.union_type.member_seq.length(); ++i) {
const UnionMemberFlag& flags_a = ta.union_type.member_seq[i].common.member_flags;
if ((flags_a & IS_DEFAULT) == IS_DEFAULT) {
const UnionMemberFlag& mem_flags_a = ta.union_type.member_seq[i].common.member_flags;
if ((mem_flags_a & IS_DEFAULT) == IS_DEFAULT) {
for (unsigned j = 0; j < tb.union_type.member_seq.length(); ++j) {
const UnionMemberFlag& flags_b = tb.union_type.member_seq[j].common.member_flags;
if ((flags_b & IS_DEFAULT) == IS_DEFAULT) {
const TypeIdentifier& tia = ta.union_type.member_seq[i].common.type_id;
const TypeIdentifier& tib = tb.union_type.member_seq[j].common.type_id;
if (!assignable(tia, tib)) {
const UnionMemberFlag& mem_flags_b = tb.union_type.member_seq[j].common.member_flags;
if ((mem_flags_b & IS_DEFAULT) == IS_DEFAULT) {
const TypeIdentifier& ti_a = ta.union_type.member_seq[i].common.type_id;
const TypeIdentifier& ti_b = tb.union_type.member_seq[j].common.type_id;
if (!assignable(ti_a, ti_b)) {
return false;
}
break;
Expand Down
4 changes: 2 additions & 2 deletions dds/DCPS/XTypes/TypeLookupService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,8 @@ void TypeLookupService::complete_to_dynamic_i(DynamicTypeImpl* dt,
md->name(cto.bitmask_type.flag_seq[i].detail.name.c_str());
// Use Id to convey the position of bit flag.
md->id(cto.bitmask_type.flag_seq[i].common.position);
const DDS::DynamicType_var temp = type_identifier_to_dynamic(TypeIdentifier(TK_BOOLEAN), guid);
md->type(temp);
const DDS::DynamicType_var temp2 = type_identifier_to_dynamic(TypeIdentifier(TK_BOOLEAN), guid);
md->type(temp2);
md->index(i);
dtm->set_descriptor(md);
dt->insert_dynamic_member(dtm);
Expand Down
Loading

0 comments on commit f938fa6

Please sign in to comment.