[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:36:40 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=8551c93

The following commit has been merged in the master branch:
commit 8551c935f869e4bb164679ba51c2584d77fd853f
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Oct 14 16:42:57 2004 +0000

    Changed MakerNote class hierarchy to use std::auto_ptr where appropriate
---
 src/canonmn.cpp   | 23 +++++++------
 src/canonmn.hpp   | 37 +++++++++++++--------
 src/exif.cpp      | 92 ++++++++++++++++++++++++++--------------------------
 src/exif.hpp      | 11 ++++---
 src/fujimn.cpp    | 31 ++++++++++--------
 src/fujimn.hpp    | 35 ++++++++++++--------
 src/makernote.cpp | 64 +++++++++++++++++++++----------------
 src/makernote.hpp | 96 ++++++++++++++++++++++++++++++-------------------------
 src/nikonmn.cpp   | 57 +++++++++++++++++++++------------
 src/nikonmn.hpp   | 55 +++++++++++++++++++++----------
 src/sigmamn.cpp   | 35 +++++++++++---------
 src/sigmamn.hpp   | 35 ++++++++++++--------
 src/taglist.cpp   | 13 +++-----
 src/tags.cpp      | 60 +++++++++++++++++-----------------
 src/tags.hpp      |  6 ++--
 15 files changed, 373 insertions(+), 277 deletions(-)

diff --git a/src/canonmn.cpp b/src/canonmn.cpp
index 2a76ba8..4920dee 100644
--- a/src/canonmn.cpp
+++ b/src/canonmn.cpp
@@ -20,7 +20,7 @@
  */
 /*
   File:      canonmn.cpp
-  Version:   $Name:  $ $Revision: 1.14 $
+  Version:   $Name:  $ $Revision: 1.15 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   18-Feb-04, ahu: created
              07-Mar-04, ahu: isolated as a separate component
@@ -30,7 +30,7 @@
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.14 $ $RCSfile: canonmn.cpp,v $");
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.15 $ $RCSfile: canonmn.cpp,v $");
 
 // *****************************************************************************
 // included header files
@@ -72,7 +72,12 @@ namespace Exiv2 {
     {
     }
 
-    CanonMakerNote* CanonMakerNote::clone(bool alloc) const 
+    CanonMakerNote::AutoPtr CanonMakerNote::clone(bool alloc) const
+    {
+        return AutoPtr(clone_(alloc));
+    }
+
+    CanonMakerNote* CanonMakerNote::clone_(bool alloc) const 
     {
         return new CanonMakerNote(alloc); 
     }
@@ -656,13 +661,13 @@ namespace Exiv2 {
 // *****************************************************************************
 // free functions
 
-    MakerNote* createCanonMakerNote(bool alloc,
-                                    const byte* buf, 
-                                    long len, 
-                                    ByteOrder byteOrder, 
-                                    long offset)
+    MakerNote::AutoPtr createCanonMakerNote(bool alloc,
+                                            const byte* buf, 
+                                            long len, 
+                                            ByteOrder byteOrder, 
+                                            long offset)
     {
-        return new CanonMakerNote(alloc);         
+        return MakerNote::AutoPtr(new CanonMakerNote(alloc));
     }
 
 }                                       // namespace Exiv2
diff --git a/src/canonmn.hpp b/src/canonmn.hpp
index 1f34197..c71011f 100644
--- a/src/canonmn.hpp
+++ b/src/canonmn.hpp
@@ -23,7 +23,7 @@
   @brief   Canon MakerNote implemented according to the specification
            <a href="http://www.burren.cx/david/canon.html">
            EXIF MakerNote of Canon</a> by David Burren
-  @version $Name:  $ $Revision: 1.12 $
+  @version $Name:  $ $Revision: 1.13 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    18-Feb-04, ahu: created<BR>
@@ -40,6 +40,7 @@
 // + standard includes
 #include <string>
 #include <iosfwd>
+#include <memory>
 
 // *****************************************************************************
 // namespace extensions
@@ -53,9 +54,10 @@ namespace Exiv2 {
 // free functions
 
     /*!
-      @brief Return a pointer to a newly created empty MakerNote initialized to
-             operate in the memory management model indicated.  The caller owns
-             this copy and is responsible to delete it!
+      @brief Return an auto-pointer to a newly created empty MakerNote
+             initialized to operate in the memory management model indicated.
+             The caller owns this copy and the auto-pointer ensures that it
+             will be deleted.
       
       @param alloc Memory management model for the new MakerNote. Determines if
              memory required to store data should be allocated and deallocated
@@ -69,14 +71,15 @@ namespace Exiv2 {
       @param offset Offset from the start of the TIFF header of the makernote
              buffer (not used).
       
-      @return A pointer to a newly created empty MakerNote. The caller owns
-             this copy and is responsible to delete it!
+      @return An auto-pointer to a newly created empty MakerNote. The caller
+             owns this copy and the auto-pointer ensures that it will be
+             deleted.
      */
-    MakerNote* createCanonMakerNote(bool alloc,
-                                    const byte* buf, 
-                                    long len, 
-                                    ByteOrder byteOrder, 
-                                    long offset);
+    MakerNote::AutoPtr createCanonMakerNote(bool alloc,
+                                            const byte* buf, 
+                                            long len, 
+                                            ByteOrder byteOrder, 
+                                            long offset);
 
 // *****************************************************************************
 // class definitions
@@ -84,6 +87,9 @@ namespace Exiv2 {
     //! MakerNote for Canon cameras
     class CanonMakerNote : public IfdMakerNote {
     public:
+        //! Shortcut for a %CanonMakerNote auto pointer.
+        typedef std::auto_ptr<CanonMakerNote> AutoPtr;
+
         //! @name Creators
         //@{
         /*!
@@ -96,8 +102,8 @@ namespace Exiv2 {
         //@}
 
         //! @name Accessors
-        //@{        
-        CanonMakerNote* clone(bool alloc =true) const;
+        //@{
+        CanonMakerNote::AutoPtr clone(bool alloc =true) const;
         //! Return the name of the makernote item ("Canon")
         std::string ifdItem() const { return ifdItem_; }
         std::ostream& printTag(std::ostream& os,
@@ -170,6 +176,9 @@ namespace Exiv2 {
         //@}
 
     private:
+        //! Internal virtual copy constructor.
+        CanonMakerNote* clone_(bool alloc =true) const;
+
         //! Structure used to auto-register the MakerNote.
         struct RegisterMakerNote {
             //! Default constructor
@@ -177,7 +186,7 @@ namespace Exiv2 {
             {
                 MakerNoteFactory& mnf = MakerNoteFactory::instance();
                 mnf.registerMakerNote("Canon", "*", createCanonMakerNote); 
-                mnf.registerMakerNote(new CanonMakerNote);
+                mnf.registerMakerNote(MakerNote::AutoPtr(new CanonMakerNote));
             }
         };
         /*!
diff --git a/src/exif.cpp b/src/exif.cpp
index 5ce5bcd..0dffffc 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -20,14 +20,14 @@
  */
 /*
   File:      exif.cpp
-  Version:   $Name:  $ $Revision: 1.64 $
+  Version:   $Name:  $ $Revision: 1.65 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   26-Jan-04, ahu: created
              11-Feb-04, ahu: isolated as a component
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.64 $ $RCSfile: exif.cpp,v $");
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.65 $ $RCSfile: exif.cpp,v $");
 
 // Define DEBUG_MAKERNOTE to output debug information to std::cerr
 #undef DEBUG_MAKERNOTE
@@ -494,7 +494,7 @@ namespace Exiv2 {
     }
 
     ExifData::ExifData() 
-        : pThumbnail_(0), pMakerNote_(0), ifd0_(ifd0Id, 0, false), 
+        : pThumbnail_(0), ifd0_(ifd0Id, 0, false), 
           exifIfd_(exifIfdId, 0, false), iopIfd_(iopIfdId, 0, false), 
           gpsIfd_(gpsIfdId, 0, false), ifd1_(ifd1Id, 0, false), 
           size_(0), pData_(0), compatible_(true)
@@ -503,7 +503,6 @@ namespace Exiv2 {
 
     ExifData::~ExifData()
     {
-        delete pMakerNote_;
         delete pThumbnail_;
         delete[] pData_;
     }
@@ -559,33 +558,32 @@ namespace Exiv2 {
             MakerNoteFactory& mnf = MakerNoteFactory::instance();
             // Todo: The conversion to string assumes that there is a 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list