From 6b91390e1086959c40c0ae9a37912877a6f14c36 Mon Sep 17 00:00:00 2001 From: malaterre Date: Mon, 21 Jun 2004 04:43:01 +0000 Subject: [PATCH] ENH: Ok second chunk of patch, tests seems to go smoothly 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 | 3 ++- src/gdcmDict.cxx | 6 +++--- src/gdcmDocEntrySet.h | 10 +++++----- src/gdcmSeqEntry.cxx | 14 +++++++------- src/gdcmSeqEntry.h | 8 ++++---- src/gdcmTS.cxx | 6 +++--- src/gdcmValEntry.cxx | 6 +++--- src/gdcmValEntry.h | 6 +++--- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index 8451cbd5..74531f9b 100644 --- a/Testing/TestWriteSimple.cxx +++ b/Testing/TestWriteSimple.cxx @@ -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; } diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 4a210c3b..d9b9bb69 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -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; diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index 95e6b9ab..ac827fe9 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -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. diff --git a/src/gdcmSeqEntry.cxx b/src/gdcmSeqEntry.cxx index 11f048da..abc8b9cf 100644 --- a/src/gdcmSeqEntry.cxx +++ b/src/gdcmSeqEntry.cxx @@ -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); diff --git a/src/gdcmSeqEntry.h b/src/gdcmSeqEntry.h index 8ba49bf0..325aff66 100644 --- a/src/gdcmSeqEntry.h +++ b/src/gdcmSeqEntry.h @@ -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;} diff --git a/src/gdcmTS.cxx b/src/gdcmTS.cxx index cc214c63..864367c0 100644 --- a/src/gdcmTS.cxx +++ b/src/gdcmTS.cxx @@ -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; diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index 045ce967..7f9613dc 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -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; diff --git a/src/gdcmValEntry.h b/src/gdcmValEntry.h index 164b910f..86f4f436 100644 --- a/src/gdcmValEntry.h +++ b/src/gdcmValEntry.h @@ -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 -- 2.48.1