Skip to content

Commit

Permalink
avoid returning local variable pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Jun 16, 2015
1 parent 1b40126 commit 082b10f
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions STEER/STEER/AliQAv1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -320,29 +320,9 @@ const char * AliQAv1::GetAliTaskName(ALITASK_t tsk)
//_______________________________________________________________
const char * AliQAv1::GetBitName(QABIT_t bit) const
{
// returns the char name corresponding to bit
TString bitName ;
switch (bit) {
case kNULLBit:
bitName = "NONE" ;
break ;
case kINFO:
bitName = "INFO" ;
break ;
case kWARNING:
bitName = "WARNING" ;
break ;
case kERROR:
bitName = "ERROR" ;
break ;
case kFATAL:
bitName = "FATAL" ;
break ;
default:
bit = kNULLBit ;
break ;
}
return bitName.Data() ;
const char* bitName[kNBIT+1]={"NONE","INFO","WARNING","ERROR","FATAL"};
if (bit>=kNULLBit && bit<kNBIT) return bitName[int(bit)-kNULLBit];
return 0;
}

//_______________________________________________________________
Expand Down

0 comments on commit 082b10f

Please sign in to comment.