]> Creatis software - gdcm.git/commitdiff
STYLE: minor clean up
authormalaterre <malaterre>
Tue, 11 Jan 2005 00:21:48 +0000 (00:21 +0000)
committermalaterre <malaterre>
Tue, 11 Jan 2005 00:21:48 +0000 (00:21 +0000)
src/gdcmDocEntryArchive.cxx
src/gdcmDocument.cxx
src/gdcmElementSet.cxx
src/gdcmFile.cxx
src/gdcmSQItem.cxx
src/gdcmSerieHeader.cxx
src/gdcmVR.cxx

index 38ba52d7263c209894186cf34c76241d2498663b..c47596ef4975526423c1f9d3effba1912fd0be7b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntryArchive.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/06 16:05:06 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/01/11 00:21:48 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -72,7 +72,7 @@ void DocEntryArchive::Print(std::ostream &os)
 bool DocEntryArchive::Push(DocEntry *newEntry)
 {
    if(!newEntry)
-      return(false);
+      return false;
 
    uint16_t gr = newEntry->GetDictEntry()->GetGroup();
    uint16_t elt = newEntry->GetDictEntry()->GetElement();
@@ -94,9 +94,9 @@ bool DocEntryArchive::Push(DocEntry *newEntry)
       // Set the new DocEntry
       HeaderHT[key] = newEntry;
 
-      return(true);
+      return true;
    }
