Skip to content

Fix boolean return in DeCalorimeter functions

Olivier Deschamps requested to merge FixIsParasitic into 2017-patches

Fixes the following warnings from gcc7 compilation:

7	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h: In member function 'bool DeCalorimeter::isParasiticCard(int)':
8	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h:268:68: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
9	   bool isParasiticCard (const int card) { return (card < nCards()) ? m_feCards[card].isParasitic() : -1; };
10	                                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h: In member function 'bool DeCalorimeter::isPmtCard(int)':
12	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h:269:62: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
13	   bool isPmtCard (const int card) { return (card < nCards()) ? m_feCards[card].isPmtCard() : -1; };
14	                                            ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h: In member function 'bool DeCalorimeter::isPinCard(int)':
16	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h:270:62: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
17	   bool isPinCard (const int card) { return (card < nCards()) ? m_feCards[card].isPinCard() : -1; };
18	                                            ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h: In member function 'bool DeCalorimeter::isPinTell1(int)':
20	/build/jenkins-build/workspace/nightly-builds/build/build/LHCB/LHCB_HEAD/InstallArea/x86_64-centos7-gcc7-opt/include/CaloDet/DeCalorimeter.h:271:62: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
21	   bool isPinTell1(const int tell1) { return (tell1<nTell1s())? m_tell1Boards[tell1].readPin():-1; };
22	                                             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The -1 has been changed to False

Edited by Marco Cattaneo

Merge request reports