]> Creatis software - gdcm.git/commitdiff
* src/gdcmCommon.h, gdcmDict.cxx, gdcmTS.cxx : bug fix for msvc6 compilation
authorregrain <regrain>
Mon, 19 Jul 2004 11:51:25 +0000 (11:51 +0000)
committerregrain <regrain>
Mon, 19 Jul 2004 11:51:25 +0000 (11:51 +0000)
   * src/gdcmDebug.[h|cxx] : bug fix for msvc6 compilation. Replace the dbg
     variable (instance of gdcmDebug) by a definition macro, and the instance
     is now in static in the gdcmDebug class
   * src/gdcmSQItem.h : (FIXME) remove an undefined method
   * Test/PrintAllDocument.cxx : bug fix in the result of the test
   -- BeNours

ChangeLog
src/gdcmCommon.h
src/gdcmDebug.cxx
src/gdcmDebug.h
src/gdcmDict.cxx
src/gdcmSQItem.h
src/gdcmTS.cxx

index 7fb87396bdc0c39d7d755ea41b75edd10cace4aa..e11f623cae64cb04b004f1be187eb95e50f477ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-19 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * src/gdcmCommon.h, gdcmDict.cxx, gdcmTS.cxx : bug fix for msvc6 compilation
+   * src/gdcmDebug.[h|cxx] : bug fix for msvc6 compilation. Replace the dbg
+     variable (instance of gdcmDebug) by a definition macro, and the instance
+     is now in static in the gdcmDebug class
+   * src/gdcmSQItem.h : (FIXME) remove an undefined method
+   * Test/PrintAllDocument.cxx : bug fix in the result of the test
+
 2004-07-06 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
    * WARNING: ctest now depends more tightly on gdcmData. You should
      check out gdcmData properly for things to run smoothly...
@@ -472,7 +480,7 @@ WARNING : save your own sources *before* cvs up !
     * .... alas, the python testSuite is still broken.
 
 2004-05-18 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
-    * gdcmPython/gdcm.i : remove useless lines concerning the gdcmGlobal 
+    * gdcmPython/gdcm.i : remove useless lines concerning the gdcmGlobal
       gdcmGlob
     * gdcmPython/setup.py : replace the use of cvar.gdcmGlob to gdcmGlobal
     * src/gdcmUtil.h : export methods
index 384aa738d9fc0ee116155f3679912758558dda10..89e76f67d5c7f9b869784e966bc9326bf1accbda 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommon.h,v $
   Language:  C++
-  Date:      $Date: 2004/07/02 13:55:27 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.29 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -47,8 +47,9 @@
 //-----------------------------------------------------------------------------
 #ifdef __GNUC__
 #ifndef HAVE_NO_STDINT_H
-#include <stdint.h>   // For uint16_t and uint32_t
+#include <stdint.h>   // For uint8_t uint16_t and uint32_t
 #else
+typedef  unsigned char  uint8_t;
 typedef  unsigned short uint16_t;
 typedef  unsigned int   uint32_t;
 #define UINT32_MAX    (4294967295U)
@@ -56,6 +57,7 @@ typedef  unsigned int   uint32_t;
 #endif
 
 #ifdef _MSC_VER 
+typedef  unsigned char  uint8_t;
 typedef  unsigned short uint16_t;
 typedef  unsigned int   uint32_t;
 #define UINT32_MAX    (4294967295U)
index 6868b8a4598104d6022ce2219635fc0b6b272e7a..e98811056dff0e3cb44d17f1d82be1df2c6ca7eb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDebug.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:47 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #include <iostream>
 #include "gdcmDebug.h"
 
-/**
- * \ingroup Globals
- * \brief   Instance of debugging utility.
- */
-gdcmDebug dbg;
+//-----------------------------------------------------------------------------
+gdcmDebug gdcmDebug::debug;
 
+//-----------------------------------------------------------------------------
 /**
  * \brief   constructor
  * @param level debug level
  */ 
