Skip to content

Commit

Permalink
Merge pull request #46358 from iarspider/iarspider-patches-20241011-2
Browse files Browse the repository at this point in the history
[LLVM Analyzer][DB] Cleanup LLVM analyzer warnings
  • Loading branch information
cmsbuild authored Oct 15, 2024
2 parents 47f5ec0 + 3d8512f commit a371106
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 32 deletions.
5 changes: 4 additions & 1 deletion CondCore/CondDB/plugins/CondDBPyBind11Wrappers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "CondCore/CondDB/interface/Auth.h"
//
#include <cstdlib>
#include <cassert>

namespace cond {

Expand All @@ -10,7 +11,9 @@ namespace cond {
const std::string& authPath) {
std::string ap = authPath;
if (ap.empty()) {
ap = std::string(std::getenv(cond::auth::COND_AUTH_PATH));
char* auth_path_env = std::getenv(cond::auth::COND_AUTH_PATH);
assert(auth_path_env);
ap = std::string(auth_path_env);
}
auto ret = std::make_tuple(std::string(""), std::string(""), std::string(""));
if (!ap.empty()) {
Expand Down
1 change: 1 addition & 0 deletions CondCore/CondDB/src/CoralMsgReporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cond::persistency::CoralMsgReporter::CoralMsgReporter()
// Use a non-default message level?
if (getenv("CORAL_MSGLEVEL")) {
// Check only the first char of the environment variable
[[clang::suppress]]
switch (*getenv("CORAL_MSGLEVEL")) {
case '0':
case 'n':
Expand Down
21 changes: 7 additions & 14 deletions CondFormats/JetMETObjects/bin/JetResolution_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
////////////////////////////////////////////////////////////////////////////////

#include "CondFormats/JetMETObjects/interface/JetResolution.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"

#include <TROOT.h>
#include <TApplication.h>
Expand Down Expand Up @@ -61,20 +62,12 @@ int main(int argc, char** argv) {
cout << "nevts: " << nevts << endl;
cout << "gaussian: " << doGaussian << endl << endl;

string cmssw_base(std::getenv("CMSSW_BASE"));
string cmssw_release_base(std::getenv("CMSSW_RELEASE_BASE"));
string path = cmssw_base + "/src/CondFormats/JetMETObjects/data";
struct stat st;
if (stat(path.c_str(), &st) != 0)
path = cmssw_release_base + "/src/CondFormats/JetMETObjects/data";
if (stat(path.c_str(), &st) != 0) {
cerr << "ERROR: tried to set path but failed, abort." << endl;
return 0;
}

string ptFileName = path + "/" + era + "_PtResolution_" + alg + ".txt";
string etaFileName = path + "/" + era + "_EtaResolution_" + alg + ".txt";
string phiFileName = path + "/" + era + "_PhiResolution_" + alg + ".txt";
string ptFileName =
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PtResolution_" + alg + ".txt").fullPath();
string etaFileName =
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_EtaResolution_" + alg + ".txt").fullPath();
string phiFileName =
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PhiResolution_" + alg + ".txt").fullPath();

cout << ptFileName << endl;
cout << etaFileName << endl;
Expand Down
12 changes: 5 additions & 7 deletions CondTools/DT/src/DTPerformanceHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ void DTPerformanceHandler::getNewObjects() {
std::map<std::string, popcon::PayloadIOV>::iterator itag =
mp.find( dataTag );
*/
if (runNumber <= last) {
std::cout << "More recent data already present - skipped" << std::endl;
return;
}

DTPerformance* dtPerf = new DTPerformance(dataTag);

Expand Down Expand Up @@ -125,13 +129,7 @@ void DTPerformanceHandler::getNewObjects() {
*/

//for each payload provide IOV information (say in this case we use since)
cond::Time_t snc = runNumber;
if (runNumber > last)
m_to_transfer.push_back(std::make_pair(dtPerf, snc));
else
std::cout << "More recent data already present - skipped" << std::endl;

return;
m_to_transfer.emplace_back(dtPerf, runNumber);
}

std::string DTPerformanceHandler::id() const { return dataTag; }
12 changes: 5 additions & 7 deletions CondTools/DT/src/DTStatusFlagHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ void DTStatusFlagHandler::getNewObjects() {
std::map<std::string, popcon::PayloadIOV>::iterator itag =
mp.find( dataTag );
*/
if (runNumber <= last) {
std::cout << "More recent data already present - skipped" << std::endl;
return;
}

DTStatusFlag* stFlag = new DTStatusFlag(dataTag);

Expand Down Expand Up @@ -122,13 +126,7 @@ void DTStatusFlagHandler::getNewObjects() {
*/

//for each payload provide IOV information (say in this case we use since)
cond::Time_t snc = runNumber;
if (runNumber > last)
m_to_transfer.push_back(std::make_pair(stFlag, snc));
else
std::cout << "More recent data already present - skipped" << std::endl;

return;
m_to_transfer.emplace_back(stFlag, runNumber);
}

std::string DTStatusFlagHandler::id() const { return dataTag; }
4 changes: 2 additions & 2 deletions CondTools/SiPixel/plugins/SiPixelDynamicInefficiencyReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void SiPixelDynamicInefficiencyReader::analyze(const edm::Event& e, const edm::E
}

//DB PU factor calculation
unsigned int pu_iterator = 0;
for (it_pu = map_pufactor.begin(); it_pu != map_pufactor.end(); it_pu++, pu_iterator++) {
it_pu = map_pufactor.begin();
for (unsigned int pu_iterator = 0; pu_iterator < pu_det; it_pu++, pu_iterator++) {
const DetId mapid = DetId(it_pu->first);
if (mapid.subdetId() != detid.subdetId())
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void SiPixelGainCalibrationRejectNoisyAndDead::fillDatabase(const edm::EventSetu
float gainforthiscol[2];
float pedforthiscol[2];
int nusedrows[2];
int nrowsrocsplit;
int nrowsrocsplit = 0;
if (record_ == "SiPixelGainCalibrationOfflineRcd")
nrowsrocsplit = theGainCalibrationDbInputOffline_->getNumberOfRowsToAverageOver();
if (record_ == "SiPixelGainCalibrationForHLTRcd")
Expand Down

0 comments on commit a371106

Please sign in to comment.