From e74774138c003a3ae7a5641fc0849fc4e1fd0666 Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Thu, 30 Apr 2020 14:25:28 +0200 Subject: [PATCH] Fix warnings and linker errors on gcc --- src/gui/util.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/util.cpp b/src/gui/util.cpp index 13692c7f..d2126208 100644 --- a/src/gui/util.cpp +++ b/src/gui/util.cpp @@ -147,7 +147,7 @@ public: return stream.IsOk(); } bool IsSeekable() const override { - return pos < BUFFER_SIZE; + return pos < (wxFileOffset)BUFFER_SIZE; } size_t LastRead() const override { return last_read; @@ -176,7 +176,7 @@ public: stream.Read(out_buffer, size); size_t read = stream.LastRead(); last_read += read; - if (pos < BUFFER_SIZE) { + if (pos < (wxFileOffset)BUFFER_SIZE) { // update buffer memcpy(buffer + pos, out_buffer, min(BUFFER_SIZE - (size_t)pos, read)); } @@ -187,8 +187,8 @@ public: } wxFileOffset SeekI(wxFileOffset target, wxSeekMode mode = wxFromStart) override { assert(mode == wxFromStart); - assert(target < BUFFER_SIZE); - if (target < BUFFER_SIZE) { + assert(target < (wxFileOffset)BUFFER_SIZE); + if (target < (wxFileOffset)BUFFER_SIZE) { pos = target; return target; } else { @@ -205,7 +205,7 @@ protected: } private: wxInputStream& stream; - static const size_t BUFFER_SIZE = 16; + static constexpr size_t BUFFER_SIZE = 16; Byte buffer[BUFFER_SIZE]; // positions: // Invariant: pos < stream_pos ==> pos < BUFFER_SIZE && buffer[i] is valid for i<=pos