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
SimG4CMS packages: Fix clang warnings about absolute value use. #16953
SimG4CMS packages: Fix clang warnings about absolute value use. #16953
Conversation
Replace abs/fabs with std::abs which has a signature for ints and floats. Fixed misplaced parens which result in absolute values of a bool. The absolute value of unsigned vars is meaningless. Cast to signed vars to prevent difference from wrapping to unsigned var max value.
A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_9_0_X. It involves the following packages: SimG4CMS/Calo @cmsbuild, @civanch, @mdhildreth, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
please test |
The tests are being triggered in jenkins. |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_9_0_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @smuzaffar |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
@@ -59,7 +59,7 @@ CastorShowerLibraryMaker::CastorShowerLibraryMaker(const edm::ParameterSet &p) : | |||
// | |||
NPGParticle = PGParticleIDs.size(); | |||
for(unsigned int i=0;i<PGParticleIDs.size();i++) { | |||
switch (int(fabs(PGParticleIDs.at(i)))) { | |||
switch (int(std::abs(PGParticleIDs.at(i)))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gartung - we can drop the int() now?
Pull request #16953 was updated. @cmsbuild, @civanch, @mdhildreth, @davidlange6 can you please check and sign again. |
Done. |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_9_0_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @smuzaffar |
+1 |
Replace abs/fabs with std::abs which has a signature for ints and floats.
Fixed misplaced parens which result in absolute values of a bool.
The absolute value of unsigned vars is meaningless. Cast to signed vars
to prevent difference from wrapping to unsigned var max value.