SST code : CPPCHECK (round 1)

using code (as of 2015-06-04) from : offline/users/bouchet/SST/StRoot :
  • StSsdDbMaker  
  • StSstDaqMaker  
  • StSstMONMaker  
  • StSstPointMaker
  • StSstTupleMaker  
  • StSstUtil
note : if path is a folder, all files in this folder are checked

1) StSsdDbMaker
cppcheck --enable=warning StRoot/StSsdDbMaker/
Checking StRoot/StSsdDbMaker/StSsdDbMaker.cxx...
Checking StRoot/StSsdDbMaker/StSsdDbMaker.cxx: StMaker_H...
1/2 files checked 54% done
Checking StRoot/StSsdDbMaker/StSstDbMaker.cxx...
Checking StRoot/StSsdDbMaker/StSstDbMaker.cxx: StMaker_H...
2/2 files checked 100% done
 
2) StSstDaqMaker
cppcheck --enable=warning StRoot/StSsdDbMaker/
Checking StRoot/StSsdDbMaker/StSsdDbMaker.cxx...
Checking StRoot/StSsdDbMaker/StSsdDbMaker.cxx: StMaker_H...
1/2 files checked 54% done
Checking StRoot/StSsdDbMaker/StSstDbMaker.cxx...
Checking StRoot/StSsdDbMaker/StSstDbMaker.cxx: StMaker_H...
2/2 files checked 100% done

3) StSstMONMaker
cppcheck --enable=warning StRoot/StSstMONMaker/
Checking StRoot/StSstMONMaker/StSstMONMaker.cxx...

4) StSstPointMaker
cppcheck --enable=warning StRoot/StSstPointMaker/

Checking StRoot/StSstPointMaker/StSstPointMaker.cxx...
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::DbConnector' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_pedRms' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mGain' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mWafConfig' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::position' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::dimensions' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::config' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_dimensions' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_configuration' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_wafpos' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_ctrl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_Cluster_ctrl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mCurrentEvent' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mSstHitColl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mDynamicControl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mClusterControl' is not initialized in the constructor.
Checking StRoot/StSstPointMaker/StSstPointMaker.cxx: StMaker_H...
Checking StRoot/StSstPointMaker/StSstPointMaker.cxx: config_position_dimensions...

5) StSstTupleMaker
cppcheck --enable=warning StRoot/StSstTupleMaker 
Checking StRoot/StSstTupleMaker/StSstTupleMaker.cxx...
[StRoot/StSstTupleMaker/StSstTupleMaker.cxx:114] -> [StRoot/StSstTupleMaker/StSstTupleMaker.cxx:106]: (warning) Possible null pointer dereference: mySst - otherwise it is redundant to check it against null.

6) StSstUtil
cppcheck --enable=warning StRoot/StSstUtil/
Checking StRoot/StSstUtil/StSpaListNoise.cc...
1/16 files checked 2% done
Checking StRoot/StSstUtil/StSpaNoise.cc...
2/16 files checked 3% done
Checking StRoot/StSstUtil/StSstBarrel.cc...
3/16 files checked 25% done
Checking StRoot/StSstUtil/StSstCluster.cc...
4/16 files checked 27% done
Checking StRoot/StSstUtil/StSstClusterControl.cxx...
5/16 files checked 28% done
Checking StRoot/StSstUtil/StSstClusterList.cc...
[StRoot/StSstUtil/StSstClusterList.cc:261]: (error) Memory leak: minima
[StRoot/StSstUtil/StSstClusterList.cc:261]: (error) Memory leak: maxima
[StRoot/StSstUtil/StSstClusterList.cc:261]: (error) Memory leak: keyToIdStrip
6/16 files checked 32% done
Checking StRoot/StSstUtil/StSstConfig.cc...
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mStatus' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::totLadderPresent' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mNumberOfLadders' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mNumberOfWafers' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mNumberOfHybrids' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mTotalNumberOfLadders' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mTotalNumberOfHybrids' is not assigned a value in 'StSstConfig::operator='.
[StRoot/StSstUtil/StSstConfig.cc:34]: (warning) Member variable 'StSstConfig::mNumberOfStrips' is not assigned a value in 'StSstConfig::operator='.
7/16 files checked 33% done
Checking StRoot/StSstUtil/StSstDynamicControl.cxx...
8/16 files checked 34% done
Checking StRoot/StSstUtil/StSstLadder.cc...
9/16 files checked 35% done
Checking StRoot/StSstUtil/StSstPackage.cc...
10/16 files checked 38% done
Checking StRoot/StSstUtil/StSstPackageList.cc...
11/16 files checked 39% done
Checking StRoot/StSstUtil/StSstPoint.cc...
12/16 files checked 41% done
Checking StRoot/StSstUtil/StSstPointList.cc...
13/16 files checked 43% done
Checking StRoot/StSstUtil/StSstStrip.cc...
[StRoot/StSstUtil/StSstStrip.cc:26]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:26]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:14]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:14]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:35]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:35]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:54]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:54]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:45]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:45]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:67]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:67]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:74]: (warning) Member variable 'StSstStrip::mPrevStrip' is not initialized in the constructor.
[StRoot/StSstUtil/StSstStrip.cc:74]: (warning) Member variable 'StSstStrip::mNextStrip' is not initialized in the constructor.
14/16 files checked 45% done
Checking StRoot/StSstUtil/StSstStripList.cc...
15/16 files checked 48% done
Checking StRoot/StSstUtil/StSstWafer.cc...
16/16 files checked 100% done
 
