Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIMULATION] [LLVM 14] bitwise-instead-of-logical warnings fixed #40242

Merged
merged 1 commit into from Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataFormats/GeometrySurface/interface/GloballyPositioned.h
Expand Up @@ -154,7 +154,7 @@ class GloballyPositioned {
*/

void setCache() {
if ((thePos.x() == 0.) & (thePos.y() == 0.)) {
if ((thePos.x() == 0.) && (thePos.y() == 0.)) {
thePhi = theEta = 0.; // avoid FPE
} else {
thePhi = thePos.barePhi();
Expand Down
Expand Up @@ -27,15 +27,15 @@ class RectangularPlaneBounds final : public Bounds {
using Bounds::inside;

bool inside(const Local2DPoint& p) const override {
return (std::abs(p.x()) < halfWidth) & (std::abs(p.y()) < halfLength);
return (std::abs(p.x()) < halfWidth) && (std::abs(p.y()) < halfLength);
}

bool inside(const Local3DPoint& p) const override {
return (std::abs(p.x()) < halfWidth) & (std::abs(p.y()) < halfLength) & (std::abs(p.z()) < halfThickness);
return (std::abs(p.x()) < halfWidth) && (std::abs(p.y()) < halfLength) && (std::abs(p.z()) < halfThickness);
}

bool inside(const Local2DPoint& p, float tollerance) const override {
return (std::abs(p.x()) < (halfWidth + tollerance)) & (std::abs(p.y()) < (halfLength + tollerance));
return (std::abs(p.x()) < (halfWidth + tollerance)) && (std::abs(p.y()) < (halfLength + tollerance));
}

bool inside(const Local3DPoint& p, const LocalError& err, float scale = 1.f) const override;
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/GeometrySurface/interface/SimpleDiskBounds.h
Expand Up @@ -18,8 +18,8 @@ class SimpleDiskBounds final : public Bounds {
float thickness() const override { return theZmax - theZmin; }

bool inside(const Local3DPoint& p) const override {
return ((p.z() > theZmin) & (p.z() < theZmax)) &&
((p.perp2() > theRmin * theRmin) & (p.perp2() < theRmax * theRmax));
return ((p.z() > theZmin) && (p.z() < theZmax)) &&
((p.perp2() > theRmin * theRmin) && (p.perp2() < theRmax * theRmax));
}

using Bounds::inside;
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/GeometrySurface/src/DiskSectorBounds.cc
Expand Up @@ -7,13 +7,13 @@ bool DiskSectorBounds::inside(const Local3DPoint& p) const {
// and rotated x/y axis
Local3DPoint tmp(p.y() + theOffset, -p.x(), p.z());

return ((tmp.z() >= theZmin) & (tmp.z() <= theZmax) & (tmp.perp2() >= theRmin * theRmin) &
return ((tmp.z() >= theZmin) && (tmp.z() <= theZmax) && (tmp.perp2() >= theRmin * theRmin) &&
(tmp.perp2() <= theRmax * theRmax)) &&
(std::abs(tmp.barePhi()) <= thePhiExtH);
}

bool DiskSectorBounds::inside(const Local3DPoint& p, const LocalError& err, float scale) const {
if ((p.z() < theZmin) | (p.z() > theZmax))
if ((p.z() < theZmin) || (p.z() > theZmax))
return false;

Local2DPoint tmp(p.x(), p.y() + theOffset);
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/GeometrySurface/src/TrapezoidalPlaneBounds.cc
Expand Up @@ -16,11 +16,11 @@ TrapezoidalPlaneBounds::TrapezoidalPlaneBounds(float be, float te, float a, floa
int TrapezoidalPlaneBounds::yAxisOrientation() const { return (hbotedge > htopedge) ? -1 : 1; }

bool TrapezoidalPlaneBounds::inside(const Local2DPoint& p) const {
return (std::abs(p.y()) < hapothem) & (std::abs(p.x()) < tan_a * std::abs(p.y() + offset));
return (std::abs(p.y()) < hapothem) && (std::abs(p.x()) < tan_a * std::abs(p.y() + offset));
}

bool TrapezoidalPlaneBounds::inside(const Local3DPoint& p) const {
return ((std::abs(p.y()) < hapothem) & (std::abs(p.z()) < hthickness)) &&
return ((std::abs(p.y()) < hapothem) && (std::abs(p.z()) < hthickness)) &&
std::abs(p.x()) < tan_a * std::abs(p.y() + offset);
}

Expand Down