[gexiv2] Fix compilation against gexiv2 mainline



commit c7a519e6cd381af924f8f8175cff4ee5f86fe84a
Author: Jens Georg <mail jensge org>
Date:   Sun May 16 11:50:11 2021 +0200

    Fix compilation against gexiv2 mainline
    
    This basically reverts part of the change to size_t. I expect this to
    come back at some point since it made sense.

 gexiv2/gexiv2-metadata.cpp  |  8 ++------
 gexiv2/gexiv2-stream-io.cpp | 15 +--------------
 gexiv2/gexiv2-stream-io.h   | 10 +++-------
 3 files changed, 6 insertions(+), 27 deletions(-)
---
diff --git a/gexiv2/gexiv2-metadata.cpp b/gexiv2/gexiv2-metadata.cpp
index 5bd8b65..6448c2b 100644
--- a/gexiv2/gexiv2-metadata.cpp
+++ b/gexiv2/gexiv2-metadata.cpp
@@ -46,7 +46,7 @@ public:
         , _eof{false}
         {}
 #if EXIV2_TEST_VERSION(0,27,99)
-    using size_type = size_t;
+    using size_type = long;
 #else
     using size_type = long;
 #endif
@@ -88,11 +88,7 @@ public:
     size_type write(BasicIo& /*src*/) override { return 0; }
     int putb(Exiv2::byte /*data*/) override { return EOF; }
 
-#if EXIV2_TEST_VERSION(0,27,99)
-    Exiv2::DataBuf read(size_t rcount) noexcept override {
-#else
-    Exiv2::DataBuf read(long rcount) override {
-#endif
+    Exiv2::DataBuf read(size_type rcount) override {
         Exiv2::DataBuf b{rcount};
 
         auto bytes_read = this->read(b.pData_, rcount);
diff --git a/gexiv2/gexiv2-stream-io.cpp b/gexiv2/gexiv2-stream-io.cpp
index 07c67e5..5c755c3 100644
--- a/gexiv2/gexiv2-stream-io.cpp
+++ b/gexiv2/gexiv2-stream-io.cpp
@@ -163,19 +163,7 @@ int StreamIo::close () {
     return 0;
 }
 
-#if EXIV2_TEST_VERSION(0,27,99)
-
-Exiv2::DataBuf StreamIo::read (size_t read_count) noexcept {
-    Exiv2::DataBuf buffer (read_count);
-
-    long read_bytes = read (buffer.pData_, buffer.size_);
-
-    buffer.size_ = read_bytes;
-
-    return buffer;
-}
-#else
-Exiv2::DataBuf StreamIo::read (long read_count) {
+Exiv2::DataBuf StreamIo::read (size_type read_count) {
     Exiv2::DataBuf buffer (read_count);
     
     long read_bytes = read (buffer.pData_, buffer.size_);
@@ -184,7 +172,6 @@ Exiv2::DataBuf StreamIo::read (long read_count) {
     
     return buffer;
 }
-#endif
 
 StreamIo::size_type StreamIo::read (Exiv2::byte* buf, StreamIo::size_type read_count) {
     StreamIo::size_type total_read_bytes = 0;
diff --git a/gexiv2/gexiv2-stream-io.h b/gexiv2/gexiv2-stream-io.h
index 4d49854..02f265f 100644
--- a/gexiv2/gexiv2-stream-io.h
+++ b/gexiv2/gexiv2-stream-io.h
@@ -24,7 +24,7 @@ class StreamIo : public Exiv2::BasicIo {
 public:
 #if EXIV2_TEST_VERSION(0,27,99)
     using ptr_type = Exiv2::BasicIo::UniquePtr;
-    using size_type = size_t;
+    using size_type = long;
 #else
     using ptr_type = Exiv2::BasicIo::AutoPtr;
     using size_type = long;
@@ -38,12 +38,8 @@ public:
        size_type write (const Exiv2::byte* data, size_type wcount) override;
        size_type write (Exiv2::BasicIo& src) override;
        int putb (Exiv2::byte data) override;
-#if EXIV2_TEST_VERSION(0,27,99)
-       Exiv2::DataBuf read (size_t rcount) noexcept override;
-#else
-       Exiv2::DataBuf read (long rcount) override;
-#endif
-       size_type read (Exiv2::byte* buf, size_type rcount) override;
+    Exiv2::DataBuf read (size_type rcount) override;
+    size_type read (Exiv2::byte* buf, size_type rcount) override;
        int getb () override;
        void transfer (Exiv2::BasicIo& src) override;
        int seek (long offset, Position pos) override;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]