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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:38:45 UTC 2017


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

The following commit has been merged in the master branch:
commit 91c4dafbf990dd2a56362357725461488dc1506e
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon Sep 24 06:33:17 2007 +0000

    Fixed compiler issues (gcc-4.3, msvc 7.1)
---
 msvc/exiv2lib/exiv2lib.vcproj | 18 ++++++++++++++++++
 src/basicio.cpp               | 41 +++++++++++++++++++++--------------------
 src/iotest.cpp                | 12 ++++++------
 src/jpgimage.cpp              |  4 ++--
 src/makernote.cpp             |  5 +++--
 src/tiffvisitor.cpp           |  4 ++--
 src/types.cpp                 |  7 ++++---
 src/utils.cpp                 |  3 ++-
 src/value.cpp                 | 16 +++++++++++++---
 src/value.hpp                 | 16 +++++++++-------
 src/xmp.cpp                   |  2 +-
 11 files changed, 81 insertions(+), 47 deletions(-)

diff --git a/msvc/exiv2lib/exiv2lib.vcproj b/msvc/exiv2lib/exiv2lib.vcproj
index c322156..8bde982 100644
--- a/msvc/exiv2lib/exiv2lib.vcproj
+++ b/msvc/exiv2lib/exiv2lib.vcproj
@@ -377,6 +377,9 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\src\orfimage.cpp">
+			</File>
+			<File
 				RelativePath="..\..\src	iffparser.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -437,6 +440,9 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\src\properties.cpp">
+			</File>
+			<File
 				RelativePath="..\..\src	ypes.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -466,6 +472,9 @@
 						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
 				</FileConfiguration>
 			</File>
+			<File
+				RelativePath="..\..\src\xmp.cpp">
+			</File>
 		</Filter>
 		<Filter
 			Name="Header Files"
@@ -538,6 +547,9 @@
 				RelativePath="..\..\src\panasonicmn.hpp">
 			</File>
 			<File
+				RelativePath="..\..\src\properties.hpp">
+			</File>
+			<File
 				RelativePath="..\..\src
afimage.hpp">
 			</File>
 			<File
@@ -556,6 +568,9 @@
 				RelativePath="..\..\src	iffimage.hpp">
 			</File>
 			<File
+				RelativePath="..\..\src\orfimage.hpp">
+			</File>
+			<File
 				RelativePath="..\..\src	iffparser.hpp">
 			</File>
 			<File
@@ -573,6 +588,9 @@
 			<File
 				RelativePath="..\..\src
alue.hpp">
 			</File>
+			<File
+				RelativePath="..\..\src\xmp.hpp">
+			</File>
 		</Filter>
 		<Filter
 			Name="Resource Files"
diff --git a/src/basicio.cpp b/src/basicio.cpp
index ea55b1b..9692fb3 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -44,6 +44,7 @@ EXIV2_RCSID("@(#) $Id$")
 // + standard includes
 #include <string>
 #include <memory>
+#include <cstring>
 #include <cassert>
 #include <cstdio>                       // for remove, rename
 #include <cstdlib>                      // for alloc, realloc, free
