From 3e3de3ef12751b436bec23982d9e02fa09d90a34 Mon Sep 17 00:00:00 2001
From: Philippe Canal <pcanal@fnal.gov>
Date: Sat, 9 Apr 2016 17:51:25 -0500
Subject: [PATCH] Avoid confusing/misleading code layout (were triggering
 misleading indentation warning)

---
 gui/gui/src/TGFSContainer.cxx        |  6 ++-
 gui/gui/src/TGFileBrowser.cxx        |  3 +-
 hist/hist/src/TFormula_v5.cxx        | 79 ++++++++++++++++++----------
 math/mlp/src/TMLPAnalyzer.cxx        |  3 +-
 tree/tree/src/TTreeCacheUnzip.cxx    | 21 ++++----
 tree/treeplayer/src/TTreeFormula.cxx | 21 +++++---
 6 files changed, 82 insertions(+), 51 deletions(-)

diff --git a/gui/gui/src/TGFSContainer.cxx b/gui/gui/src/TGFSContainer.cxx
index f557db25dc3..3bc000c68c1 100644
--- a/gui/gui/src/TGFSContainer.cxx
+++ b/gui/gui/src/TGFSContainer.cxx
@@ -649,7 +649,8 @@ void TGFileContainer::GetFilePictures(const TGPicture **pic,
             *pic = fClient->GetPicturePool()->GetPicture(lnk_name.Data(),
                                  img1->GetPixmap(), img1->GetMask());
             fCleanups->Add(((TObject *)*pic));
-            if (img2) delete img2; delete img1;
+            if (img2) delete img2;
+            delete img1;
          }
          img1 = TImage::Create();
          if (img1) {
@@ -662,7 +663,8 @@ void TGFileContainer::GetFilePictures(const TGPicture **pic,
             *lpic = fClient->GetPicturePool()->GetPicture(lnk_name.Data(),
                                  img1->GetPixmap(), img1->GetMask());
             fCleanups->Add(((TObject *)*lpic));
-            if (img2) delete img2; delete img1;
+            if (img2) delete img2;
+            delete img1;
          }
       }
       else {
diff --git a/gui/gui/src/TGFileBrowser.cxx b/gui/gui/src/TGFileBrowser.cxx
index 321d4f836ab..336bfb68404 100644
--- a/gui/gui/src/TGFileBrowser.cxx
+++ b/gui/gui/src/TGFileBrowser.cxx
@@ -1194,7 +1194,8 @@ static const TGPicture *MakeLinkPic(const TGPicture *pic)
       lnk_name.Prepend("lnk_");
       merged = gClient->GetPicturePool()->GetPicture(lnk_name.Data(),
                                           img1->GetPixmap(), img1->GetMask());
-      if (img2) delete img2; delete img1;
+      if (img2) delete img2;
+      delete img1;
       return merged;
    }
    return pic;
diff --git a/hist/hist/src/TFormula_v5.cxx b/hist/hist/src/TFormula_v5.cxx
index 4fcaa7f8b6b..9fdd4666165 100644
--- a/hist/hist/src/TFormula_v5.cxx
+++ b/hist/hist/src/TFormula_v5.cxx
@@ -2731,14 +2731,15 @@ Double_t TFormula::EvalParOld(const Double_t *x, const Double_t *uparams)
          case kcosh : tab[pos-1] = TMath::CosH(tab[pos-1]); continue;
          case ksinh : tab[pos-1] = TMath::SinH(tab[pos-1]); continue;
          case ktanh : if (TMath::CosH(tab[pos-1]) == 0) {tab[pos-1] = 0;} // { tangente indeterminee }
-                        else tab[pos-1] = TMath::TanH(tab[pos-1]);
-                        continue;
+                      else tab[pos-1] = TMath::TanH(tab[pos-1]);
+                      continue;
          case kacosh: if (tab[pos-1] < 1) {tab[pos-1] = 0;} //  indetermination
-                        else tab[pos-1] = TMath::ACosH(tab[pos-1]);
-                        continue;
+                      else tab[pos-1] = TMath::ACosH(tab[pos-1]);
+                      continue;
          case kasinh: tab[pos-1] = TMath::ASinH(tab[pos-1]); continue;
          case katanh: if (TMath::Abs(tab[pos-1]) > 1) {tab[pos-1] = 0;} // indetermination
-                        else tab[pos-1] = TMath::ATanH(tab[pos-1]); continue;
+                      else tab[pos-1] = TMath::ATanH(tab[pos-1]);
+                      continue;
          case katan2: pos--; tab[pos-1] = TMath::ATan2(tab[pos-1],tab[pos]); continue;
 
          case kfmod : pos--; tab[pos-1] = fmod(tab[pos-1],tab[pos]); continue;