-   return(false);
+   return false;
 }
 
 /**
@@ -121,9 +121,9 @@ bool DocEntryArchive::Push(uint16_t group,uint16_t element)
          HeaderHT.erase(it);
       }
 
-      return(true);
+      return true;
    }
-   return(false);
+   return false;
 }
 
 /**
@@ -158,9 +158,9 @@ bool DocEntryArchive::Restore(uint16_t group,uint16_t element)
 
       Archive.erase(restoreIt);
 
-      return(true);
+      return true;
    }
-   return(false);
+   return false;
 }
 
 /**
index d89207dd94097aea20b18bc77ec6e7a595b783cf..8937fa3ea97638ab36e1d647d066bc983c8867fd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/10 17:17:52 $
-  Version:   $Revision: 1.171 $
+  Date:      $Date: 2005/01/11 00:21:48 $
+  Version:   $Revision: 1.172 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -970,7 +970,7 @@ void Document::LoadEntryBinArea(BinEntry *element)
 
    /// \todo check the result 
    Fp->read((char*)a, l);
-   if( Fp->fail() || Fp->eof()) //Fp->gcount() == 1
+   if( Fp->fail() || Fp->eof())
    {
       delete[] a;
       return;
@@ -1112,8 +1112,7 @@ uint32_t Document::SwapLong(uint32_t a)
          a=( ((a<< 8) & 0xff00ff00) | ((a>>8) & 0x00ff00ff)  );
          break;
       default :
-         //std::cout << "swapCode= " << SwapCode << std::endl;
-         gdcmErrorMacro( "Unset swap code");
+         gdcmErrorMacro( "Unset swap code:" << SwapCode );
          a = 0;
    }
    return a;
@@ -1465,8 +1464,8 @@ void Document::LoadDocEntry(DocEntry *entry)
       else
       {
          // fusible
-         std::cout<< "MaxSizeLoadEntry exceeded, neither a BinEntry "
-                  << "nor a ValEntry ?! Should never print that !" << std::endl;
+         gdcmErrorMacro( "MaxSizeLoadEntry exceeded, neither a BinEntry "
+                      << "nor a ValEntry ?! Should never print that !" );
       }
 
       // to be sure we are at the end of the value ...
@@ -1542,8 +1541,8 @@ void Document::LoadDocEntry(DocEntry *entry)
    if( length % 2 )
    {
       newValue = Util::DicomString(str, length+1);
-      gdcmVerboseMacro("Warning: bad length: " << length );
-      gdcmVerboseMacro("For string :" <<  newValue.c_str()); 
+      gdcmVerboseMacro("Warning: bad length: " << length <<
+                       ",For string :" <<  newValue.c_str()); 
       // Since we change the length of string update it length
       //entry->SetReadLength(length+1);
    }
@@ -1555,9 +1554,9 @@ void Document::LoadDocEntry(DocEntry *entry)
 
    if ( ValEntry *valEntry = dynamic_cast<ValEntry* >(entry) )
    {
-      if ( Fp->fail() || Fp->eof())//Fp->gcount() == 1
+      if ( Fp->fail() || Fp->eof())
       {
-         gdcmVerboseMacro( "Unread element value");
+         gdcmVerboseMacro("Unread element value");
          valEntry->SetValue(GDCM_UNREAD);
          return;
       }
@@ -1678,8 +1677,7 @@ void Document::FindDocEntryLength( DocEntry *entry )
          // and the dictionary entry depending on them.
          uint16_t correctGroup = SwapShort( entry->GetGroup() );
          uint16_t correctElem  = SwapShort( entry->GetElement() );
-         DictEntry *newTag = GetDictEntry( correctGroup,
-                                                       correctElem );
+         DictEntry *newTag = GetDictEntry( correctGroup, correctElem );
          if ( !newTag )
          {
             // This correct tag is not in the dictionary. Create a new one.
@@ -1720,7 +1718,7 @@ void Document::FindDocEntryLength( DocEntry *entry )
 std::string Document::FindDocEntryVR()
 {
    if ( Filetype != ExplicitVR )
-      return(GDCM_UNKNOWN);
+      return GDCM_UNKNOWN;
 
    long positionOnEntry = Fp->tellg();
    // Warning: we believe this is explicit VR (Value Representation) because
@@ -1738,9 +1736,9 @@ std::string Document::FindDocEntryVR()
    if( !CheckDocEntryVR(vr) )
    {
       Fp->seekg(positionOnEntry, std::ios::beg);
-      return(GDCM_UNKNOWN);
+      return GDCM_UNKNOWN;
    }
-   return(vr);
+   return vr;
 }
 
 /**
index 4338de23255077c62743c683bae7ccc8643d784b..dade9a061cfea8cd34aaa9d72212676560a977b3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:03:30 $
-  Version:   $Revision: 1.39 $
+  Date:      $Date: 2005/01/11 00:21:48 $
+  Version:   $Revision: 1.40 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -181,11 +181,11 @@ DocEntry *ElementSet::GetNextEntry()
       DocEntry *tmp = ItTagHT->second;
       ++ItTagHT;
 
-      return(tmp);
+      return tmp;
    }
    else
    {
-      return(NULL);
+      return NULL;
    }
 }
 
index 96fe85f43345dcd0c31df36247d1a796a238179c..d83dd3f50e4c3aed3f35fcaced7d045fae811ea9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 15:03:59 $
-  Version:   $Revision: 1.187 $
+  Date:      $Date: 2005/01/11 00:21:48 $
+  Version:   $Revision: 1.188 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -647,7 +647,8 @@ bool File::CheckWriteIntegrity()
 
 void File::SetWriteToRaw()
 {
-   if(HeaderInternal->GetNumberOfScalarComponents()==3 && !HeaderInternal->HasLUT())
+   if( HeaderInternal->GetNumberOfScalarComponents() == 3 
+    && !HeaderInternal->HasLUT())
    {
       SetWriteToRGB();
    } 
@@ -666,7 +667,8 @@ void File::SetWriteToRaw()
       PixelWriteConverter->SetReadData(PixelReadConverter->GetRaw(),
                                        PixelReadConverter->GetRawSize());
 
-      BinEntry *pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+      BinEntry *pixel = 
+         CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
       pixel->SetValue(GDCM_BINLOADED);
       pixel->SetBinArea(PixelWriteConverter->GetData(),false);
       pixel->SetLength(PixelWriteConverter->GetDataSize());
@@ -702,7 +704,8 @@ void File::SetWriteToRGB()
                                           PixelReadConverter->GetRawSize());
       }
 
-      BinEntry *pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+      BinEntry *pixel = 
+         CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
       pixel->SetValue(GDCM_BINLOADED);
       pixel->SetBinArea(PixelWriteConverter->GetData(),false);
       pixel->SetLength(PixelWriteConverter->GetDataSize());
@@ -864,7 +867,7 @@ ValEntry *File::CopyValEntry(uint16_t group,uint16_t element)
       newE = GetHeader()->NewValEntry(group,element);
    }
 
-   return(newE);
+   return newE;
 }
 
 BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element)
@@ -882,7 +885,7 @@ BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element)
       newE = GetHeader()->NewBinEntry(group,element);
    }
 
-   return(newE);
+   return newE;
 }
 
 //-----------------------------------------------------------------------------
index c6cd59c1150c0ed2c9de5a0a25dbc7152cc49bf1..d4055914663513f5960d2dbeceea8ac0f551c0ed 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 15:04:00 $
-  Version:   $Revision: 1.49 $
+  Date:      $Date: 2005/01/11 00:21:48 $
+  Version:   $Revision: 1.50 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -286,11 +286,11 @@ DocEntry *SQItem::GetNextEntry()
       DocEntry *tmp = *ItDocEntries;
       ++ItDocEntries;
                                                                                 
-      return(tmp);
+      return tmp;
    }
    else
    {
-      return(NULL);
+      return NULL;
    }
 }
 
index d4f65013b564f8307ea698cf12ae3d403268cd6d..fd97d2a7c48513583cd45c48b5295dba00a764ab 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:19:48 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/01/11 00:21:48 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -305,7 +305,7 @@ bool SerieHeader::ImageNumberOrdering()
   
    delete[] partition;
 
-   return (mult != 0);
+   return mult != 0;
 }
 
 
index 703178c5f74efe3e1c046d23c27e0b416be3c50e..5271e16b6ace393ec5d520a03b3d681f08fc6c08 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:03:30 $
-  Version:   $Revision: 1.30 $
+  Date:      $Date: 2005/01/11 00:21:49 $
+  Version:   $Revision: 1.31 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -167,7 +167,7 @@ bool VR::IsVROfSequence(VRKey const &tested)
 
 bool VR::IsValidVR(VRKey const &key)
 {
-   return(vr.find(key)!=vr.end());
+   return vr.find(key) != vr.end();
 }
 
 //-----------------------------------------------------------------------------