]> Creatis software - gdcm.git/commitdiff
ENH: Ok second chunk of patch, tests seems to go smoothly
authormalaterre <malaterre>
Mon, 21 Jun 2004 04:43:01 +0000 (04:43 +0000)
committermalaterre <malaterre>
Mon, 21 Jun 2004 04:43:01 +0000 (04:43 +0000)
1. Compile with CMAKE_CXX_FLAGS (need to turn advanced ON) = -W -Wall -Werror
2. Add two virtual to destructor, with a bit of luck these were the leaks reported by frog

Testing/TestWriteSimple.cxx
src/gdcmDict.cxx
src/gdcmDocEntrySet.h
src/gdcmSeqEntry.cxx
src/gdcmSeqEntry.h
src/gdcmTS.cxx
src/gdcmValEntry.cxx
src/gdcmValEntry.h

index 8451cbd51f73a9e845e17d9a549b3a0f3b0f8b3e..74531f9b75147ce047f6c2228ec14ba0a18aaedb 100644 (file)
@@ -36,7 +36,8 @@ int TestWriteSimple(int argc, char* argv[])
   delete[] imageData;
   delete f1;
   delete f2;
-  delete PixelData;
+  //delete PixelData; //Does GetImageData return the same pointer ?
+  (void)PixelData;
 
   return 0;
 }
index 4a210c3bf572ba126dde3bd43beb1239bd044dba..d9b9bb6916a3881b947a5b20029a84261db7fdf0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:47 $
-  Version:   $Revision: 1.35 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.36 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -32,7 +32,7 @@
  */
 gdcmDict::gdcmDict(std::string & FileName) {
    guint16 group, element;
-   char buff[1024];
+   //char buff[1024];
    TagName vr;
    TagName fourth;
    TagName name;
index 95e6b9ab849a26f598cf234eda356def002a2988..ac827fe90a488b821b0badaea25adc537d2a080f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.h,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:47 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -30,7 +30,7 @@ class GDCM_EXPORT gdcmDocEntrySet
 public:
 
    gdcmDocEntrySet(int depth = 0); 
-   ~gdcmDocEntrySet(void);
+   virtual ~gdcmDocEntrySet();
 
    /// \brief adds any type of entry to the entry set (pure vitual)
    virtual bool AddEntry(gdcmDocEntry *Entry) = 0; // pure virtual
@@ -40,11 +40,11 @@ public:
 
    /// \brief Gets the depth level of a Dicom Header Entry embedded in a
    ///        SeQuence
-   inline int GetDepthLevel(void) {return(SQDepthLevel);}
+   inline int GetDepthLevel(void) { return SQDepthLevel; }
 
    /// \brief Sets the depth level of a Dicom Header Entry embedded in a
    /// SeQuence
-   inline void SetDepthLevel(int depth) {SQDepthLevel = depth;}
+   inline void SetDepthLevel(int depth) { SQDepthLevel = depth; }
          
 protected:
    /// \brief   Build a new Element Value from all the low level arguments. 
index 11f048daf885dd33cadeb71a15957360d7fcccca..abc8b9cf90f5b64c25f4eb2b3296854a1da9478a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:48 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -61,11 +61,11 @@ void gdcmSeqEntry::Print(std::ostream &os){
 
    std::ostringstream s,s2;
    std::string vr;
-   unsigned short int g, e;
-   long lgth;
-   size_t o;    
-   char greltag[10];  //group element tag
-   char st[20]; 
+   //unsigned short int g, e; //not used
+   //long lgth; //not used
+   //size_t o;    //not used
+   //char greltag[10];  //group element tag //not used
+   //char st[20];   //not used
 
    // First, Print the Dicom Element itself.
    SetPrintLevel(2);   
index 8ba49bf06963f15b3cf39151968c9841a3b31b62..325aff665e47a55892e24fba925546ed7975f518 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:48 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -32,12 +32,12 @@ class GDCM_EXPORT gdcmSeqEntry : public gdcmDocEntry
 {
 public:
    gdcmSeqEntry(gdcmDictEntry* e, int depth);
-   ~gdcmSeqEntry(void);
+   virtual ~gdcmSeqEntry();
    
    virtual void Print(std::ostream &os = std::cout); 
 
    /// \brief   returns the SQITEM chained List for this SeQuence.
-   inline ListSQItem &GetSQItems() {return items;};
+   inline ListSQItem &GetSQItems() { return items; }
       
    /// \brief Sets the delimitor mode
    inline void SetDelimitorMode(bool dm) { delimitor_mode = dm;}
index cc214c63690c40b7094e1c754f1d5b7efa61bed5..864367c0b44226b68c9d1e80aecf0d22dc61f1ed 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:48 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.19 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -35,7 +35,7 @@ gdcmTS::gdcmTS(void)
    std::ifstream from(filename.c_str());
    dbg.Error(!from, "gdcmTS::gdcmTS: can't open dictionary",filename.c_str());
 
-   char buff[1024];
+   //char buff[1024];  //not used
    std::string key;
    std::string name;
 
index 045ce967714968f632a32758ede41333fd5ba498..7f9613dccc45a16711a54f466f6ba96e56a80c54 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:48 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -70,7 +70,7 @@ gdcmValEntry::~gdcmValEntry (void) {
 void gdcmValEntry::Print(std::ostream & os) { 
 
    std::ostringstream s; 
-   size_t o;
+   //size_t o;  //not used
    unsigned short int g, e;
    char st[20];
    TSKey v;
index 164b910f77c16421bb23aaa544bf0757c8564411..86f4f43679c6bc4d5234381dae3813bd60f8ec12 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:48 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2004/06/21 04:43:02 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -36,7 +36,7 @@ public:
 
    gdcmValEntry(gdcmDictEntry* e);
    gdcmValEntry(gdcmDocEntry* d); 
-   ~gdcmValEntry(void);
+   virtual ~gdcmValEntry();
 
    /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
    /// 'string', if it's stored as an integer in the header of the