]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliDigits.cxx
Using the robust option of AliRelAlignerKalman
[u/mrichter/AliRoot.git] / TPC / AliDigits.cxx
index 9dc17623a2c447c2a07358cc524e59ec64fb073c..710097e7f5b615db2e99531d6783c0cda07192f8 100644 (file)
@@ -126,8 +126,8 @@ AliDigits::~AliDigits()
 Bool_t AliDigits::OutOfBoundsError(const char *where, Int_t row, Int_t column) 
 {
    // Generate an out-of-bounds error. Always returns false.
-   ::Error(where, "row %d  col %d out of bounds (size: %d x %d, this: 0x%08x)", 
-          row, column, fNrows, fNcols, this);
+   ::Error(where, "row %d  col %d out of bounds (size: %d x %d, this: 0x%08lx)", 
+          row, column, fNrows, fNcols, (ULong_t) this);
    return kFALSE;
 }
 
@@ -176,9 +176,11 @@ void AliDigits::Allocate(Int_t rows, Int_t columns)
 Int_t AliDigits::GetSize()
 {
   //
-  //return size of object
+  //return size of object as represented in the memory
   //
-  Int_t size = sizeof(this);
+  //  Int_t size = sizeof(this);
+  Int_t size = 0;   // COVERITY consider the previous statment as bug 
+                    // 
   if (fIndex!=0) size+= sizeof(fIndex)+fIndex->GetSize()*sizeof(Int_t);
   if (fElements!=0) size+= sizeof(fElements)+fElements->GetSize()*sizeof(Short_t);
   return size;
@@ -309,7 +311,7 @@ AliH2F *  AliDigits::GenerHisto()
   //
   //make digits histo 
   char ch[30];
-  sprintf(ch,"Segment_%d ",GetID());
+  snprintf(ch,30, "Segment_%d ",GetID());
   if ( (fNrows<1)|| (fNcols<1)) {
     return 0;
   }
@@ -365,6 +367,7 @@ void AliDigits::ExpandBuffer1()
     }else 
       if (row>fNrows){
        Invalidate();
+       delete [] buf;
        return;
       }      
   }
@@ -431,7 +434,7 @@ Bool_t AliDigits::First0()
   fCurrentCol = -1;
   fCurrentIndex = -1;
   Int_t i;
-  for (i=0; (( i<fNelems) && (fElements->At(i)<=fThreshold));i++);  //MI1211
+  for (i=0; (( i<fNelems) && (fElements->At(i)<=fThreshold));i++) {}  //MI1211
   if (i == fNelems) return kFALSE;
   fCurrentCol =i/fNrows;
   fCurrentRow =i%fNrows;
@@ -446,7 +449,7 @@ Bool_t AliDigits::Next0()
   //
   if (fCurrentIndex<0) return kFALSE;  // if we didn't adjust first 
   Int_t i;
-  for (i=fCurrentIndex+1; ( (i<fNelems) && (fElements->At(i)<=fThreshold) ) ;i++);
+  for (i=fCurrentIndex+1; ( (i<fNelems) && (fElements->At(i)<=fThreshold) ) ;i++) {}
   if (i >= fNelems)  {
     fCurrentIndex = -1;
     return kFALSE;