From f92b82664dd099ac4d4439f614188a6544bfff2c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 23 Nov 2018 19:47:34 -0800 Subject: GLK: Fix gcc warnings --- engines/glk/blorb.cpp | 2 +- engines/glk/picture.cpp | 15 +++++++++------ engines/glk/picture.h | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp index f8a8cbd7c3..5c1f0bd962 100644 --- a/engines/glk/blorb.cpp +++ b/engines/glk/blorb.cpp @@ -47,7 +47,7 @@ enum { ID_WAVE = MKTAG('W', 'A', 'V', 'E'), ID_AIFF = MKTAG('A', 'I', 'F', 'F'), ID_OGG = MKTAG('O', 'G', 'G', ' '), - ID_MOD = MKTAG('M', 'O', 'D', ' '), + ID_MOD = MKTAG('M', 'O', 'D', ' ') }; /*--------------------------------------------------------------------------*/ diff --git a/engines/glk/picture.cpp b/engines/glk/picture.cpp index 7770bb892b..6d8fce9c03 100644 --- a/engines/glk/picture.cpp +++ b/engines/glk/picture.cpp @@ -109,22 +109,25 @@ Picture *Pictures::load(uint32 id) { Picture *pic; // Check if the picture is already in the store - pic = retrieve(id, false); - if (pic) - return pic; + pic = retrieve(id, false); + if (pic) + return pic; Common::File f; - if (f.open(Common::String::format("PIC%lu.png", id))) { + if (f.open(Common::String::format("PIC%u.png", id))) { png.loadStream(f); img = png.getSurface(); palette = png.getPalette(); - } else if (f.open(Common::String::format("PIC%lu.jpg", id))) { + } else if (f.open(Common::String::format("PIC%u.jpg", id))) { jpg.loadStream(f); img = jpg.getSurface(); - } else if (f.open(Common::String::format("PIC%lu.raw", id))) { + } else if (f.open(Common::String::format("PIC%u.raw", id))) { raw.loadStream(f); img = raw.getSurface(); palette = raw.getPalette(); + } else { + // No such picture + return nullptr; } pic = new Picture(); diff --git a/engines/glk/picture.h b/engines/glk/picture.h index f221569368..06d598b771 100644 --- a/engines/glk/picture.h +++ b/engines/glk/picture.h @@ -45,8 +45,8 @@ public: /** * Constructor */ - Picture(int width, int height, const Graphics::PixelFormat &format) : - Graphics::ManagedSurface(width, height, format), _refCount(0), _id(0), _scaled(false) {} + Picture(int width, int height, const Graphics::PixelFormat &fmt) : + Graphics::ManagedSurface(width, height, fmt), _refCount(0), _id(0), _scaled(false) {} /** * Increment reference counter -- cgit v1.2.3