Skip to content

Commit

Permalink
Merge pull request #25041 from makortel/saConstCastDB
Browse files Browse the repository at this point in the history
Remove some const-away casts from DB
  • Loading branch information
cmsbuild committed Oct 30, 2018
2 parents 59414d6 + bc25041 commit 95097b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions OnlineDB/EcalCondDB/interface/IODConfig.h
Expand Up @@ -88,7 +88,7 @@ void populateClob (Clob &clob, std::string fname, unsigned int bufsize) noexcept
std::cout << "Populating the Clob using writeBuffer(Stream) method" << std::endl;
std::cout<<"we are here0"<<std::endl;

char *file = (char *)fname.c_str();
const char *file = fname.c_str();
std::cout<<"we are here0.5 file is:"<<fname<<std::endl;

std::ifstream inFile;
Expand All @@ -99,7 +99,7 @@ void populateClob (Clob &clob, std::string fname, unsigned int bufsize) noexcept
inFile.close();

std::string fname2="/nfshome0/ecaldev/francesca/null_file.txt";
inFile.open((char*)fname2.c_str(),std::ios::in);
inFile.open(fname2.c_str(),std::ios::in);



Expand Down
2 changes: 1 addition & 1 deletion OnlineDB/EcalCondDB/src/LMFColor.cc
Expand Up @@ -104,7 +104,7 @@ bool LMFColor::isValid() {
boost::ptr_list<LMFUnique>::const_iterator e = listOfValidColors.end();
bool ret = false;
while (i != e) {
LMFColor *c = (LMFColor*)&(*i);
const LMFColor *c = static_cast<const LMFColor*>(&(*i));
if (c->getShortName() == getShortName()) {
ret = true;
i = e;
Expand Down
12 changes: 6 additions & 6 deletions OnlineDB/EcalCondDB/src/LMFDefFabric.cc
Expand Up @@ -182,7 +182,7 @@ void LMFDefFabric::initialize()
i = listOfObjects.begin();
e = listOfObjects.end();
while (i != e) {
LMFColor *c = (LMFColor*)&(*i);
const LMFColor *c = static_cast<const LMFColor*>(&(*i));
_lmfColors.push_back(*c);
i++;
}
Expand All @@ -191,7 +191,7 @@ void LMFDefFabric::initialize()
i = listOfObjects.begin();
e = listOfObjects.end();
while (i != e) {
LMFTrigType *c = (LMFTrigType*)&(*i);
const LMFTrigType *c = static_cast<const LMFTrigType*>(&(*i));
_lmfTrigTypes.push_back(*c);
i++;
}
Expand All @@ -200,7 +200,7 @@ void LMFDefFabric::initialize()
i = listOfObjects.begin();
e = listOfObjects.end();
while (i != e) {
LMFRunTag *c = (LMFRunTag*)&(*i);
const LMFRunTag *c = static_cast<const LMFRunTag*>(&(*i));
_lmfRunTags.push_back(*c);
i++;
}
Expand All @@ -209,7 +209,7 @@ void LMFDefFabric::initialize()
i = listOfObjects.begin();
e = listOfObjects.end();
while (i != e) {
LMFPrimVers *c = (LMFPrimVers*)&(*i);
const LMFPrimVers *c = static_cast<const LMFPrimVers*>(&(*i));
_lmfPrimVersions.push_back(*c);
i++;
}
Expand All @@ -218,7 +218,7 @@ void LMFDefFabric::initialize()
i = listOfObjects.begin();
e = listOfObjects.end();
while (i != e) {
LMFCorrVers *c = (LMFCorrVers*)&(*i);
const LMFCorrVers *c = static_cast<const LMFCorrVers*>(&(*i));
_lmfCorrVersions.push_back(*c);
i++;
}
Expand All @@ -227,7 +227,7 @@ void LMFDefFabric::initialize()
i = listOfObjects.begin();
e = listOfObjects.end();
while (i != e) {
LMFSeqVers *c = (LMFSeqVers*)&(*i);
const LMFSeqVers *c = static_cast<const LMFSeqVers*>(&(*i));
_lmfSeqVersions.push_back(*c);
i++;
}
Expand Down
5 changes: 2 additions & 3 deletions OnlineDB/EcalCondDB/src/MODCCSHFDat.cc
Expand Up @@ -264,18 +264,17 @@ void MODCCSHFDat::populateClob (Clob &clob, std::string fname, unsigned int clob
cout << "Populating the Clob using writeBuffer(Stream) method" << endl;
std::cout<<"we are here0"<<std::endl;

char *file = (char *)fname.c_str();
std::cout<<"we are here0.5 file is:"<<fname<<std::endl;

ifstream inFile;
inFile.open(file,ios::in);
inFile.open(fname.c_str(),ios::in);
if (!inFile)
{
cout << fname<<" file not found\n";
inFile.close();

std::string fname2="/u1/fra/null_file.txt";
inFile.open((char*)fname2.c_str(),ios::in);
inFile.open(fname2.c_str(),ios::in);



Expand Down

0 comments on commit 95097b6

Please sign in to comment.