Skip to content

Commit

Permalink
Fix some compiler warnings in mqb (bloomberg#455)
Browse files Browse the repository at this point in the history
* -Wunused-parameter
* -Wshadow
* -Wswitch-enum

Signed-off-by: Christopher Beard <[email protected]>
  • Loading branch information
chrisbeard authored Oct 10, 2024
1 parent 060cd9f commit 01693b0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 30 deletions.
2 changes: 0 additions & 2 deletions src/groups/mqb/mqba/mqba_domainresolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ int DomainResolver::getOrRead(bsl::ostream& errorDescription,
bsl::string filePath = mqbcfg::BrokerConfig::get().etcDir() +
"/domains/" + resolvedDomainName + ".json";

bdlma::LocalSequentialAllocator<1024> localAllocator(d_allocator_p);

// This is copy-pasted from mqba_configprovider.cpp. Maybe we are
// going to merge the two? If not, consider factoring this bit.
if (!bdls::FilesystemUtil::exists(filePath)) {
Expand Down
20 changes: 9 additions & 11 deletions src/groups/mqb/mqbblp/mqbblp_clusterproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,22 +717,20 @@ inline size_t ClusterProxy::ChannelBuffer::bytes() const
// class ClusterProxy
// ------------------

inline void
ClusterProxy::getPrimaryNodes(int* rc,
bsl::ostream& errorDescription,
bsl::vector<mqbnet::ClusterNode*>* nodes,
bool* isSelfPrimary) const
inline void ClusterProxy::getPrimaryNodes(int*,
bsl::ostream&,
bsl::vector<mqbnet::ClusterNode*>*,
bool*) const
{
// no implementation -- this should not run.
BSLS_ASSERT_SAFE(false);
}

inline void
ClusterProxy::getPartitionPrimaryNode(int* rc,
bsl::ostream& errorDescription,
mqbnet::ClusterNode** node,
bool* isSelfPrimary,
int partitionId) const
inline void ClusterProxy::getPartitionPrimaryNode(int*,
bsl::ostream&,
mqbnet::ClusterNode**,
bool*,
int) const
{
// no implementation -- this should not run.
BSLS_ASSERT_SAFE(false);
Expand Down
7 changes: 4 additions & 3 deletions src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,9 +1795,9 @@ RelayQueueEngine::push(mqbi::StorageMessageAttributes* attributes,
PushStream::Apps::iterator itApp = d_pushStream.d_apps.find(
subQueueId);
if (itApp == d_pushStream.d_apps.end()) {
AppsMap::const_iterator cit = d_apps.find(subQueueId);
AppsMap::const_iterator app_cit = d_apps.find(subQueueId);

if (cit == d_apps.end()) {
if (app_cit == d_apps.end()) {
BMQ_LOGTHROTTLE_ERROR()
<< "#QUEUE_UNKNOWN_SUBSCRIPTION_ID "
<< "Remote queue: " << d_queueState_p->uri()
Expand All @@ -1807,7 +1807,8 @@ RelayQueueEngine::push(mqbi::StorageMessageAttributes* attributes,
continue; // CONTINUE
}

itApp = d_pushStream.d_apps.emplace(subQueueId, cit->second).first;
itApp =
d_pushStream.d_apps.emplace(subQueueId, app_cit->second).first;
}
else if (!checkForDuplicate(itApp->second.d_app.get(), msgGUID)) {
continue; // CONTINUE
Expand Down
18 changes: 9 additions & 9 deletions src/groups/mqb/mqbmock/mqbmock_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,20 +611,20 @@ inline void Cluster::advanceTime(const bsls::TimeInterval& interval)
d_timeSource.advanceTime(interval);
}

inline void Cluster::getPrimaryNodes(int* rc,
bsl::ostream& errorDescription,
bsl::vector<mqbnet::ClusterNode*>* nodes,
bool* isSelfPrimary) const
inline void Cluster::getPrimaryNodes(int*,
bsl::ostream&,
bsl::vector<mqbnet::ClusterNode*>*,
bool*) const
{
// no implementation -- this should never run.
BSLS_ASSERT_SAFE(false);
}

inline void Cluster::getPartitionPrimaryNode(int* rc,
bsl::ostream& errorDescription,
mqbnet::ClusterNode** node,
bool* isSelfPrimary,
int partitionId) const
inline void Cluster::getPartitionPrimaryNode(int*,
bsl::ostream&,
mqbnet::ClusterNode**,
bool*,
int) const
{
// no implementation -- this should never run.
BSLS_ASSERT_SAFE(false);
Expand Down
10 changes: 5 additions & 5 deletions src/groups/mqb/mqbs/mqbs_filebackedstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,14 +736,14 @@ void FileBackedStorage::processMessageRecord(
&dataStreamMessage);

// Move auto confirms to the data record
for (AutoConfirms::const_iterator it =
for (AutoConfirms::const_iterator cit =
d_autoConfirms.begin();
it != d_autoConfirms.end();
++it) {
cit != d_autoConfirms.end();
++cit) {
irc.first->second.d_array.push_back(
it->d_confirmRecordHandle);
cit->d_confirmRecordHandle);
d_virtualStorageCatalog.autoConfirm(dataStreamMessage,
it->d_appKey);
cit->d_appKey);
}
}
else {
Expand Down
1 change: 1 addition & 0 deletions src/groups/mqb/mqbs/mqbs_filestoreprotocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ const char* ConfirmReason::toAscii(ConfirmReason::Enum value)
switch (value) {
CASE(CONFIRMED)
CASE(REJECTED)
CASE(AUTO_CONFIRMED)
default: return "(* UNKNOWN *)";
}

Expand Down

0 comments on commit 01693b0

Please sign in to comment.