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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:42:30 UTC 2017


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

The following commit has been merged in the master branch:
commit e2c570a1ce997a5036b786068ac2b6a894e33ab9
Author: Robin Mills <robin at clanmills.com>
Date:   Tue Jun 28 04:40:25 2011 +0000

    EPS project.
    added long ul2Data(byte* buf, size_t s, ByteOrder byteOrder) to the DevStudio 64 bit build.
    This rippled requiring casts to differentiate ul2Data(byte*, uint32_t,size_t) and ul2Data(byte*,size_t,size_t)
    Team review requested.
---
 src/epsimage.cpp  |  6 +++---
 src/jp2image.cpp  |  6 +++---
 src/jpgimage.cpp  |  2 +-
 src/orfimage.cpp  |  2 +-
 src/pngchunk.cpp  |  4 ++--
 src/preview.cpp   |  6 +++---
 src/psdimage.cpp  |  2 +-
 src/tiffimage.cpp |  2 +-
 src/types.cpp     | 16 ++++++++++++----
 src/types.hpp     |  7 +++++++
 10 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/src/epsimage.cpp b/src/epsimage.cpp
index be23b85..d33c3d7 100644
--- a/src/epsimage.cpp
+++ b/src/epsimage.cpp
@@ -727,7 +727,7 @@ namespace {
             if (sizeWmf != 0) {
                 NativePreview nativePreview;
                 nativePreview.position_ = static_cast<long>(posWmf);
-                nativePreview.size_ = sizeWmf;
+                nativePreview.size_ = (uint32_t) sizeWmf;
                 nativePreview.width_ = 0;
                 nativePreview.height_ = 0;
                 nativePreview.mimeType_ = "image/x-wmf";
@@ -736,7 +736,7 @@ namespace {
             if (sizeTiff != 0) {
                 NativePreview nativePreview;
                 nativePreview.position_ = static_cast<long>(posTiff);
-                nativePreview.size_ = sizeTiff;
+                nativePreview.size_ = (uint32_t) sizeTiff;
                 nativePreview.width_ = 0;
                 nativePreview.height_ = 0;
                 nativePreview.mimeType_ = "image/tiff";
@@ -1073,7 +1073,7 @@ namespace Exiv2
     bool isEpsType(BasicIo& iIo, bool advance)
     {
         // read as many bytes as needed for the longest (DOS) EPS signature
-        long bufSize = dosEpsSignature.size();
+        long bufSize = (long) dosEpsSignature.size();
         for (size_t i = 0; i < (sizeof epsFirstLine) / (sizeof *epsFirstLine); i++) {
             if (bufSize < static_cast<long>(epsFirstLine[i].size())) {
                 bufSize = static_cast<long>(epsFirstLine[i].size());
diff --git a/src/jp2image.cpp b/src/jp2image.cpp
index 44b9f32..6e1558e 100644
--- a/src/jp2image.cpp
+++ b/src/jp2image.cpp
@@ -488,7 +488,7 @@ namespace Exiv2
                             memcpy(rawExif.pData_ + sizeof(ExifHeader), &blob[0], blob.size());
 
                             DataBuf boxData(8 + 16 + rawExif.size_);
-                            ul2Data(boxDataSize, boxData.size_, Exiv2::bigEndian);
+                            ul2Data(boxDataSize, (uint32_t) boxData.size_, Exiv2::bigEndian);
                             ul2Data(boxUUIDtype, kJp2BoxTypeUuid, Exiv2::bigEndian);
                             memcpy(boxData.pData_,          boxDataSize,    4);
                             memcpy(boxData.pData_ + 4,      boxUUIDtype,    4);
@@ -511,7 +511,7 @@ namespace Exiv2
                         if (rawIptc.size_ > 0)
                         {
                             DataBuf boxData(8 + 16 + rawIptc.size_);
-                            ul2Data(boxDataSize, boxData.size_, Exiv2::bigEndian);
+                            ul2Data(boxDataSize, (uint32_t) boxData.size_, Exiv2::bigEndian);
                             ul2Data(boxUUIDtype, kJp2BoxTypeUuid, Exiv2::bigEndian);
                             memcpy(boxData.pData_,          boxDataSize,    4);
                             memcpy(boxData.pData_ + 4,      boxUUIDtype,    4);
@@ -541,7 +541,7 @@ namespace Exiv2
 
                         DataBuf xmp(reinterpret_cast<const byte*>(xmpPacket_.data()), static_cast<long>(xmpPacket_.size()));
                         DataBuf boxData(8 + 16 + xmp.size_);
-                        ul2Data(boxDataSize, boxData.size_, Exiv2::bigEndian);
+                        ul2Data(boxDataSize, (uint32_t)boxData.size_, Exiv2::bigEndian);
                         ul2Data(boxUUIDtype, kJp2BoxTypeUuid, Exiv2::bigEndian);
                         memcpy(boxData.pData_,          boxDataSize,  4);
                         memcpy(boxData.pData_ + 4,      boxUUIDtype,  4);
diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index 1306370..14d37c3 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -230,7 +230,7 @@ namespace Exiv2 {
             us2Data(tmpBuf + 4, iptc_, bigEndian);
             tmpBuf[6] = 0;
             tmpBuf[7] = 0;
-            ul2Data(tmpBuf + 8, rawIptc.size_, bigEndian);
+            ul2Data(tmpBuf + 8, (uint32_t)rawIptc.size_, bigEndian);
             append(psBlob, tmpBuf, 12);
             append(psBlob, rawIptc.pData_, rawIptc.size_);
             // Data is padded to be even (but not included in size)
diff --git a/src/orfimage.cpp b/src/orfimage.cpp
index e53c02e..5b1becb 100644
--- a/src/orfimage.cpp
+++ b/src/orfimage.cpp
@@ -281,7 +281,7 @@ namespace Exiv2 {
             break;
         }
         us2Data(buf.pData_ + 2, sig_, byteOrder());
-        ul2Data(buf.pData_ + 4, 0x00000008, byteOrder());
+        ul2Data(buf.pData_ + 4, (uint32_t) 0x00000008, byteOrder());
         return buf;
     }
 
diff --git a/src/pngchunk.cpp b/src/pngchunk.cpp
index 561dc1a..caf4250 100644
--- a/src/pngchunk.cpp
+++ b/src/pngchunk.cpp
@@ -541,7 +541,7 @@ namespace Exiv2 {
         uLong tmp = crc32(0L, Z_NULL, 0);
         tmp       = crc32(tmp, (const Bytef*)crcData.data(), static_cast<uInt>(crcData.size()));
         byte crc[4];
-        ul2Data(crc, tmp, bigEndian);
+        ul2Data(crc, (uint32_t) tmp, bigEndian);
         // Assemble the chunk
         return std::string((const char*)length, 4) + chunkType + chunkData + std::string((const char*)crc, 4);
 
@@ -578,7 +578,7 @@ namespace Exiv2 {
         uLong tmp = crc32(0L, Z_NULL, 0);
         tmp       = crc32(tmp, (const Bytef*)crcData.data(), static_cast<uInt>(crcData.size()));
         byte crc[4];
-        ul2Data(crc, tmp, bigEndian);
+        ul2Data(crc, (uint32_t)tmp, bigEndian);
         // Assemble the chunk
         return std::string((const char*)length, 4) + chunkType + chunkData + std::string((const char*)crc, 4);
 
diff --git a/src/preview.cpp b/src/preview.cpp
index 1093ac1..f532eb4 100644
--- a/src/preview.cpp
+++ b/src/preview.cpp
@@ -826,7 +826,7 @@ namespace {
         width_ = widthDatum->toLong();
         height_ = heightDatum->toLong();
         preview_ = decodeBase64(imageDatum->toString());
-        size_ = preview_.size();
+        size_ = (uint32_t)preview_.size();
         valid_ = true;
     }
 
@@ -849,7 +849,7 @@ namespace {
     DataBuf LoaderXmpJpeg::getData() const
     {
         if (!valid()) return DataBuf();
-        return DataBuf(reinterpret_cast<const Exiv2::byte*>(preview_.data()), preview_.size());
+        return DataBuf(reinterpret_cast<const Exiv2::byte*>(preview_.data()), (long)preview_.size());
     }
 
     bool LoaderXmpJpeg::readDimensions()
@@ -861,7 +861,7 @@ namespace {
 
     std::string decodeBase64(const std::string& src)
     {
-        const unsigned int srcSize = src.size();
+        const unsigned int srcSize = (const unsigned int) src.size();
 
         // create decoding table
         unsigned int invalid = 64;
diff --git a/src/psdimage.cpp b/src/psdimage.cpp
index db41c55..67d81ae 100644
--- a/src/psdimage.cpp
+++ b/src/psdimage.cpp
@@ -582,7 +582,7 @@ namespace Exiv2 {
                 if (out.write(buf, 2) != 2) throw Error(21);
                 us2Data(buf, 0, bigEndian);                      // NULL resource name
                 if (out.write(buf, 2) != 2) throw Error(21);
-                ul2Data(buf, rawIptc.size_, bigEndian);
+                ul2Data(buf, (uint32_t)rawIptc.size_, bigEndian);
                 if (out.write(buf, 4) != 4) throw Error(21);
                 // Write encoded Iptc data
                 if (out.write(rawIptc.pData_, rawIptc.size_) != rawIptc.size_) throw Error(21);
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index 594b017..48c2e83 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -1973,7 +1973,7 @@ namespace Exiv2 {
             break;
         }
         us2Data(buf.pData_ + 2, tag_, byteOrder_);
-        ul2Data(buf.pData_ + 4, 0x00000008, byteOrder_);
+        ul2Data(buf.pData_ + 4, (uint32_t)0x00000008, byteOrder_);
         return buf;
     }
 
diff --git a/src/types.cpp b/src/types.cpp
index 45ae899..8055ad4 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -320,12 +320,12 @@ namespace Exiv2 {
     long us2Data(byte* buf, uint16_t s, ByteOrder byteOrder)
     {
         if (byteOrder == littleEndian) {
-            buf[0] =  (byte)(s & 0x00ff);
+            buf[0] = (byte) (s & 0x00ff);
             buf[1] = (byte)((s & 0xff00) >> 8);
         }
         else {
             buf[0] = (byte)((s & 0xff00) >> 8);
-            buf[1] =  (byte)(s & 0x00ff);
+            buf[1] = (byte) (s & 0x00ff);
         }
         return 2;
     }
@@ -333,7 +333,7 @@ namespace Exiv2 {
     long ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder)
     {
         if (byteOrder == littleEndian) {
-            buf[0] =  (byte)(l & 0x000000ff);
+            buf[0] = (byte) (l & 0x000000ff);
             buf[1] = (byte)((l & 0x0000ff00) >> 8);
             buf[2] = (byte)((l & 0x00ff0000) >> 16);
             buf[3] = (byte)((l & 0xff000000) >> 24);
@@ -342,11 +342,19 @@ namespace Exiv2 {
             buf[0] = (byte)((l & 0xff000000) >> 24);
             buf[1] = (byte)((l & 0x00ff0000) >> 16);
             buf[2] = (byte)((l & 0x0000ff00) >> 8);
-            buf[3] =  (byte)(l & 0x000000ff);
+            buf[3] = (byte) (l & 0x000000ff);
         }
         return 4;
     }
 
+#ifdef _WIN64
+    long ul2Data(byte* buf, size_t s, ByteOrder byteOrder)
+    {
+        uint32_t l = (uint32_t) s;
+        return ul2Data(buf,l,byteOrder); // TODO: should this be sizeof(size_t) ?
+    }
+#endif
+
     long ur2Data(byte* buf, URational l, ByteOrder byteOrder)
     {
         long o = ul2Data(buf, l.first, byteOrder);
diff --git a/src/types.hpp b/src/types.hpp
index 0ed6ca5..16d5377 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -294,6 +294,13 @@ namespace Exiv2 {
              return number of bytes written.
      */
     EXIV2API long ul2Data(byte* buf, uint32_t l, ByteOrder byteOrder);
+#ifdef _WIN64
+	/*!
+      @brief Convert an unsigned long to data, write the data to the buffer,
+             return number of bytes written.
+     */
+    EXIV2API long ul2Data(byte* buf, size_t l, ByteOrder byteOrder);
+#endif
     /*!
       @brief Convert an unsigned rational to data, write the data to the buffer,
              return number of bytes written.

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list