Skip to content

Commit

Permalink
Fix warning "Use of BITWISE AND to check if a flag is set" (#849)
Browse files Browse the repository at this point in the history
Signed-off-by: Tahar Touati <touati.thr@gmail.com>
  • Loading branch information
thrtouati committed May 10, 2023
1 parent 87b883f commit 8f4432a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions compendium/ConfigurationAdmin/src/CMActivator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace cppmicroservices
// manually
for (auto const& bundle : context.GetBundles())
{
if (cppmicroservices::Bundle::State::STATE_ACTIVE == bundle.GetState())
if (cppmicroservices::Bundle::State::STATE_ACTIVE & bundle.GetState())
{
cppmicroservices::BundleEvent evt(cppmicroservices::BundleEvent::BUNDLE_STARTED, bundle);
BundleChanged(evt);
Expand Down Expand Up @@ -178,11 +178,11 @@ namespace cppmicroservices
}

// TODO: revisit to include LAZY_ACTIVATION when supported by the framework
if (cppmicroservices::BundleEvent::BUNDLE_STARTED == eventType)
if (cppmicroservices::BundleEvent::BUNDLE_STARTED & eventType)
{
CreateExtension(bundle);
}
else if (cppmicroservices::BundleEvent::BUNDLE_STOPPING == eventType)
else if (cppmicroservices::BundleEvent::BUNDLE_STOPPING & eventType)
{
RemoveExtension(bundle);
}
Expand Down
6 changes: 3 additions & 3 deletions compendium/DeclarativeServices/src/SCRActivator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace cppmicroservices
// manually
for (auto const& bundle : context.GetBundles())
{
if (bundle.GetState() == cppmicroservices::Bundle::State::STATE_ACTIVE)
if (bundle.GetState() & cppmicroservices::Bundle::State::STATE_ACTIVE)
{
cppmicroservices::BundleEvent evt(cppmicroservices::BundleEvent::BUNDLE_STARTED, bundle);
BundleChanged(evt);
Expand Down Expand Up @@ -215,11 +215,11 @@ namespace cppmicroservices
}

// TODO: revisit to include LAZY_ACTIVATION when supported by the framework
if (eventType == cppmicroservices::BundleEvent::BUNDLE_STARTED)
if (eventType & cppmicroservices::BundleEvent::BUNDLE_STARTED)
{
CreateExtension(bundle);
}
else if (eventType == cppmicroservices::BundleEvent::BUNDLE_STOPPING)
else if (eventType & cppmicroservices::BundleEvent::BUNDLE_STOPPING)
{
DisposeExtension(bundle);
}
Expand Down

0 comments on commit 8f4432a

Please sign in to comment.