@@ -128,7 +129,7 @@ namespace Exiv2 {
 
         // If file is > 1MB then use a file, otherwise use memory buffer
         if (ret != 0 || buf.st_size > 1048576) {
-            pid_t pid = getpid();
+            pid_t pid = ::getpid();
             std::string tmpname = path_ + toString(pid);
             std::auto_ptr<FileIo> fileIo(new FileIo(tmpname));
             if (fileIo->open("w+b") != 0) {
@@ -172,22 +173,22 @@ namespace Exiv2 {
             if (oldOpMode == opSeek) return 0;
 
             // Flush. On msvcrt fflush does not do the job
-            fseek(fp_, 0, SEEK_CUR);
+            std::fseek(fp_, 0, SEEK_CUR);
             return 0;
         }
 
         // Reopen the file
-        long offset = ftell(fp_);
+        long offset = std::ftell(fp_);
         if (offset == -1) return -1;
         if (open("r+b") != 0) return 1;
-        return fseek(fp_, offset, SEEK_SET);
+        return std::fseek(fp_, offset, SEEK_SET);
     }
 
     long FileIo::write(const byte* data, long wcount)
     {
         assert(fp_ != 0);
         if (switchMode(opWrite) != 0) return 0;
-        return (long)fwrite(data, 1, wcount, fp_);
+        return (long)std::fwrite(data, 1, wcount, fp_);
     }
 
     long FileIo::write(BasicIo& src)
@@ -202,7 +203,7 @@ namespace Exiv2 {
         long writeCount = 0;
         long writeTotal = 0;
         while ((readCount = src.read(buf, sizeof(buf)))) {
-            writeTotal += writeCount = (long)fwrite(buf, 1, readCount, fp_);
+            writeTotal += writeCount = (long)std::fwrite(buf, 1, readCount, fp_);
             if (writeCount != readCount) {
                 // try to reset back to where write stopped
                 src.seek(writeCount-readCount, BasicIo::cur);
@@ -230,7 +231,7 @@ namespace Exiv2 {
             }
             close();
             struct stat buf;
-            if (stat(path_.c_str(), &buf) == -1) {
+            if (::stat(path_.c_str(), &buf) == -1) {
                 throw Error(2, path_, strError(), "stat");
             }
             // MSVCRT rename that does not overwrite existing files
@@ -242,7 +243,7 @@ namespace Exiv2 {
             }
             std::remove(fileIo->path_.c_str());
             // Set original file permissions
-            if (chmod(path_.c_str(), buf.st_mode) == -1) {
+            if (::chmod(path_.c_str(), buf.st_mode) == -1) {
                 throw Error(2, fileIo->path_, strError(), "chmod");
             }
         }
@@ -287,13 +288,13 @@ namespace Exiv2 {
         }
 
         if (switchMode(opSeek) != 0) return 1;
-        return fseek(fp_, offset, fileSeek);
+        return std::fseek(fp_, offset, fileSeek);
     }
 
     long FileIo::tell() const
     {
         assert(fp_ != 0);
-        return ftell(fp_);
+        return std::ftell(fp_);
     }
 
 
@@ -301,7 +302,7 @@ namespace Exiv2 {
     {
         // Flush and commit only if the file is open for writing
         if (fp_ != 0 && (openMode_[0] != 'r' || openMode_[1] == '+')) {
-            fflush(fp_);
+            std::fflush(fp_);
 #if defined WIN32 && !defined __CYGWIN__
             // This is required on msvcrt before stat after writing to a file
             _commit(_fileno(fp_));
@@ -309,7 +310,7 @@ namespace Exiv2 {
         }
 
         struct stat buf;
-        int ret = stat(path_.c_str(), &buf);
+        int ret = ::stat(path_.c_str(), &buf);
 
         if (ret != 0) return -1;
         return buf.st_size;
@@ -324,12 +325,12 @@ namespace Exiv2 {
     int FileIo::open(const std::string& mode)
     {
         if (fp_ != 0) {
-            fclose(fp_);
+            std::fclose(fp_);
         }
 
         openMode_ = mode;
         opMode_ = opSeek;
-        fp_ = fopen(path_.c_str(), mode.c_str());
+        fp_ = std::fopen(path_.c_str(), mode.c_str());
         if (!fp_) return 1;
         return 0;
     }
@@ -342,7 +343,7 @@ namespace Exiv2 {
     int FileIo::close()
     {
         if (fp_ != 0) {
-            fclose(fp_);
+            std::fclose(fp_);
             fp_= 0;
         }
         return 0;
@@ -361,7 +362,7 @@ namespace Exiv2 {
     {
         assert(fp_ != 0);
         if (switchMode(opRead) != 0) return 0;
-        return (long)fread(buf, 1, rcount, fp_);
+        return (long)std::fread(buf, 1, rcount, fp_);
     }
 
     int FileIo::getb()
@@ -379,7 +380,7 @@ namespace Exiv2 {
     bool FileIo::eof() const
     {
         assert(fp_ != 0);
-        return feof(fp_) != 0;
+		return feof(fp_) != 0;
     }
 
     std::string FileIo::path() const
@@ -449,7 +450,7 @@ namespace Exiv2 {
     {
         reserve(wcount);
         assert(isMalloced_);
-        memcpy(&data_[idx_], data, wcount);
+        std::memcpy(&data_[idx_], data, wcount);
         idx_ += wcount;
         return wcount;
     }
@@ -562,7 +563,7 @@ namespace Exiv2 {
     {
         long avail = size_ - idx_;
         long allow = std::min(rcount, avail);
-        memcpy(buf, &data_[idx_], allow);
+        std::memcpy(buf, &data_[idx_], allow);
         idx_ += allow;
         if (rcount > avail) eof_ = true;
         return allow;
@@ -602,7 +603,7 @@ namespace Exiv2 {
             throw Error(10, path, "rb", strError());
         }
         struct stat st;
-        if (0 != stat(path.c_str(), &st)) {
+        if (0 != ::stat(path.c_str(), &st)) {
             throw Error(2, path, strError(), "stat");
         }
         DataBuf buf(st.st_size);
diff --git a/src/iotest.cpp b/src/iotest.cpp
index dfb4578..9f17c7b 100644
--- a/src/iotest.cpp
+++ b/src/iotest.cpp
@@ -33,6 +33,7 @@
 #include "error.hpp"
 #include "futils.hpp"
 #include "basicio.hpp"
+#include <cstring>
 #include <iostream>
 
 using Exiv2::byte;
@@ -135,8 +136,8 @@ int WriteReadSeek(BasicIo &io)
     const char tester2[] = "Appending this on the end";
     const char expect[] = "this is a little teAppending this on the end";
     const long insert = 19;
-    const long len1 = (long)strlen(tester1) + 1;
-    const long len2 = (long)strlen(tester2) + 1;
+    const long len1 = (long)std::strlen(tester1) + 1;
+    const long len2 = (long)std::strlen(tester2) + 1;
 
     if (io.open() != 0) {
         throw Error(9, io.path(), strError());
@@ -155,7 +156,7 @@ int WriteReadSeek(BasicIo &io)
     io.seek(-len1, BasicIo::cur);
 
     int c = EOF;
-    memset(buf, -1, sizeof(buf));
+    std::memset(buf, -1, sizeof(buf));
     for (int i = 0; (c=io.getb()) != EOF; ++i) {
         buf[i] = (byte)c;
     }
@@ -204,7 +205,7 @@ int WriteReadSeek(BasicIo &io)
     if (io.open() != 0)  {
         throw Error(9, io.path(), strError());
     }
-    memset(buf, -1, sizeof(buf));
+    std::memset(buf, -1, sizeof(buf));
     if (io.read(buf, sizeof(buf)) != insert + len2) {
         std::cerr << ": WRS something went wrong
";
         return 10;
@@ -216,11 +217,10 @@ int WriteReadSeek(BasicIo &io)
         return 11;
     }
 
-    if (strcmp(expect, (char*)buf) != 0 ) {
+    if (std::strcmp(expect, (char*)buf) != 0 ) {
         std::cerr << ": WRS strings don't match 2
";
         return 12;
     }
 
     return 0;
 }
-
diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index d085d43..4c04def 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -543,8 +543,8 @@ namespace Exiv2 {
                     if (outIo.write(tmpBuf, 33) != 33) throw Error(21);
 
                     // Write new XMP packet
-                    if (   outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), xmpPacket_.size())
-                           != static_cast<long>(xmpPacket_.size())) throw Error(21);
+                    if (   outIo.write(reinterpret_cast<const byte*>(xmpPacket_.data()), static_cast<long>(xmpPacket_.size()))
+                        != static_cast<long>(xmpPacket_.size())) throw Error(21);
                     if (outIo.error()) throw Error(21);
                     --search;
                 }
diff --git a/src/makernote.cpp b/src/makernote.cpp
index c48c07f..4ad4eb8 100644
--- a/src/makernote.cpp
+++ b/src/makernote.cpp
@@ -44,6 +44,7 @@ EXIV2_RCSID("@(#) $Id$")
 #include <iomanip>
 #include <iostream>
 #include <cassert>
+#include <cstring>
 
 // *****************************************************************************
 // class member definitions
@@ -74,7 +75,7 @@ namespace Exiv2 {
         : MakerNote(rhs), absShift_(rhs.absShift_), shift_(rhs.shift_),
           start_(rhs.start_), header_(rhs.header_.size_), ifd_(rhs.ifd_)
     {
-        memcpy(header_.pData_, rhs.header_.pData_, header_.size_);
+        std::memcpy(header_.pData_, rhs.header_.pData_, header_.size_);
     }
 
     int IfdMakerNote::read(const byte* buf,
@@ -153,7 +154,7 @@ namespace Exiv2 {
 
     long IfdMakerNote::copyHeader(byte* buf) const
     {
-        if (header_.size_ != 0) memcpy(buf, header_.pData_, header_.size_);
+        if (header_.size_ != 0) std::memcpy(buf, header_.pData_, header_.size_);
         return header_.size_;
     }
 
diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index a7baf3c..29b151f 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -221,8 +221,8 @@ namespace Exiv2 {
             std::string::size_type idx = xmpPacket.find_first_of('<');
             if (idx != std::string::npos && idx > 0) {
 #ifndef SUPPRESS_WARNINGS
-                std::cerr << "Warning: Removing " << idx << " characters "
-                          << "from the beginning of the XMP packet
";
+                std::cerr << "Warning: Removing " << static_cast<unsigned long>(idx)
+						  << " characters from the beginning of the XMP packet
";
 #endif
                 xmpPacket = xmpPacket.substr(idx);
             }
diff --git a/src/types.cpp b/src/types.cpp
index 33080ea..8feb0d6 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -44,6 +44,7 @@ EXIV2_RCSID("@(#) $Id$")
 #include <ctime>
 #include <cstdio>
 #include <cassert>
+#include <cstring>
 
 // *****************************************************************************
 // class member definitions
@@ -111,7 +112,7 @@ namespace Exiv2 {
     {
         if (size > 0) {
             pData_ = new byte[size];
-            memcpy(pData_, pData, size);
+            std::memcpy(pData_, pData, size);
             size_ = size;
         }
     }
@@ -326,8 +327,8 @@ namespace Exiv2 {
         assert(tm != 0);
         int rc = 1;
         int year, mon, mday, hour, min, sec;
-        int scanned = sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d",
-                             &year, &mon, &mday, &hour, &min, &sec);
+        int scanned = std::sscanf(buf, "%4d:%2d:%2d %2d:%2d:%2d",
+                                  &year, &mon, &mday, &hour, &min, &sec);
         if (scanned == 6) {
             tm->tm_year = year - 1900;
             tm->tm_mon  = mon - 1;
diff --git a/src/utils.cpp b/src/utils.cpp
index b7dfbdd..c1355f2 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -49,6 +49,7 @@ EXIV2_RCSID("@(#) $Id$")
 # include <unistd.h>                     // for getopt(), stat()
 #endif
 
+#include <climits>
 #include <cerrno>
 #include <cstdlib>
 #include <cstring>
@@ -136,7 +137,7 @@ namespace Util {
     {
         if (!nptr || *nptr == '

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list