Skip to content

Commit

Permalink
*C++ style casts in FastMonitoringService
Browse files Browse the repository at this point in the history
* void* --> const void*
  • Loading branch information
smorovic committed Nov 3, 2015
1 parent ac9f3f7 commit 6aa77b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions EventFilter/Utilities/interface/FastMonitoringService.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ namespace evf{
return (it!=quickReference_.end()) ? (*it).second : 0;
}
const void* decode(unsigned int index){return decoder_[index];}
void fillReserved(void* add, unsigned int i){
void fillReserved(const void* add, unsigned int i){
// translation_[*name]=current_;
quickReference_[add]=i;
if(decoder_.size()<=i)
decoder_.push_back(add);
else
decoder_[currentReserved_] = add;
}
void updateReserved(void* add){
void updateReserved(const void* add){
fillReserved(add,currentReserved_);
currentReserved_++;
}
Expand All @@ -86,7 +86,7 @@ namespace evf{
for(unsigned int i = currentReserved_; i<reserved_; i++)
fillReserved(dummiesForReserved_+i,i);
}
void update(void* add){
void update(const void* add){
// translation_[*name]=current_;
quickReference_[add]=current_;
decoder_.push_back(add);
Expand Down
10 changes: 4 additions & 6 deletions EventFilter/Utilities/src/FastMonitoringService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace evf{
std::string FastMonitoringService::makePathLegendaJson() {
Json::Value legendaVector(Json::arrayValue);
for(int i = 0; i < encPath_[0].current_; i++)
legendaVector.append(Json::Value(*((const std::string *)(encPath_[0].decode(i)))));
legendaVector.append(Json::Value(*(static_cast<const std::string *>(encPath_[0].decode(i)))));
Json::Value valReserved(nReservedPaths);
Json::Value pathLegend;
pathLegend["names"]=legendaVector;
Expand All @@ -100,7 +100,7 @@ namespace evf{
std::string FastMonitoringService::makeModuleLegendaJson(){
Json::Value legendaVector(Json::arrayValue);
for(int i = 0; i < encModule_.current_; i++)
legendaVector.append(Json::Value(((const edm::ModuleDescription *)(encModule_.decode(i)))->moduleLabel()));
legendaVector.append(Json::Value((static_cast<const edm::ModuleDescription *>(encModule_.decode(i)))->moduleLabel()));
Json::Value valReserved(nReservedModules);
Json::Value valSpecial(nSpecialModules);
Json::Value valOutputModules(nOutputModules_);
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace evf{
macrostate_=FastMonitoringThread::sInit;

for(unsigned int i = 0; i < (mCOUNT); i++)
encModule_.updateReserved((void*)(reservedMicroStateNames+i));
encModule_.updateReserved(static_cast<const void*>(reservedMicroStateNames+i));
encModule_.completeReservedWithDummies();

for (unsigned int i=0;i<nStreams_;i++) {
Expand All @@ -191,7 +191,7 @@ namespace evf{

//path (mini) state
encPath_.emplace_back(0);
encPath_[i].update((void*)&nopath_);
encPath_[i].update(static_cast<const void*>(&nopath_));
eventCountForPathInit_.push_back(0);
firstEventId_.push_back(0);
collectedPathList_.push_back(new std::atomic<bool>(0));
Expand Down Expand Up @@ -239,7 +239,6 @@ namespace evf{
<< " LS:" << sc.eventID().luminosityBlock() << " " << context;
std::lock_guard<std::mutex> lock(fmt_.monlock_);
exceptionInLS_.push_back(sc.eventID().luminosityBlock());
//exception_detected_=true;
}

void FastMonitoringService::preGlobalEarlyTermination(edm::GlobalContext const& gc, edm::TerminationOrigin to)
Expand All @@ -252,7 +251,6 @@ namespace evf{
<< gc.luminosityBlockID().luminosityBlock() << " " << context;
std::lock_guard<std::mutex> lock(fmt_.monlock_);
exceptionInLS_.push_back(gc.luminosityBlockID().luminosityBlock());
//exception_detected_=true;
}

void FastMonitoringService::preSourceEarlyTermination(edm::TerminationOrigin to)
Expand Down

0 comments on commit 6aa77b2

Please sign in to comment.