Skip to content

Commit

Permalink
Merge pull request #4004 from ktf/more-clang-fixes
Browse files Browse the repository at this point in the history
Backport of clang fixes from CMSSW_7_1_CLANG_X branch
  • Loading branch information
davidlange6 committed Jun 3, 2014
2 parents 7929f6f + 6db6e1d commit e6b5529
Show file tree
Hide file tree
Showing 33 changed files with 54 additions and 99 deletions.
8 changes: 4 additions & 4 deletions CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.cc
Expand Up @@ -896,8 +896,8 @@ void EcalTPGParamBuilder::analyze(const edm::Event& evt, const edm::EventSetup&
getGCTRegionEta(towid.ieta()),getGCTRegionPhi(towid.iphi())} ;
for (int i=0 ; i<26 ; i++) ntupleInts_[i] = val[i] ;

sprintf(ntupleDet_,"%s",getDet(tccNb).c_str()) ;
sprintf(ntupleCrate_,"%s",getCrate(tccNb).first.c_str()) ;
strcpy(ntupleDet_,getDet(tccNb).c_str()) ;
strcpy(ntupleCrate_,getCrate(tccNb).first.c_str()) ;
ntuple->Fill() ;


Expand Down Expand Up @@ -1168,8 +1168,8 @@ void EcalTPGParamBuilder::analyze(const edm::Event& evt, const edm::EventSetup&
towid.ieta(),towid.iphi(),TCCch, getCrate(tccNb).second, SLBch, SLBslot,
getGCTRegionEta(towid.ieta()),getGCTRegionPhi(towid.iphi())} ;
for (int i=0 ; i<26 ; i++) ntupleInts_[i] = val[i] ;
sprintf(ntupleDet_,"%s",getDet(tccNb).c_str()) ;
sprintf(ntupleCrate_,"%s",getCrate(tccNb).first.c_str()) ;
strcpy(ntupleDet_,getDet(tccNb).c_str()) ;
strcpy(ntupleCrate_,getCrate(tccNb).first.c_str()) ;
ntuple->Fill() ;