-gdcmDebug::gdcmDebug(int level) {
+gdcmDebug::gdcmDebug(int level) 
+{
    DebugLevel = level;
 }
 
@@ -37,7 +36,8 @@ gdcmDebug::gdcmDebug(int level) {
  * \brief   Accessor
  * @param   level Set the debug level
  */ 
-void gdcmDebug::SetDebug(int level) {
+void gdcmDebug::SetDebug(int level) 
+{
    DebugLevel = level;
 }
 
@@ -47,7 +47,8 @@ void gdcmDebug::SetDebug(int level) {
  * @param Msg1 first message part
  * @param Msg2 second message part 
  */
-void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
+void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) 
+{
    if (Level > DebugLevel)
       return ;
    std::cerr << Msg1 << ' ' << Msg2 << std::endl;
@@ -59,7 +60,8 @@ void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
  * @param Msg1 first message part
  * @param Msg2 second message part 
  */
-void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
+void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) 
+{
    if (!Test)
       return;
    std::cerr << Msg1 << ' ' << Msg2 << std::endl;
@@ -73,7 +75,8 @@ void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
  * @param Msg3 Third message part  
  */
 void gdcmDebug::Error(const char* Msg1, const char* Msg2,
-                      const char* Msg3) {
+                      const char* Msg3) 
+{
    std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << std::endl;
    Exit(1);
 }
@@ -85,8 +88,9 @@ void gdcmDebug::Error(const char* Msg1, const char* Msg2,
  * @param Msg1 first message part
  * @param Msg2 second message part
  */
- void gdcmDebug::Assert(int Level, bool Test,
-                 const char * Msg1, const char * Msg2) {
+void gdcmDebug::Assert(int Level, bool Test,
+                 const char * Msg1, const char * Msg2) 
+{
    if (Level > DebugLevel)
       return ;
    if (!Test)
@@ -97,7 +101,8 @@ void gdcmDebug::Error(const char* Msg1, const char* Msg2,
  * \brief   Exit 
  * @param a return code 
  */
-void gdcmDebug::Exit(int a) {
+void gdcmDebug::Exit(int a) 
+{
 #ifdef __GNUC__
    std::exit(a);
 #endif
@@ -105,3 +110,13 @@ void gdcmDebug::Exit(int a) {
    exit(a);    // Found in #include <stdlib.h>
 #endif
 }
+
+/**
+ * \brief  Get the debug instance 
+ * \return Reference to the debug instance
+ */
+gdcmDebug &gdcmDebug::GetReference()
+{
+   return gdcmDebug::debug;
+}
+
index e1e8fde901a778abbcceaa60b87ef3a5d7bd3b03..a689936f29dbd1432b491ac4cf8a03efd22d7921 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDebug.h,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:47 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #ifndef GDCMDEBUG_H
 #define GDCMDEBUG_H
 
+#include "gdcmCommon.h"
+
+//-----------------------------------------------------------------------------
+#define dbg gdcmDebug::GetReference()
+
+//-----------------------------------------------------------------------------
+
 /**
  * \ingroup gdcmDebug
  * \brief gdcmDebug is an object for debugging in program.
@@ -30,7 +37,7 @@
  * Shown only when the debug level is higher than the 
  * message level.
  */
-class gdcmDebug {
+class GDCM_EXPORT gdcmDebug {
 public:
    gdcmDebug(int level = -1);
 
@@ -42,11 +49,14 @@ public:
    void Assert(int, bool, const char*, const char*);
    void Exit(int);
 
+   static gdcmDebug &GetReference();
+
 private:
 /// warning message level to be displayed
    int DebugLevel;
-};
 
-extern gdcmDebug dbg;
+/// Instance of debugging utility.
+   static gdcmDebug debug;
+};
 
 #endif
index 6b2efbec7d564fe2e431fc2ac32fff806453e1b8..cb0191bec2cc16da1952b9b5302f023277b60734 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/02 13:55:27 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -49,7 +49,7 @@ gdcmDict::gdcmDict(std::string & FileName) {
       from >> vr;
       from >> fourth;
       eatwhite(from);
-      getline(from, name);    /// MEMORY LEAK in std::getline<>
+      std::getline(from, name);    /// MEMORY LEAK in std::getline<>
 
       gdcmDictEntry * newEntry = new gdcmDictEntry(group, element,
                                                    vr, fourth, name);
index ee4cd01f602506231c35c3c45b4860a40b3261ff..fe7f7938a4053e1f11ebcf3fb364a032fef9c9b6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.h,v $
   Language:  C++
-  Date:      $Date: 2004/07/02 13:55:28 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -48,7 +48,8 @@ public:
    virtual bool AddEntry(gdcmDocEntry *Entry); // add to the List
   
    gdcmDocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element);
-   gdcmDocEntry *GetDocEntryByName  (std::string Name);
+   // FIXME method to write
+   //gdcmDocEntry *GetDocEntryByName  (std::string Name);
    
    bool SetEntryByNumber(std::string val, uint16_t group, uint16_t element);                   
     
index 630ed7c6916b3dc0c194754aff58c160309e85d5..a1c83a8bb2c3a61cb3cef5ca7ace5eb773d52e2c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/23 03:36:24 $
-  Version:   $Revision: 1.21 $
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.22 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -43,7 +43,7 @@ gdcmTS::gdcmTS(void)
       from >> key;
 
       eatwhite(from);
-      getline(from, name);    /// MEMORY LEAK
+      std::getline(from, name);    /// MEMORY LEAK
 
       if(key!="") 
       {