Closed szotsaki closed 4 years ago
Please, fix the current warnings:
[MarbleCommon/Processors/RjmcmcProcessor.h:14]: (style) Class 'RjmcmcProcessor' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:62]: (style) The scope of the variable 'ok' can be reduced.
[MarbleCommon/Rjmcmc/Energy/SeedPoints.h:26]: (style) Class 'SeedPoints' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/Energy/Holes.h:27]: (style) Class 'Holes' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/Probability/ProbabilityV1.cpp:12]: (style) The scope of the variable 'trP' can be reduced.
[MarbleCommon/Rjmcmc/Probability/ProbabilityV1.h:6]: (style) The class 'ProbabilityV1' does not have a constructor.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:40]: (performance) Variable 'neighbourhoodVector' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/BlobOperation.cpp:12]: (performance) Variable 'superBlobs' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:42]: (style) Class 'NeighbourhoodContainer' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:131]: (style) Class 'SuperBlobContainer' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:133]: (style) Class 'SuperBlobContainer' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/BlobOperation.h:51]: (style) Class 'BlobOperation' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/EnergyFunction.h:21]: (style) Class 'EnergyFunction' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:75] -> [MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:77]: (performance) Variable 'randValue' is reassigned a value before the old one has been used.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:19]: (style) The scope of the variable 'superBlobIndex' can be reduced.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:120]: (style) The scope of the variable 'transitionIndex' can be reduced.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:13]: (warning) Member variable 'SuperBlobContainer::lastChanged' is not initialized in the constructor.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:15]: (performance) Variable 'superBlobIndices' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:22]: (performance) Variable 'neighbourhood' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:28]: (performance) Variable 'neighbourhood' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:3]: (warning) Member variable 'RJMCMCalgorithm::energyDifference' is not initialized in the constructor.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:5]: (performance) Variable 'Container' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.h:80]: (style) Class 'RJMCMCalgorithm' has a constructor with 1 argument that is not explicit.
The following GCC warnings are present in the codebase. Please, fix them first, before cppcheck warnings.
MarbleCommon/Processors/RjmcmcProcessor.cpp:8:55: warning: unused parameter 'psd' [-Wunused-parameter]
MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:79:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/BlobOperation.cpp:102:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/BlobOperation.cpp:105:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/BlobOperation.cpp:114:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Energy/Convexity.cpp:3:47: warning: unused parameter 'neighbour' [-Wunused-parameter]
MarbleCommon/Rjmcmc/Energy/Convexity.cpp:3:62: warning: unused parameter 'blobIndex' [-Wunused-parameter]
MarbleCommon/Rjmcmc/Energy/Convexity.cpp:3:95: warning: unused parameter 'Step' [-Wunused-parameter]
MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:16:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:34:11: warning: switch missing default case [-Wswitch-default]
MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:34:11: warning: enumeration value 'STAY' not handled in switch [-Wswitch]
MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:64:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:66:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Energy/Holes.cpp:32:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Energy/Holes.cpp:89:11: warning: switch missing default case [-Wswitch-default]
MarbleCommon/Rjmcmc/Energy/Holes.cpp:89:11: warning: enumeration value 'STAY' not handled in switch [-Wswitch]
MarbleCommon/Rjmcmc/Probability/ProbabilityV1.cpp:14:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Probability/ProbabilityV1.cpp:21:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
MarbleCommon/Rjmcmc/Energy/StraightLine.cpp:3:50: warning: unused parameter 'neighbour' [-Wunused-parameter]
MarbleCommon/Rjmcmc/Energy/StraightLine.cpp:3:65: warning: unused parameter 'blobIndex' [-Wunused-parameter]
MarbleCommon/Rjmcmc/Energy/StraightLine.cpp:3:98: warning: unused parameter 'Step' [-Wunused-parameter]
Thanks for the GCC fixes. The following cppcheck warnings are still valid:
[MarbleCommon/Rjmcmc/Energy/Holes.h:27]: (style) Class 'Holes' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/Energy/SeedPoints.cpp:68]: (style) The scope of the variable 'ok' can be reduced.
[MarbleCommon/Rjmcmc/Probability/ProbabilityV1.cpp:12]: (style) The scope of the variable 'trP' can be reduced.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:40]: (performance) Variable 'neighbourhoodVector' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/BlobOperation.cpp:12]: (performance) Variable 'superBlobs' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:42]: (style) Class 'NeighbourhoodContainer' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:131]: (style) Class 'SuperBlobContainer' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/SuperBlobContainer.h:133]: (style) Class 'SuperBlobContainer' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/BlobOperation.h:51]: (style) Class 'BlobOperation' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/Probability/ProbabilityV1.h:6]: (style) The class 'ProbabilityV1' does not have a constructor.
[MarbleCommon/Rjmcmc/Energy/SeedPoints.h:26]: (style) Class 'SeedPoints' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/EnergyFunction.h:21]: (style) Class 'EnergyFunction' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:75] -> [MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:77]: (performance) Variable 'randValue' is reassigned a value before the old one has been used.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:19]: (style) The scope of the variable 'superBlobIndex' can be reduced.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:120]: (style) The scope of the variable 'transitionIndex' can be reduced.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:13]: (warning) Member variable 'SuperBlobContainer::lastChanged' is not initialized in the constructor.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:3]: (warning) Member variable 'RJMCMCalgorithm::energyDifference' is not initialized in the constructor.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.cpp:5]: (performance) Variable 'Container' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/RJMCMCalgorithm.h:81]: (style) Class 'RJMCMCalgorithm' has a constructor with 1 argument that is not explicit.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:15]: (performance) Variable 'superBlobIndices' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:22]: (performance) Variable 'neighbourhood' is assigned in constructor body. Consider performing initialization in initialization list.
[MarbleCommon/Rjmcmc/SuperBlobContainer.cpp:28]: (performance) Variable 'neighbourhood' is assigned in constructor body. Consider performing initialization in initialization list.
Please, fix the following C++ coding warnings which were given by
cppcheck
: