]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing warnings
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 09:10:56 +0000 (09:10 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 09:10:56 +0000 (09:10 +0000)
STEER/STEER/AliTrackResiduals.cxx
STEER/STEERBase/AliLog.cxx

index b7377fbf19b247524ee6432065d746dae280d280..d3f06c497854bf57e78b915fc836a371b794ab75 100644 (file)
@@ -101,9 +101,6 @@ AliTrackResiduals::AliTrackResiduals(const AliTrackResiduals &res):
          fTrackArray[itrack] = new AliTrackPointArray(*res.fTrackArray[itrack]);
       }
 
-  memcpy(fBFixed,res.fBFixed,sizeof(Float_t)*6);
-  memcpy(fFixed,res.fFixed,sizeof(Float_t)*6);
-
 }
 
 //_____________________________________________________________________________
@@ -111,25 +108,22 @@ AliTrackResiduals &AliTrackResiduals::operator =(const AliTrackResiduals& res)
 {
   // assignment operator
   // Does not copy the track point arrays
-  if(this==&res) return *this;
-  ((TObject *)this)->operator=(res);
-
-  fN = res.fN;
-  fLast = res.fLast;
-  fChi2 = res.fChi2;
-  fNdf  = res.fNdf;
-  fMinNPoints = res.fMinNPoints;
-  fIsOwner = kFALSE;
-  fAlignObj = res.fAlignObj;
-
-  fVolArray = res.fVolArray;
-  fTrackArray = res.fTrackArray;
-
-  for(Int_t i=0;i<6;i++) { 
-    fBFixed[i]=res.fBFixed[i];
-    fFixed[i]=res.fFixed[i];
+  if(this!=&res) {
+    TObject::operator=(res);
+    
+    fN = res.fN;
+    fLast = res.fLast;
+    fAlignObj = res.fAlignObj;
+    fVolArray = res.fVolArray;
+    fTrackArray = res.fTrackArray;
+    fChi2 = res.fChi2;
+    fNdf  = res.fNdf;
+    fMinNPoints = res.fMinNPoints;
+    fIsOwner = kFALSE;
+    
+    memcpy(fBFixed,res.fBFixed,sizeof(Float_t)*6);
+    memcpy(fFixed,res.fFixed,sizeof(Float_t)*6);
   }
-
   return *this;
 }
 
index 5258eb8d0428302ad60842e9408dc455978b0a18..447d65bdd050acce1a9e8d7c2c892baba9a10610 100644 (file)
@@ -976,13 +976,13 @@ Int_t AliLog::RedirectTo(FILE* stream, EType_t type, UInt_t level,
   // redirect stream
   if ((type == kDebug) && (level > 0)) level--;
   if (type + level > GetLogLevel(module, className)) { // /dev/null
-    freopen("/dev/null", "a", stream);
+    if(!freopen("/dev/null", "a", stream)) AliWarning("Cannot reopen /dev/null");
   } else if (fOutputTypes[type] == 0) {         // stdout
     if (stream != stdout) dup2(fileno(stdout), fileno(stream));
   } else if (fOutputTypes[type] == 1) {         // stderr
     if (stream != stderr) dup2(fileno(stderr), fileno(stream));
   } else if (fOutputTypes[type] == 2) {         // file
-    freopen(fFileNames[type], "a", stream);
+    if(!freopen(fFileNames[type], "a", stream)) AliWarning(Form("Cannot reopen %s",fFileNames[type].Data()));
   } else if (fOutputTypes[type] == 3) {         // external C++ stream
     // redirection is not possible for external C++ streams
   }