Skip to content

Commit

Permalink
Fix: bmqp messageproperties Wconv warns update
Browse files Browse the repository at this point in the history
Signed-off-by: Melvin He <[email protected]>
  • Loading branch information
melvinhe committed May 6, 2024
1 parent f2e7da8 commit e88635b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/groups/bmq/bmqp/bmqp_messageproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ MessageProperties::setProperty(const bsl::string& name, const TYPE& value)
d_isDirty = true;
}
else {
delta += static_cast<int>(name.length()) +
sizeof(MessagePropertyHeader);
delta += static_cast<int>(name.length() +
sizeof(MessagePropertyHeader));
if (0 == numProperties()) {
// If its the 1st property, also include the size of struct
// 'MessagePropertiesHeader'.
Expand Down
6 changes: 4 additions & 2 deletions src/groups/bmq/bmqp/bmqp_messageproperties.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void encode(bdlbb::Blob* blob, const PropertyMap& pmap)
bmqp::MessagePropertyHeader mph;
mph.setPropertyType(tsvPair.first.first);
mph.setPropertyNameLength(static_cast<int>(cit->first.length()));
mph.setPropertyValueLength(tsvPair.first.second);
mph.setPropertyValueLength(static_cast<int>(tsvPair.first.second));

bdlbb::BlobUtil::append(blob,
reinterpret_cast<const char*>(&mph),
Expand All @@ -429,7 +429,9 @@ void encode(bdlbb::Blob* blob, const PropertyMap& pmap)
// Second pass.
for (PropertyMapConstIter cit = pmap.begin(); cit != pmap.end(); ++cit) {
const PropertyTypeSizeVariantPair& tsvPair = cit->second;
bdlbb::BlobUtil::append(blob, cit->first.c_str(), cit->first.length());
bdlbb::BlobUtil::append(blob,
cit->first.c_str(),
static_cast<int>(cit->first.length()));
totalSize += static_cast<int>(cit->first.length());

PropertyValueStreamOutVisitor visitor(blob);
Expand Down

0 comments on commit e88635b

Please sign in to comment.