if ((tccNb == 76 || tccNb == 94) && stripInTower == 1 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
Expand Down
11 changes: 9 additions & 2 deletions CondFormats/Serialization/interface/eos/portable_oarchive.hpp
Expand Up @@ -321,8 +321,15 @@ namespace eos {
// examine the number of bytes
// needed to represent the number
signed char size = 0;
do { temp >>= CHAR_BIT; ++size; }
while (temp != 0 && temp != (T) -1);
if(sizeof(T) == 1)
{
size = 1;
}
else
{
do { temp >>= CHAR_BIT; ++size; }
while (temp != 0 && temp != (T) -1);
}

// encode the sign bit into the size
save_signed_char(t > 0 ? size : -size);
Expand Down
1 change: 0 additions & 1 deletion DQM/HcalMonitorModule/src/HcalTimingMonitorModule.cc
Expand Up @@ -19,7 +19,6 @@
static const int MAXRPC =20;
static const int MAXDTBX=20;
static const int MAXCSC =20;
static const int MAXGMT =20;
static const int TRIG_DT =1;
static const int TRIG_RPC=2;
static const int TRIG_GCT=4;
Expand Down
2 changes: 1 addition & 1 deletion DQMServices/Components/bin/fastHadd.cc
Expand Up @@ -521,7 +521,7 @@ showusage(void)

int main(int argc, char * argv[]) {
int arg;
int ret;
int ret = 0;
std::string output_file;
std::vector<std::string> filenames;
TaskType task;
Expand Down
2 changes: 0 additions & 2 deletions DQMServices/Components/src/DQMDcsInfo.cc
Expand Up @@ -13,8 +13,6 @@

// Framework

const static int XBINS=2000;

DQMDcsInfo::DQMDcsInfo(const edm::ParameterSet& ps)
{

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/EcalDigi/test/EcalDigi_t.cpp
Expand Up @@ -151,7 +151,7 @@ namespace {
}
void verifyEndcapId(edm::DataFrame::id_type id) {
try {
EEDetId detid(DetId(id)); // detid(id) does not throw
EEDetId detid{DetId(id)}; // detid(id) does not throw
} catch(...) {
bool NotEndcapID=false;
CPPUNIT_ASSERT(NotEndcapID);
Expand Down
1 change: 1 addition & 0 deletions DataFormats/PatCandidates/interface/EventHypothesis.h
Expand Up @@ -105,6 +105,7 @@ namespace pat {

namespace eventhypothesis {
struct AcceptAllFilter : public ParticleFilter {
AcceptAllFilter(){}
static const AcceptAllFilter & get() { return s_dummyFilter; }
virtual bool operator()(const CandRefType &cand, const std::string &role) const { return true; }
private:
Expand Down
10 changes: 5 additions & 5 deletions EventFilter/CSCRawToDigi/interface/CSCALCTTrailer.h
Expand Up @@ -49,7 +49,7 @@ class CSCALCTTrailer
static void setDebug(bool debugValue) {debug = debugValue;}

unsigned short * data() {
switch (firmwareVersion) {
switch (firmwareVersion.load()) {
case 2006:
memcpy(theOriginalBuffer, &trailer2006, trailer2006.sizeInWords()*2);
break;
Expand All @@ -68,7 +68,7 @@ class CSCALCTTrailer
static int sizeInWords() {return 4;}

int getCRC() {
switch (firmwareVersion) {
switch (firmwareVersion.load()) {
case 2006:
return ((trailer2006.crc1&0x7ff)<<11) | (trailer2006.crc0&0x7ff);
case 2007:
Expand All @@ -81,7 +81,7 @@ class CSCALCTTrailer
}

bool check() const {
switch (firmwareVersion) {
switch (firmwareVersion.load()) {
case 2006:
return (trailer2006.e0dLine & 0xfff) == 0xe0d;
case 2007:
Expand All @@ -94,7 +94,7 @@ class CSCALCTTrailer
}

int wordCount() const {
switch (firmwareVersion) {
switch (firmwareVersion.load()) {
case 2006:
return trailer2006.frameCount;
case 2007:
Expand All @@ -107,7 +107,7 @@ class CSCALCTTrailer
}

unsigned alctCRCCheck() const {
switch (firmwareVersion) {
switch (firmwareVersion.load()) {
case 2006:
return trailer2006.reserved_3;
case 2007:
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/CSCRawToDigi/src/CSCALCTTrailer.cc
Expand Up @@ -61,7 +61,7 @@ CSCALCTTrailer::CSCALCTTrailer(const unsigned short * buf){
}

///Now fill data
switch (firmwareVersion) {
switch (firmwareVersion.load()) {
case 2006:
memcpy(&trailer2006, buf, trailer2006.sizeInWords()*2);
break;
Expand Down
2 changes: 1 addition & 1 deletion Geometry/CommonTopologies/BuildFile.xml
Expand Up @@ -4,4 +4,4 @@
<export>
<lib name="1"/>
</export>
# <flags CXXFLAGS="-O3 -ffast-math -funsafe-loop-optimizations -ftree-loop-if-convert-stores"/>
# <flags CXXFLAGS="-O3 -ffast-math -funsafe-loop-optimizations"/>
Expand Up @@ -46,6 +46,7 @@ namespace CaloJetMETcorrInputProducer_namespace
// (because pat::Jet->p4() returns the JES corrected, not the raw, jet momentum)
{
public:
RawJetExtractorT() {}

reco::Candidate::LorentzVector operator()(const T& jet) const
{
Expand Down
Expand Up @@ -53,6 +53,7 @@ namespace PFJetMETcorrInputProducer_namespace
{
public:

RawJetExtractorT(){}
reco::Candidate::LorentzVector operator()(const T& jet) const
{
return jet.p4();
Expand Down
3 changes: 0 additions & 3 deletions L1Trigger/GlobalTriggerAnalyzer/src/L1GtPatternGenerator.cc
Expand Up @@ -101,8 +101,6 @@ template <class TRecord, typename TResult> static void extractRecordData(const e
const std::string& prefix,
uint32_t (*packingFunction)(uint32_t) = NULL)
{
uint32_t valueCount;

// Extract record from event.
edm::Handle<std::vector<TRecord> > handle;
iEvent.getByLabel(label, instance, handle);
Expand All @@ -124,7 +122,6 @@ template <class TRecord, typename TResult> static void extractRecordData(const e
}

line.push(prefix, value);
++valueCount;
}
}

Expand Down
Expand Up @@ -456,8 +456,8 @@ int DTConfigDBProducer::readDTCCBConfig(const DTConfigManagerRcd & iRecord,
}

// compute SL number and bti number
int isl;
int ibti;
int isl = 0;
int ibti = 0;
if (PhiSL) {
if ((chip%8)<4)
isl=1; // Phi1
Expand Down
Expand Up @@ -263,8 +263,10 @@ void TestCorrection::analyze(const edm::Event& iEvent, const edm::EventSetup& iS

// Use the correction function to correct the pt scale of the muons. Note that this takes into
// account the corrections from all iterations.
lorentzVector recMu1 = correctMuon(recMu1);
lorentzVector recMu2 = correctMuon(recMu2);
lorentzVector recMu1;
correctMuon(recMu1);
lorentzVector recMu2;
correctMuon(recMu2);

reco::Particle::LorentzVector bestRecRes (recMu1+recMu2);

Expand Down
4 changes: 2 additions & 2 deletions PhysicsTools/FWLite/src/ScannerHelpers.cc
Expand Up @@ -13,7 +13,7 @@ helper::Parser::makeExpression(const std::string &expr, const edm::TypeWithDict
reco::parser::Grammar grammar(ret, type, true);
const char* startingFrom = expr.c_str();
try {
parse(startingFrom, grammar.use_parser<1>() >> end_p, space_p).full; /// NOTA BENE: <0> for cuts, <1> for expresions (why? boh!)
parse(startingFrom, grammar.use_parser<1>() >> end_p, space_p); /// NOTA BENE: <0> for cuts, <1> for expresions (why? boh!)
} catch(reco::parser::BaseException&e){
std::cerr << "Expression parser error:"<<reco::parser::baseExceptionWhat(e)<<" (char "<<e.where-startingFrom<<")" << std::endl;
}
Expand All @@ -28,7 +28,7 @@ helper::Parser::makeSelector(const std::string &expr, const edm::TypeWithDict &t
reco::parser::Grammar grammar(ret, type, true);
const char* startingFrom = expr.c_str();
try {
parse(startingFrom, grammar.use_parser<0>() >> end_p, space_p).full; /// NOTA BENE: <0> for cuts, <1> for expresions (why? boh!)
parse(startingFrom, grammar.use_parser<0>() >> end_p, space_p); /// NOTA BENE: <0> for cuts, <1> for expresions (why? boh!)
} catch(reco::parser::BaseException&e){
std::cerr << "Selector parser error:"<<reco::parser::baseExceptionWhat(e)<<" (char "<<e.where-startingFrom<<")" << std::endl;
}
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/MVAComputer/src/TreeReader.cc
Expand Up @@ -374,7 +374,6 @@ void TreeReader::Value::update(TreeReader *reader) const
break;
case 'B':
reader->multiBool[index].first = value;
&reader->multiBool[index].second;
value = &reader->multiBool[index].first;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/MVATrainer/plugins/ProcTMVA.cc
Expand Up @@ -132,7 +132,7 @@ void ProcTMVA::configure(DOMElement *elem)
ss << name << "_" << i;
if (std::find(names.begin(), names.end(),
ss.str()) == names.end()) {
name == ss.str();
name = ss.str();
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions PhysicsTools/PatUtils/interface/SmearedJetProducerT.h
Expand Up @@ -120,6 +120,7 @@ namespace SmearedJetProducer_namespace
{
public:

RawJetExtractorT(){}
reco::Candidate::LorentzVector operator()(const T& jet) const
{
return jet.p4();
Expand All @@ -131,6 +132,7 @@ namespace SmearedJetProducer_namespace
{
public:

RawJetExtractorT(){}
reco::Candidate::LorentzVector operator()(const pat::Jet& jet) const
{
if ( jet.jecSetsAvailable() ) return jet.correctedP4("Uncorrected");
Expand Down
Expand Up @@ -26,6 +26,7 @@ namespace CaloJetMETcorrInputProducer_namespace
class RawJetExtractorT<pat::Jet>
{
public:
RawJetExtractorT(){}

reco::Candidate::LorentzVector operator()(const pat::Jet& jet) const
{
Expand Down
Expand Up @@ -25,6 +25,7 @@ namespace PFJetMETcorrInputProducer_namespace
{
public:

RawJetExtractorT(){}
reco::Candidate::LorentzVector operator()(const pat::Jet& jet) const
{
if ( jet.jecSetsAvailable() ) return jet.correctedP4("Uncorrected");
Expand Down
2 changes: 1 addition & 1 deletion RecoParticleFlow/PFTracking/plugins/GoodSeedProducer.cc
Expand Up @@ -287,7 +287,7 @@ GoodSeedProducer::produce(Event& iEvent, const EventSetup& iSetup)
theOutParticle.vertex().z()
);

constexpr float psLim = std::sinh(1.65f);
constexpr float psLim = 2.50746495928f; // std::sinh(1.65f);
bool isBelowPS= (ElecTrkEcalPos.z()*ElecTrkEcalPos.z()) > (psLim*psLim)*ElecTrkEcalPos.perp2();
// bool isBelowPS=(std::abs(ElecTrkEcalPos.eta())>1.65f);

Expand Down
Expand Up @@ -226,7 +226,7 @@ void PixelTripletHLTGenerator::hitTriplets(const TrackingRegion& region,
phiRange = mergePhiRanges(rPhi1,rPhi2);
}

constexpr float nSigmaRZ = std::sqrt(12.f); // ...and continue as before
constexpr float nSigmaRZ = 3.46410161514f; // std::sqrt(12.f); // ...and continue as before
constexpr float nSigmaPhi = 3.f;

foundNodes.clear(); // Now recover hits in bounding box...
Expand Down
Expand Up @@ -55,7 +55,7 @@ namespace {
}

void operator()(int b, int e, const RecHitsSortedInPhi & innerHitsMap, bool * ok) const {
constexpr float nSigmaRZ = std::sqrt(12.f);
constexpr float nSigmaRZ = 3.46410161514f; // std::sqrt(12.f);
for (int i=b; i!=e; ++i) {
Range allowed = checkRZ->range(innerHitsMap.u[i]);
float vErr = nSigmaRZ * innerHitsMap.dv[i];
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/TkHitPairs/test/testCompatKernel.cc
Expand Up @@ -21,7 +21,7 @@ namespace {
}

void operator()(int b, int e, const RecHitsSortedInPhi & innerHitsMap, bool * ok) const {
constexpr float nSigmaRZ = std::sqrt(12.f);
constexpr float nSigmaRZ = 3.46410161514; // std::sqrt(12.f);
for (int i=b; i!=e; ++i) {
Range allowed = checkRZ->range(innerHitsMap.u[i]);
float vErr = nSigmaRZ * innerHitsMap.dv[i];
Expand Down
2 changes: 0 additions & 2 deletions SimG4Core/GFlash/plugins/GflashG4Watcher.cc
Expand Up @@ -16,8 +16,6 @@

using namespace CLHEP;

const double radLength = 8.9; // mm
const double rMoliere = 21.9; // mm
// constructors and destructor
//
GflashG4Watcher::GflashG4Watcher(const edm::ParameterSet& p) {
Expand Down
1 change: 0 additions & 1 deletion TauAnalysis/MCEmbeddingTools/plugins/GsfTrackMixer.cc
Expand Up @@ -130,7 +130,6 @@ GsfTrackMixer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)

edm::Ref<reco::TrackExtraCollection>::key_type idx = 0;
edm::Ref<reco::GsfTrackExtraCollection>::key_type idxGsf = 0;
edm::Ref<reco::GsfTrackCollection>::key_type iTkRef = 0;

edm::Handle< reco::GsfTrackCollection > hcol1, hcol2;
iEvent.getByLabel( _col1, hcol1);
Expand Down

0 comments on commit e6b5529

Please sign in to comment.