From: marian Date: Sat, 18 Dec 2010 13:15:00 +0000 (+0000) Subject: Removing Coverity problems, bugs X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=f99d7d414f0cfa769b7db9a073544feec6d9321f Removing Coverity problems, bugs AliTPCParamSR.cxx AliTPCParamCR.cxx - OVERRUN_STATIC AliTPCParam.h - initialization of array AliTPCtrackerParam.cxx - Negative index --- diff --git a/TPC/AliTPCParam.h b/TPC/AliTPCParam.h index 50509ddd4f4..d3bf7da2a6c 100644 --- a/TPC/AliTPCParam.h +++ b/TPC/AliTPCParam.h @@ -520,7 +520,7 @@ inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const //we must have information about sector! //rotate to given sector Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]}; - Double_t xyzlocal[3]; + Double_t xyzlocal[3]={0,0,0}; if (index[1]>=0 && index[1]MasterToLocal(xyzmaster,xyzlocal); xyz[0] = xyzlocal[0]; diff --git a/TPC/AliTPCParamCR.cxx b/TPC/AliTPCParamCR.cxx index 42a4cb284cd..49964394973 100644 --- a/TPC/AliTPCParamCR.cxx +++ b/TPC/AliTPCParamCR.cxx @@ -173,7 +173,7 @@ void AliTPCParamCR::CRXYZtoXYZ(Float_t *xyz, { //transform relative coordinates to absolute Bool_t rel = ( (option&2)!=0); - Int_t index[2]={sector,padrow}; + Int_t index[3]={sector,padrow,0}; if (rel==kTRUE) Transform4to3(xyz,index);//if the position is relative to pad row Transform2to1(xyz,index); } @@ -187,7 +187,7 @@ void AliTPCParamCR::XYZtoCRXYZ(Float_t *xyz, //if option=2 X relative to pad row calculate sector //if option=3 X relative use input sector //!!!!!!!!! WE start to calculate rows from row = 0 - Int_t index[2]; + Int_t index[3]={0,0,0}; Bool_t rel = ( (option&2)!=0); //option 0 and 2 means that we don't have information about sector diff --git a/TPC/AliTPCParamSR.cxx b/TPC/AliTPCParamSR.cxx index 6cf2d1778ab..6fdc951af56 100644 --- a/TPC/AliTPCParamSR.cxx +++ b/TPC/AliTPCParamSR.cxx @@ -238,7 +238,7 @@ void AliTPCParamSR::CRXYZtoXYZ(Float_t *xyz, { //transform relative coordinates to absolute Bool_t rel = ( (option&2)!=0); - Int_t index[2]={sector,padrow}; + Int_t index[3]={sector,padrow,0}; if (rel==kTRUE) Transform4to3(xyz,index);//if the position is relative to pad row Transform2to1(xyz,index); } diff --git a/TPC/AliTPCtrackerParam.cxx b/TPC/AliTPCtrackerParam.cxx index 60983c3e8b8..ec8f28ee610 100644 --- a/TPC/AliTPCtrackerParam.cxx +++ b/TPC/AliTPCtrackerParam.cxx @@ -356,7 +356,7 @@ Int_t AliTPCtrackerParam::BuildTPCtracks(AliESDEvent *event) { TObjArray sArray(20000); // get the particles stack - nParticles = (Int_t)gAlice->GetEvent(evt); + nParticles = (UInt_t)gAlice->GetEvent(evt); Bool_t *done = new Bool_t[nParticles]; Int_t *pdgCodes = new Int_t[nParticles];