Subject: taglib-2 further fix
From: Boyuan Yang <[email-masked]>
Date: Sat, 11 Jan 2025 14:48:46 -0500

Further fix compatibility with taglib 2.x on 32-bit architecture.
---
 src/tags/gio_wrapper.cc | 20 ++++++++++----------
 src/tags/gio_wrapper.h  | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/tags/gio_wrapper.cc b/src/tags/gio_wrapper.cc
index 8772d52..8fdd9e7 100644
--- a/src/tags/gio_wrapper.cc
+++ b/src/tags/gio_wrapper.cc
@@ -47,7 +47,7 @@ GIO_InputStream::name () const
 }
 
 TagLib::ByteVector
-GIO_InputStream::readBlock (ulong len)
+GIO_InputStream::readBlock (size_t len)
 {
     if (error)
     {
@@ -95,7 +95,7 @@ GIO_InputStream::isOpen () const
 }
 
 void
-GIO_InputStream::seek (long int offset, TagLib::IOStream::Position p)
+GIO_InputStream::seek (TagLib::offset_t offset, TagLib::IOStream::Position p)
 {
     if (error)
     {
@@ -133,13 +133,13 @@ GIO_InputStream::clear ()
     }
 }
 
-long int
+TagLib::offset_t
 GIO_InputStream::tell () const
 {
     return g_seekable_tell (G_SEEKABLE (stream));
 }
 
-long int
+TagLib::offset_t
 GIO_InputStream::length ()
 {
     if (error)
@@ -161,7 +161,7 @@ GIO_InputStream::length ()
 }
 
 void
-GIO_InputStream::truncate (long int len)
+GIO_InputStream::truncate (TagLib::offset_t len)
 {
     g_warning ("%s", "Trying to truncate read-only file");
 }
@@ -200,7 +200,7 @@ GIO_IOStream::name () const
 }
 
 TagLib::ByteVector
-GIO_IOStream::readBlock (ulong len)
+GIO_IOStream::readBlock (size_t len)
 {
     if (error)
     {
@@ -400,7 +400,7 @@ GIO_IOStream::isOpen () const
 }
 
 void
-GIO_IOStream::seek (long int offset, TagLib::IOStream::Position p)
+GIO_IOStream::seek (TagLib::offset_t offset, TagLib::IOStream::Position p)
 {
     if (error)
     {
@@ -434,13 +434,13 @@ GIO_IOStream::clear ()
     g_clear_error (&error);
 }
 
-long int
+TagLib::offset_t
 GIO_IOStream::tell () const
 {
     return g_seekable_tell (G_SEEKABLE (stream));
 }
 
-long int
+TagLib::offset_t
 GIO_IOStream::length ()
 {
     long rv = -1;
@@ -464,7 +464,7 @@ GIO_IOStream::length ()
 }
 
 void
-GIO_IOStream::truncate (long int len)
+GIO_IOStream::truncate (TagLib::offset_t len)
 {
     if (error)
     {
diff --git a/src/tags/gio_wrapper.h b/src/tags/gio_wrapper.h
index 4f99b24..fc634ab 100644
--- a/src/tags/gio_wrapper.h
+++ b/src/tags/gio_wrapper.h
@@ -33,17 +33,17 @@ public:
     GIO_InputStream (GFile *file_);
     virtual ~GIO_InputStream ();
     virtual TagLib::FileName name () const;
-    virtual TagLib::ByteVector readBlock (ulong length);
+    virtual TagLib::ByteVector readBlock (size_t length);
     virtual void writeBlock (TagLib::ByteVector const &data);
     virtual void insert (TagLib::ByteVector const &data, TagLib::offset_t start = 0, size_t replace = 0);
     virtual void removeBlock (TagLib::offset_t start = 0, size_t length = 0);
     virtual bool readOnly () const;
     virtual bool isOpen () const;
-    virtual void seek (long int offset, TagLib::IOStream::Position p = TagLib::IOStream::Beginning);
+    virtual void seek (TagLib::offset_t offset, TagLib::IOStream::Position p = TagLib::IOStream::Beginning);
     virtual void clear ();
-    virtual long int tell () const;
-    virtual long int length ();
-    virtual void truncate (long int length);
+    virtual TagLib::offset_t tell () const;
+    virtual TagLib::offset_t length ();
+    virtual void truncate (TagLib::offset_t length);
 
     virtual const GError *getError() const;
 
@@ -61,17 +61,17 @@ public:
     GIO_IOStream (GFile *file_);
     virtual ~GIO_IOStream ();
     virtual TagLib::FileName name () const;
-    virtual TagLib::ByteVector readBlock (ulong length);
+    virtual TagLib::ByteVector readBlock (size_t length);
     virtual void writeBlock (TagLib::ByteVector const &data);
     virtual void insert (TagLib::ByteVector const &data, TagLib::offset_t start = 0, size_t replace = 0);
     virtual void removeBlock (TagLib::offset_t start = 0, size_t len = 0);
     virtual bool readOnly () const;
     virtual bool isOpen () const;
-    virtual void seek (long int offset, TagLib::IOStream::Position p = TagLib::IOStream::Beginning);
+    virtual void seek (TagLib::offset_t offset, TagLib::IOStream::Position p = TagLib::IOStream::Beginning);
     virtual void clear ();
-    virtual long int tell () const;
-    virtual long int length ();
-    virtual void truncate (long int length);
+    virtual TagLib::offset_t tell () const;
+    virtual TagLib::offset_t length ();
+    virtual void truncate (TagLib::offset_t length);
 
     virtual const GError *getError() const;