Bug fix: When moving from C style pointer based strings to the C++ string
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Feb 2007 09:04:45 +0000 (09:04 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Feb 2007 09:04:45 +0000 (09:04 +0000)
class the memebr initialization list was not updated accordingly.
The member fDirectory and fFilename was initialized to zero wich
is fine for a C pointerbased string but when used to initialize a string
with the statement fDirctory(0) it is intepret as an attemt to initialize
a string object with a C character string starting at 0.
The error cuase a runtime error of aliroot, but is now fixed.

HLT/PHOS/AliHLTPHOSFileWriter.cxx
HLT/PHOS/AliHLTPHOSFileWriterComponent.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzerComponent.cxx

index 82c5e8aeeb497300ab993b56ba8e902fc9d94ba8..ef76b6c1eff5f4e3851bb0a90c6e8c8caaa97fbd 100644 (file)
@@ -5,7 +5,7 @@
 using std::string;
 
 
-AliHLTPHOSFileWriter::AliHLTPHOSFileWriter():fCurrentEvntCnt(0), fCurrentFile(0), fDirectory(0), fCurrentFilename(0)
+AliHLTPHOSFileWriter::AliHLTPHOSFileWriter():fCurrentEvntCnt(0), fCurrentFile(0), fDirectory(""), fCurrentFilename("")
 {
 
 }
index 2ea42c2c95297395b0c43ab2e4f106421157f3a0..91ce79708bb51f11515bdd9034a58fef0ccc6fb5 100644 (file)
@@ -34,7 +34,8 @@ const AliHLTComponentDataType AliHLTPHOSFileWriterComponent::fInputDataTypes[]={
 
 AliHLTPHOSFileWriterComponent gAliHLTPHOSFileWriterComponent;
 
-AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent():AliHLTDataSink(), fCellEnergiesFileWriterPtr(0), fDDLPackedFileWriterPtr(0), fDirectory(0),fFilename(0), fEventCount(0)
+AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent():AliHLTDataSink(), fCellEnergiesFileWriterPtr(0), fDDLPackedFileWriterPtr(0), fDirectory(""),fFilename(""), fEventCount(0)
+  //AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent():AliHLTDataSink()
 {
   for(int i=0; i<N_DATATYPES; i++)
     {
@@ -53,7 +54,8 @@ AliHLTPHOSFileWriterComponent::~AliHLTPHOSFileWriterComponent()
 }
 
 
-AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent(const AliHLTPHOSFileWriterComponent & ):AliHLTDataSink(), fCellEnergiesFileWriterPtr(0), fDDLPackedFileWriterPtr(0), fDirectory(0),fFilename(0), fEventCount(0)
+AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent(const AliHLTPHOSFileWriterComponent & ):AliHLTDataSink(), fCellEnergiesFileWriterPtr(0), fDDLPackedFileWriterPtr(0), fDirectory(""),fFilename(""), fEventCount(0)
+  //AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent(const AliHLTPHOSFileWriterComponent & ):AliHLTDataSink()
 {
 
 }
@@ -200,6 +202,7 @@ AliHLTPHOSFileWriterComponent::DoInit( int argc, const char** argv )
   string dataType="";
   int bMissingParam=0;
 
+
   fFilename.assign(256,0);
 
   for(int i=0; i<argc; i++)
index 8e9a7dc096526995cbef1951b220e5252e30a9b0..b5431d3985a45154d1e5b80af46f0dcf0a4773e0 100644 (file)
 const AliHLTComponentDataType AliHLTPHOSRawAnalyzerComponent::inputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
 int   AliHLTPHOSRawAnalyzerComponent::fEventCount = 0; 
 
-AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTProcessor(), fEquippmentID(0), fRcuX(0), 
-fRcuZ(0),fRcuRowOffeset(0), fRcuColOffeset(0),  fModuleID(0), fPHOSRawStream(), fRawMemoryReader(0), fOutPtr(0)
+
+AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTProcessor(),fEquippmentID(0), fRcuX(0), 
+fRcuZ(0),fRcuRowOffeset(0), fRcuColOffeset(0),  fModuleID(0), fPHOSRawStream(0), fRawMemoryReader(0), fOutPtr(0)
+//AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTProcessor()
 {
 
 } 
@@ -52,7 +54,7 @@ AliHLTPHOSRawAnalyzerComponent::~AliHLTPHOSRawAnalyzerComponent()
 
 
 AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent(const AliHLTPHOSRawAnalyzerComponent & ) : AliHLTProcessor(), 
-fEquippmentID(0), fRcuX(0), fRcuZ(0),fRcuRowOffeset(0), fRcuColOffeset(0),  fModuleID(0), fPHOSRawStream(), fRawMemoryReader(0), fOutPtr(0)
+fEquippmentID(0), fRcuX(0), fRcuZ(0),fRcuRowOffeset(0), fRcuColOffeset(0),  fModuleID(0), fPHOSRawStream(0), fRawMemoryReader(0), fOutPtr(0)
 {
 }