From: malaterre Date: Tue, 11 Jan 2005 00:21:48 +0000 (+0000) Subject: STYLE: minor clean up X-Git-Tag: Version1.0.bp~401 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=827d0d72b115d9e54aac8f0b054856dffff862ca;p=gdcm.git STYLE: minor clean up --- diff --git a/src/gdcmDocEntryArchive.cxx b/src/gdcmDocEntryArchive.cxx index 38ba52d7..c47596ef 100644 --- a/src/gdcmDocEntryArchive.cxx +++ b/src/gdcmDocEntryArchive.cxx @@ -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; } /** diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index d89207dd..8937fa3e 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -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(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; } /** diff --git a/src/gdcmElementSet.cxx b/src/gdcmElementSet.cxx index 4338de23..dade9a06 100644 --- a/src/gdcmElementSet.cxx +++ b/src/gdcmElementSet.cxx @@ -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; } } diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 96fe85f4..d83dd3f5 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -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; } //----------------------------------------------------------------------------- diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index c6cd59c1..d4055914 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -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; } } diff --git a/src/gdcmSerieHeader.cxx b/src/gdcmSerieHeader.cxx index d4f65013..fd97d2a7 100644 --- a/src/gdcmSerieHeader.cxx +++ b/src/gdcmSerieHeader.cxx @@ -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; } diff --git a/src/gdcmVR.cxx b/src/gdcmVR.cxx index 703178c5..5271e16b 100644 --- a/src/gdcmVR.cxx +++ b/src/gdcmVR.cxx @@ -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(); } //-----------------------------------------------------------------------------