Skip to content

Commit

Permalink
Merge pull request #28275 from smuzaffar/gcc9-SimRomanPotSimFP420
Browse files Browse the repository at this point in the history
[GCC9] fix left shift of negative value warning for SimRomanPot/SimFP420
  • Loading branch information
cmsbuild committed Oct 28, 2019
2 parents 741ac08 + 726b7c7 commit 87346d9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SimRomanPot/SimFP420/src/DigiConverterFP420.cc
Expand Up @@ -10,8 +10,9 @@ DigiConverterFP420::DigiConverterFP420(float in, int verbosity) {
electronperADC = in;
verbos = verbosity;

const int defaultBits = 10;
const int largestBits = 30;
constexpr int defaultBits = 10;
constexpr int largestBits = 30;
constexpr unsigned int allOne = ~0;

// example is in SiStrips:
// static SimpleConfigurable<int>
Expand All @@ -21,7 +22,7 @@ DigiConverterFP420::DigiConverterFP420(float in, int verbosity) {
if (adcBits > largestBits || adcBits < 1)
adcBits = largestBits;

theMaxADC = ~(~0 << adcBits);
theMaxADC = ~(allOne << adcBits);
// std::cout << "theMaxADC= "<< theMaxADC << std::endl; // = 1023
if (verbos > 0) {
std::cout << " ***DigiConverterFP420: constructor" << std::endl;
Expand Down

0 comments on commit 87346d9

Please sign in to comment.