[gexiv2] iostream: Adapt to new Exiv2 API in 0.26
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gexiv2] iostream: Adapt to new Exiv2 API in 0.26
- Date: Fri, 12 May 2017 18:21:03 +0000 (UTC)
commit f295c5ce9d0a87ee0c2cc793ca191369e05b7cf1
Author: Jens Georg <mail jensge org>
Date: Fri May 12 19:50:58 2017 +0200
iostream: Adapt to new Exiv2 API in 0.26
https://bugzilla.gnome.org/show_bug.cgi?id=782449
gexiv2/gexiv2-stream-io.cpp | 4 ++--
gexiv2/gexiv2-stream-io.h | 8 +++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gexiv2/gexiv2-stream-io.cpp b/gexiv2/gexiv2-stream-io.cpp
index 0ae3324..abfb843 100644
--- a/gexiv2/gexiv2-stream-io.cpp
+++ b/gexiv2/gexiv2-stream-io.cpp
@@ -142,7 +142,7 @@ long StreamIo::tell () const {
return cb->Position (cb->handle);
}
-long StreamIo::size () const {
+StreamIo::size_type StreamIo::size () const {
return cb->Length (cb->handle);
}
@@ -175,7 +175,7 @@ Exiv2::DataBuf StreamIo::read (long read_count) {
long StreamIo::read (Exiv2::byte* buf, long read_count) {
long total_read_bytes = 0;
-
+
while (read_count > total_read_bytes) {
/* because of a marshalling problem on managed side, we shift the
pointer and do NOT use the offset parameter */
diff --git a/gexiv2/gexiv2-stream-io.h b/gexiv2/gexiv2-stream-io.h
index 76621a9..a26f4e6 100644
--- a/gexiv2/gexiv2-stream-io.h
+++ b/gexiv2/gexiv2-stream-io.h
@@ -25,6 +25,12 @@ public:
StreamIo (ManagedStreamCallbacks* cb);
+#if EXIV2_TEST_VERSION(0,26,0)
+ typedef size_t size_type;
+#else
+ typedef long size_type;
+#endif
+
virtual ~StreamIo ();
virtual int open ();
virtual int close ();
@@ -39,7 +45,7 @@ public:
virtual Exiv2::byte* mmap (bool isWriteable = false);
virtual int munmap ();
virtual long tell () const;
- virtual long size () const;
+ virtual size_type size () const;
virtual bool isopen () const;
virtual int error () const;
virtual bool eof () const;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]