From e45301b1042a695204682f47e1da0a5ac99db694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 2 Jan 2017 22:51:48 +0100 Subject: [PATCH] Fix compilation with GCC --- src/audio/FileAudioSource.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/audio/FileAudioSource.cpp b/src/audio/FileAudioSource.cpp index 8c598fc4fd..274364266c 100644 --- a/src/audio/FileAudioSource.cpp +++ b/src/audio/FileAudioSource.cpp @@ -65,9 +65,10 @@ public: if (currentPosition != -1) { size_t bytesToRead = Math::Min(len, _dataLength - offset); - if (currentPosition != _dataBegin + offset) + sint64 dataOffset = _dataBegin + offset; + if (currentPosition != dataOffset) { - sint64 newPosition = SDL_RWseek(_rw, _dataBegin + offset, SEEK_SET); + sint64 newPosition = SDL_RWseek(_rw, dataOffset, SEEK_SET); if (newPosition == -1) { return 0; @@ -101,7 +102,8 @@ public: return false; } - Uint32 chunkSize = SDL_ReadLE32(rw); + // Read and discard chunk size + SDL_ReadLE32(rw); Uint32 chunkFormat = SDL_ReadLE32(rw); if (chunkFormat != WAVE) {