@@ -2748,21 +2749,22 @@ Double_t TFormula::EvalParOld(const Double_t *x, const Double_t *uparams)
 
          case kstrstr : strpos -= 2; pos-=2; pos++;
                         if (strstr(stringStack[strpos],stringStack[strpos+1])) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                        else tab[pos-1]=0;
+                        continue;
 
          case kmin : pos--; tab[pos-1] = TMath::Min(tab[pos-1],tab[pos]); continue;
          case kmax : pos--; tab[pos-1] = TMath::Max(tab[pos-1],tab[pos]); continue;
 
          case klog  : if (tab[pos-1] > 0) tab[pos-1] = TMath::Log(tab[pos-1]);
-                        else {tab[pos-1] = 0;} //{indetermination }
-                        continue;
+                      else {tab[pos-1] = 0;} //{indetermination }
+                      continue;
          case kexp  : { Double_t dexp = tab[pos-1];
                         if (dexp < -700) {tab[pos-1] = 0; continue;}
                         if (dexp >  700) {tab[pos-1] = TMath::Exp(700); continue;}
                         tab[pos-1] = TMath::Exp(dexp); continue;  }
          case klog10: if (tab[pos-1] > 0) tab[pos-1] = TMath::Log10(tab[pos-1]);
-                        else {tab[pos-1] = 0;} //{indetermination }
-                        continue;
+                      else {tab[pos-1] = 0;} //{indetermination }
+                      continue;
 
          case kpi   : pos++; tab[pos-1] = TMath::ACos(-1); continue;
 
@@ -2775,30 +2777,41 @@ Double_t TFormula::EvalParOld(const Double_t *x, const Double_t *uparams)
          case krndm : pos++; tab[pos-1] = gRandom->Rndm(1); continue;
 
          case kAnd  : pos--; if (tab[pos-1]!=0 && tab[pos]!=0) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                             else tab[pos-1]=0;
+                      continue;
          case kOr   : pos--; if (tab[pos-1]!=0 || tab[pos]!=0) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                             else tab[pos-1]=0;