with --enable=all

11) StSstDaqMaker
cppcheck --enable=all StRoot/StSstDaqMaker/
Checking StRoot/StSstDaqMaker/StSstDaqMaker.cxx...
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:171]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:178]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:240]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:573]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:854]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1059]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1268]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1314]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1360]: (style) C-style pointer casting
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1359]: (style) The scope of the variable 'side' can be reduced.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1359]: (style) The scope of the variable 'ladder' can be reduced.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1359]: (style) The scope of the variable 'wafer' can be reduced.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1359]: (style) The scope of the variable 'chip' can be reduced.
[StRoot/StSstDaqMaker/StSstDaqMaker.h:73]: (style) Class 'StSstDaqMaker' has a constructor with 1 argument that is not explicit.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1161]: (style) The function 'CalculateCommonModeNoise' is never used.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:1416]: (style) The function 'Finish' is never used.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:151]: (style) The function 'InitRun' is never used.
[StRoot/StSstDaqMaker/StSstDaqMaker.cxx:212]: (style) The function 'Make' is never used.
(information) Cppcheck cannot find all the include files (use --check-config for details)

21) StSsdDbMaker
cppcheck --enable=all StRoot/StSsdDbMaker/
Checking StRoot/StSsdDbMaker/StSsdDbMaker.cxx...
[StRoot/StSsdDbMaker/StSsdDbMaker.cxx:97]: (style) C-style pointer casting
[StRoot/StSsdDbMaker/StSsdDbMaker.cxx:102]: (style) C-style pointer casting
[StRoot/StSsdDbMaker/StSsdDbMaker.cxx:116]: (style) C-style pointer casting
[StRoot/StSsdDbMaker/StSsdDbMaker.h:60]: (style) Class 'StSsdDbMaker' has a constructor with 1 argument that is not explicit.
Checking StRoot/StSsdDbMaker/StSsdDbMaker.cxx: StMaker_H...
1/2 files checked 54% done
Checking StRoot/StSsdDbMaker/StSstDbMaker.cxx...
[StRoot/StSsdDbMaker/StSstDbMaker.cxx:60]: (style) C-style pointer casting
[StRoot/StSsdDbMaker/StSstDbMaker.cxx:68]: (style) C-style pointer casting
[StRoot/StSsdDbMaker/StSstDbMaker.cxx:92]: (style) C-style pointer casting
[StRoot/StSsdDbMaker/StSstDbMaker.h:30]: (style) Class 'StSstDbMaker' has a constructor with 1 argument that is not explicit.
Checking StRoot/StSsdDbMaker/StSstDbMaker.cxx: StMaker_H...
2/2 files checked 100% done
[StRoot/StSsdDbMaker/StSsdDbMaker.cxx:140]: (style) The function 'Finish' is never used.
[StRoot/StSsdDbMaker/StSsdDbMaker.cxx:90]: (style) The function 'InitRun' is never used.
[StRoot/StSsdDbMaker/StSsdDbMaker.cxx:125]: (style) The function 'Make' is never used.
[StRoot/StSsdDbMaker/StSstDbMaker.cxx:297]: (style) The function 'getHMatrixSensorOnGlobal' is never used.
[StRoot/StSsdDbMaker/StSstDbMaker.cxx:306]: (style) The function 'maskChip' is never used.
(information) Cppcheck cannot find all the include files (use --check-config for details)

