From: regrain Date: Thu, 20 Jan 2005 11:07:06 +0000 (+0000) Subject: * src/gdcmDebug.h : remove the Debug test in the gdcmErrorMacro X-Git-Tag: Version1.0.bp~241 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4210e3a97df19bf964da287698f8c7997755015a;p=gdcm.git * src/gdcmDebug.h : remove the Debug test in the gdcmErrorMacro * src/gdcmDocument.[h|cxx] : rename the Initialise method to Initialize, to be complient with all the gdcm source code -- BeNours --- diff --git a/ChangeLog b/ChangeLog index 738e5e68..a0ac327e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ +2005-01-20 Benoit Regrain + * src/gdcmDebug.h : remove the Debug test in the gdcmErrorMacro + * src/gdcmDocument.[h|cxx] : rename the Initialise method to Initialize, to + be complient with all the gdcm source code + 2005-01-19 Benoit Regrain - * src/gdcmDocEntry.h : DocEntry is now secure. User can't change the + * src/gdcmDocEntry.h : DocEntry is now secure. User can't change the DictEntry or the VR. 2005-01-19 Benoit Regrain diff --git a/src/gdcmDebug.h b/src/gdcmDebug.h index c135290d..422f0789 100644 --- a/src/gdcmDebug.h +++ b/src/gdcmDebug.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.h,v $ Language: C++ - Date: $Date: 2005/01/13 22:39:15 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/01/20 11:07:07 $ + Version: $Revision: 1.24 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -121,7 +121,9 @@ public: * @param msg message part */ #ifdef NDEBUG -#define gdcmVerboseMacro(msg) +#define gdcmVerboseMacro(msg) \ +{ \ +} #else #define gdcmVerboseMacro(msg) \ { \ @@ -148,8 +150,6 @@ public: #else #define gdcmErrorMacro(msg) \ { \ - if( Debug::GetDebugFlag() ) \ - { \ std::ostringstream osmacro; \ osmacro << "Error: In " __FILE__ ", line " << __LINE__ \ << ", function " << GDCM_FUNCTION << '\n' \ @@ -158,8 +158,6 @@ public: Debug::GetDebugFile() << osmacro.str() << std::endl; \ else \ std::cerr << osmacro.str() << std::endl; \ - exit(1); \ - } \ } #endif //NDEBUG diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 6715afc1..6e3d862b 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/19 15:58:00 $ - Version: $Revision: 1.200 $ + Date: $Date: 2005/01/20 11:07:07 $ + Version: $Revision: 1.201 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -63,9 +63,12 @@ const unsigned int Document::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff; */ Document::Document( std::string const &filename ) : ElementSet(-1) { + RLEInfo = NULL; + JPEGInfo = NULL; + SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); Filename = filename; - Initialise(); + Initialize(); Fp = 0; if ( !OpenFile() ) @@ -159,10 +162,13 @@ Document::Document( std::string const &filename ) : ElementSet(-1) */ Document::Document() : ElementSet(-1) { + RLEInfo = NULL; + JPEGInfo = NULL; + Fp = 0; SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); - Initialise(); + Initialize(); SwapCode = 1234; Filetype = ExplicitVR; Group0002Parsed = false; @@ -176,8 +182,10 @@ Document::~Document () RefPubDict = NULL; RefShaDict = NULL; - delete RLEInfo; - delete JPEGInfo; + if( RLEInfo ) + delete RLEInfo; + if( JPEGInfo ) + delete JPEGInfo; } //----------------------------------------------------------------------------- @@ -2119,7 +2127,7 @@ void Document::SkipBytes(uint32_t nBytes) * \brief Loads all the needed Dictionaries * \warning NOT end user intended method ! */ -void Document::Initialise() +void Document::Initialize() { RefPubDict = Global::GetDicts()->GetDefaultPubDict(); RefShaDict = NULL; diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index dc6ff34c..d5ae4e04 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2005/01/19 08:57:14 $ - Version: $Revision: 1.92 $ + Date: $Date: 2005/01/20 11:07:07 $ + Version: $Revision: 1.93 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -219,7 +219,7 @@ private: bool ReadTag(uint16_t, uint16_t); uint32_t ReadTagLength(uint16_t, uint16_t); - void Initialise(); + void Initialize(); bool CheckSwap(); void SwitchByteSwapCode(); void SetMaxSizeLoadEntry(long);