+                      continue;
          case kEqual: pos--; if (tab[pos-1] == tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                             else tab[pos-1]=0;
+                      continue;
          case kNotEqual : pos--; if (tab[pos-1] != tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                                 else tab[pos-1]=0;
+                          continue;
          case kLess     : pos--; if (tab[pos-1] < tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                          else tab[pos-1]=0;
+                          continue;
          case kGreater  : pos--; if (tab[pos-1] > tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                          else tab[pos-1]=0;
+                          continue;
 
          case kLessThan: pos--; if (tab[pos-1]<=tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                         else tab[pos-1]=0;
+                         continue;
          case kGreaterThan: pos--; if (tab[pos-1]>=tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
-         case kNot : if (tab[pos-1]!=0) tab[pos-1] = 0; else tab[pos-1] = 1; continue;
+                            else tab[pos-1]=0;
+                            continue;
+         case kNot : if (tab[pos-1]!=0) tab[pos-1] = 0; else tab[pos-1] = 1;
+                     continue;
 
          case kStringEqual : strpos -= 2; pos -=2 ; pos++;
                         if (!strcmp(stringStack[strpos+1],stringStack[strpos])) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                        else tab[pos-1]=0;
+                        continue;
          case kStringNotEqual: strpos -= 2; pos -= 2; pos++;
                         if (strcmp(stringStack[strpos+1],stringStack[strpos])) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                        else tab[pos-1]=0;
+                        continue;
 
          case kBitAnd : pos--; tab[pos-1]= ((Int_t) tab[pos-1]) & ((Int_t) tab[pos]); continue;
          case kBitOr  : pos--; tab[pos-1]= ((Int_t) tab[pos-1]) | ((Int_t) tab[pos]); continue;
@@ -4247,10 +4260,12 @@ Double_t TFormula::EvalParFast(const Double_t *x, const Double_t *uparams)
       //
       switch(opcode) {
          case kBoolOptimizeAnd: {
-            if (!tab[pos-1]) i=fOperOffset[i].fToJump; continue;
+            if (!tab[pos-1]) i=fOperOffset[i].fToJump;
+            continue;
          }
          case kBoolOptimizeOr: {
-            if (tab[pos-1])  i=fOperOffset[i].fToJump; continue;
+            if (tab[pos-1])  i=fOperOffset[i].fToJump;
+            continue;
          }
          case kAnd  : pos--; tab[pos-1] = (bool)tab[pos];  continue;  // use the fact that other were check before - see bool optimize
          case kOr   : pos--; tab[pos-1] = (bool)tab[pos];  continue;
@@ -4274,7 +4289,8 @@ Double_t TFormula::EvalParFast(const Double_t *x, const Double_t *uparams)
 
          case kstrstr : strpos -= 2; pos-=2; pos++;
             if (strstr(stringStack[strpos],stringStack[strpos+1])) tab[pos-1]=1;
-            else tab[pos-1]=0; continue;
+            else tab[pos-1]=0;
+            continue;
          case kpi   : pos++; tab[pos-1] = TMath::ACos(-1); continue;
 
 
@@ -4284,17 +4300,22 @@ Double_t TFormula::EvalParFast(const Double_t *x, const Double_t *uparams)
 
 
          case kEqual: pos--; if (tab[pos-1] == tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
+                      else tab[pos-1]=0;
+                      continue;
          case kNotEqual : pos--; if (tab[pos-1] != tab[pos]) tab[pos-1]=1;
-                        else tab[pos-1]=0; continue;
-         case kNot : if (tab[pos-1]!=0) tab[pos-1] = 0; else tab[pos-1] = 1; continue;
+                          else tab[pos-1]=0;
+                          continue;
+         case kNot : if (tab[pos-1]!=0) tab[pos-1] = 0; else tab[pos-1] = 1;
+                     continue;
 
          case kStringEqual : strpos -= 2; pos -=2 ; pos++;
             if (!strcmp(stringStack[strpos+1],stringStack[strpos])) tab[pos-1]=1;
-            else tab[pos-1]=0; continue;
+            else tab[pos-1]=0;
+            continue;
          case kStringNotEqual: strpos -= 2; pos -= 2; pos++;
             if (strcmp(stringStack[strpos+1],stringStack[strpos])) tab[pos-1]=1;
-            else tab[pos-1]=0; continue;
+            else tab[pos-1]=0;
+            continue;
 
          case kBitAnd : pos--; tab[pos-1]= ((Int_t) tab[pos-1]) & ((Int_t) tab[pos]); continue;
          case kBitOr  : pos--; tab[pos-1]= ((Int_t) tab[pos-1]) | ((Int_t) tab[pos]); continue;
diff --git a/math/mlp/src/TMLPAnalyzer.cxx b/math/mlp/src/TMLPAnalyzer.cxx
index 39fa137d5bd..82fd92da531 100644
--- a/math/mlp/src/TMLPAnalyzer.cxx
+++ b/math/mlp/src/TMLPAnalyzer.cxx
@@ -273,7 +273,8 @@ void TMLPAnalyzer::GatherInformations()
    delete[] outVal;
    delete[] trueVal;
    delete[] index;
-   for(i=0; i<GetNeurons(1); i++) delete formulas[i]; delete [] formulas;
+   for(i=0; i<GetNeurons(1); i++) delete formulas[i];
+   delete [] formulas;
    fAnalysisTree->ResetBranchAddresses();
    fIOTree->ResetBranchAddresses();
 }
diff --git a/tree/tree/src/TTreeCacheUnzip.cxx b/tree/tree/src/TTreeCacheUnzip.cxx
index d8336c554b4..763e7b4146c 100644
--- a/tree/tree/src/TTreeCacheUnzip.cxx
+++ b/tree/tree/src/TTreeCacheUnzip.cxx
@@ -1130,18 +1130,17 @@ Int_t TTreeCacheUnzip::UnzipCache(Int_t &startindex, Int_t &locbuffsz, char *&lo
       locbuffsz = rdlen;
       locbuff = new char[locbuffsz];
       //memset(locbuff, 0, locbuffsz);
-   } else
-      if(locbuffsz > rdlen*3) {
-         if (locbuff) delete [] locbuff;
-         locbuffsz = rdlen*2;
-         locbuff = new char[locbuffsz];
-         //memset(locbuff, 0, locbuffsz);
-      }
-
-      if (gDebug > 0)
-      Info("UnzipCache", "Going to unzip block %d", idxtounzip);
+   } else if(locbuffsz > rdlen*3) {
+      if (locbuff) delete [] locbuff;
+      locbuffsz = rdlen*2;
+      locbuff = new char[locbuffsz];
+      //memset(locbuff, 0, locbuffsz);
+   }
+   
+   if (gDebug > 0)
+     Info("UnzipCache", "Going to unzip block %d", idxtounzip);
 
-      readbuf = ReadBufferExt(locbuff, rdoffs, rdlen, loc);
+   readbuf = ReadBufferExt(locbuff, rdoffs, rdlen, loc);
 
    {
       R__LOCKGUARD(fMutexList);
diff --git a/tree/treeplayer/src/TTreeFormula.cxx b/tree/treeplayer/src/TTreeFormula.cxx
index b51748c971b..e31cfa6661d 100644
--- a/tree/treeplayer/src/TTreeFormula.cxx
+++ b/tree/treeplayer/src/TTreeFormula.cxx
@@ -4026,7 +4026,8 @@ T TTreeFormula::EvalInstance(Int_t instance, const char *stringStackArg[])
                          continue;
             case kasinh: tab[pos-1] = TMath::ASinH(tab[pos-1]); continue;
             case katanh: if (TMath::Abs(tab[pos-1]) > 1) {tab[pos-1] = 0;} // indetermination
-                     else tab[pos-1] = TMath::ATanH(tab[pos-1]); continue;
+                         else tab[pos-1] = TMath::ATanH(tab[pos-1]);
+                         continue;
             case katan2: pos--; tab[pos-1] = TMath::ATan2(tab[pos-1],tab[pos]); continue;
 
             case kfmod : pos--; tab[pos-1] = fmod_local(tab[pos-1],tab[pos]); continue;
@@ -4035,7 +4036,8 @@ T TTreeFormula::EvalInstance(Int_t instance, const char *stringStackArg[])
             case ksqrt : tab[pos-1] = TMath::Sqrt(TMath::Abs(tab[pos-1])); continue;
 
             case kstrstr : pos2 -= 2; pos++;if (strstr(stringStack[pos2],stringStack[pos2+1])) tab[pos-1]=1;
-                                        else tab[pos-1]=0; continue;
+                                            else tab[pos-1]=0;
+                           continue;
 
             case kmin : pos--; tab[pos-1] = std::min(tab[pos-1],tab[pos]); continue;
             case kmax : pos--; tab[pos-1] = std::max(tab[pos-1],tab[pos]); continue;
@@ -4055,15 +4057,18 @@ T TTreeFormula::EvalInstance(Int_t instance, const char *stringStackArg[])
             case kpi   : pos++; tab[pos-1] = TMath::ACos(-1); continue;
 
             case kabs  : tab[pos-1] = TMath::Abs(tab[pos-1]); continue;
-            case ksign : if (tab[pos-1] < 0) tab[pos-1] = -1; else tab[pos-1] = 1; continue;
+            case ksign : if (tab[pos-1] < 0) tab[pos-1] = -1; else tab[pos-1] = 1;
+                         continue;
             case kint  : tab[pos-1] = T(Long64_t(tab[pos-1])); continue;
             case kSignInv: tab[pos-1] = -1 * tab[pos-1]; continue;
             case krndm : pos++; tab[pos-1] = gRandom->Rndm(1); continue;
 
             case kAnd  : pos--; if (tab[pos-1]!=0 && tab[pos]!=0) tab[pos-1]=1;
-                                else tab[pos-1]=0; continue;
+                                else tab[pos-1]=0;
+                         continue;
             case kOr   : pos--; if (tab[pos-1]!=0 || tab[pos]!=0) tab[pos-1]=1;
-                                else tab[pos-1]=0; continue;
+                                else tab[pos-1]=0;
+                         continue;
 
             case kEqual      : pos--; tab[pos-1] = (tab[pos-1] == tab[pos]) ? 1 : 0; continue;
             case kNotEqual   : pos--; tab[pos-1] = (tab[pos-1] != tab[pos]) ? 1 : 0; continue;
@@ -4074,9 +4079,11 @@ T TTreeFormula::EvalInstance(Int_t instance, const char *stringStackArg[])
             case kNot        :        tab[pos-1] = (tab[pos-1] !=        0) ? 0 : 1; continue;
 
             case kStringEqual : pos2 -= 2; pos++; if (!strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
-                                                  else tab[pos-1]=0; continue;
+                                                  else tab[pos-1]=0;
+                                continue;
             case kStringNotEqual: pos2 -= 2; pos++;if (strcmp(stringStack[pos2+1],stringStack[pos2])) tab[pos-1]=1;
-                                                   else tab[pos-1]=0; continue;
+                                                   else tab[pos-1]=0;
+                                  continue;
 
             case kBitAnd    : pos--; tab[pos-1]= ((ULong64_t) tab[pos-1]) & ((ULong64_t) tab[pos]); continue;
             case kBitOr     : pos--; tab[pos-1]= ((ULong64_t) tab[pos-1]) | ((ULong64_t) tab[pos]); continue;
-- 
GitLab