31) StSstMONMaker
cppcheck --enable=all StRoot/StSstMONMaker/
Checking StRoot/StSstMONMaker/StSstMONMaker.cxx...
[StRoot/StSstMONMaker/StSstMONMaker.cxx:40]: (style) C-style pointer casting
[StRoot/StSstMONMaker/StSstMONMaker.cxx:152]: (style) C-style pointer casting
[StRoot/StSstMONMaker/StSstMONMaker.cxx:161]: (style) C-style pointer casting
[StRoot/StSstMONMaker/StSstMONMaker.cxx:170]: (style) C-style pointer casting
[StRoot/StSstMONMaker/StSstMONMaker.cxx:230]: (style) The scope of the variable 'iLad' can be reduced.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:231]: (style) The scope of the variable 'iWaf' can be reduced.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:205]: (style) Unused variable: nStripMean
[StRoot/StSstMONMaker/StSstMONMaker.h:21]: (style) Class 'StSstMONMaker' has a constructor with 1 argument that is not explicit.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:263]: (style) The function 'Finish' is never used.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:33]: (style) The function 'Init' is never used.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:148]: (style) The function 'Make' is never used.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:318]: (style) The function 'idWaferToWaferNumb' is never used.
[StRoot/StSstMONMaker/StSstMONMaker.cxx:330]: (style) The function 'waferNumbToIdWafer' is never used.
(information) Cppcheck cannot find all the include files (use --check-config for details)

41) StSstPointMaker

cppcheck --enable=all StRoot/StSstPointMaker/
Checking StRoot/StSstPointMaker/StSstPointMaker.cxx...
[StRoot/StSstPointMaker/StSstPointMaker.cxx:124]: (style) C-style pointer casting
[StRoot/StSstPointMaker/StSstPointMaker.cxx:163]: (style) C-style pointer casting
[StRoot/StSstPointMaker/StSstPointMaker.cxx:600]: (style) C-style pointer casting
[StRoot/StSstPointMaker/StSstPointMaker.cxx:627]: (style) C-style pointer casting
[StRoot/StSstPointMaker/StSstPointMaker.cxx:128]: (style) Variable 'pedrmsData' is assigned a value that is never used.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::DbConnector' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_pedRms' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mGain' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mWafConfig' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::position' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::dimensions' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::config' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_dimensions' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_configuration' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_wafpos' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_ctrl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::m_Cluster_ctrl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mCurrentEvent' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mSstHitColl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mDynamicControl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (warning) Member variable 'StSstPointMaker::mClusterControl' is not initialized in the constructor.
[StRoot/StSstPointMaker/StSstPointMaker.h:91]: (style) Class 'StSstPointMaker' has a constructor with 1 argument that is not explicit.
Checking StRoot/StSstPointMaker/StSstPointMaker.cxx: StMaker_H...
Checking StRoot/StSstPointMaker/StSstPointMaker.cxx: config_position_dimensions...
[StRoot/StSstPointMaker/StSstPointMaker.cxx:658]: (style) The function 'FillDefaultChipNoiseTable' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:675]: (style) The function 'Finish' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:84]: (style) The function 'InitRun' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:141]: (style) The function 'Make' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:438]: (style) The function 'PrintClusterDetails' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:505]: (style) The function 'PrintPackageDetails' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:540]: (style) The function 'PrintPointDetails' is never used.
[StRoot/StSstPointMaker/StSstPointMaker.cxx:380]: (style) The function 'PrintStripDetails' is never used.
(information) Cppcheck cannot find all the include files (use --check-config for details)