]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGlobalCrateConfig.cxx
Fixes for coding violations
[u/mrichter/AliRoot.git] / MUON / AliMUONGlobalCrateConfig.cxx
index 70479a5e7f6e415e675134ce56317d6128ee697e..24fbec2c84fb7302182f89f2eb8dabbcc7437f11 100644 (file)
@@ -231,8 +231,8 @@ Int_t AliMUONGlobalCrateConfig::ReadData(const TString& fileName)
         in.getline(line, 255);
         tmp = AliMpHelper::Normalize(line);
         ULong_t addr;
-        if (addr) nDarc++;
         sscanf(tmp.Data(), "%lx", &addr);
+        if (addr) nDarc++;
         SetSecondDarcVmeAddr(addr);
         AliDebug(1, Form("Second Darc Vme Address: 0x%lx", addr));
         
@@ -360,7 +360,7 @@ TString AliMUONGlobalCrateConfig::GetJtagCrateName(Int_t jtagLine, Int_t index)
 UInt_t AliMUONGlobalCrateConfig::GetGlobalRegister(Int_t index) const       
 {
   /// return global register for a given index
-  if (index > fgkGlobalNofRegisters) {
+  if (index >= fgkGlobalNofRegisters) {
     AliWarning("Index size too big for Global Register");
     return 0;
   } else 
@@ -371,7 +371,7 @@ UInt_t AliMUONGlobalCrateConfig::GetGlobalRegister(Int_t index) const
 void AliMUONGlobalCrateConfig::SetGlobalRegister(Int_t index, UInt_t reg) 
 {
   /// set Global register for a given index
-  if (index > fgkGlobalNofRegisters) {
+  if (index >= fgkGlobalNofRegisters) {
     AliWarning("Index size too big for Global Register");
     return;
   } 
@@ -419,7 +419,7 @@ Bool_t AliMUONGlobalCrateConfig::GetMasksOn() const
 UInt_t AliMUONGlobalCrateConfig::GetFetRegister(Int_t index) const       
 {
   /// return global register for a given index
-  if (index > fgkFetNofRegisters) {
+  if (index >= fgkFetNofRegisters) {
     AliWarning("Index size too big for Fet Register");
     return 0;
   } else 
@@ -430,7 +430,7 @@ UInt_t AliMUONGlobalCrateConfig::GetFetRegister(Int_t index) const
 void AliMUONGlobalCrateConfig::SetFetRegister(Int_t index, UInt_t reg) 
 {
   /// set Global register for a given index
-  if (index > fgkFetNofRegisters) {
+  if (index >= fgkFetNofRegisters) {
     AliWarning("Index size too big for Global Register");
     return;
   }