From 4312be19e58986a6c05d82339a9566537cc768b5 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 7 Jun 2020 15:45:14 +0300 Subject: [PATCH] Fix a few compiler warnings in GCC 9 Apparently GCC 7 is EOL in Debian testing. --- include/core/instance.hpp | 3 ++- src/emulation/sky/music.cpp | 6 +++--- src/lua/gui-core.cpp | 4 ++-- src/platform/wxwidgets/settings-downloads.cpp | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/core/instance.hpp b/include/core/instance.hpp index b4476237..8112a1ad 100644 --- a/include/core/instance.hpp +++ b/include/core/instance.hpp @@ -2,6 +2,7 @@ #define _instance__hpp__included__ #include "library/threads.hpp" +#include class movie_logic; class memory_space; @@ -55,7 +56,7 @@ public: { entry e; e.ptr = ptr = reinterpret_cast(new char[sizeof(T) + 32]); - memset(ptr, 0, sizeof(T) + 32); + memset((char*)ptr, 0, sizeof(T) + 32); e.free1 = null; e.free2 = free2; e.prev = list; diff --git a/src/emulation/sky/music.cpp b/src/emulation/sky/music.cpp index 16f230b9..8400a9eb 100644 --- a/src/emulation/sky/music.cpp +++ b/src/emulation/sky/music.cpp @@ -504,7 +504,7 @@ namespace sky downmix_l[i] = gain_factor * c.downmix_l[i]; downmix_r[i] = gain_factor * c.downmix_r[i]; } - } catch(opus::not_loaded l) { + } catch(opus::not_loaded& l) { d = NULL; channels = c.channels; } @@ -556,7 +556,7 @@ namespace sky try { if(d) d->ctl(opus::reset); - } catch(opus::not_loaded e) { + } catch(opus::not_loaded& e) { } } @@ -623,7 +623,7 @@ namespace sky void music_player::decode(std::pair* output, size_t samples) { if(!song) { - memset(output, 0, samples * sizeof(std::pair)); + memset((char*)output, 0, samples * sizeof(std::pair)); return; } const subsong_transition* strans1 = &song->transitions(mem.subsong1); diff --git a/src/lua/gui-core.cpp b/src/lua/gui-core.cpp index 2cd169e3..cc5f1f2e 100644 --- a/src/lua/gui-core.cpp +++ b/src/lua/gui-core.cpp @@ -127,8 +127,8 @@ namespace P(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]); for(unsigned i = 0; i < 8; i++) { for(unsigned j = 0; j < 4; j++) { - b[j] |= ((a[i] >> 2*j+0) & 1) << 7-i; - b[j] |= ((a[i] >> 2*j+1) & 1) << 15-i; + b[j] |= ((a[i] >> (2*j+0)) & 1) << (7-i); + b[j] |= ((a[i] >> (2*j+1)) & 1) << (15-i); } } for(unsigned i = 0; i < 4; i++) L.pushnumber(b[i]); diff --git a/src/platform/wxwidgets/settings-downloads.cpp b/src/platform/wxwidgets/settings-downloads.cpp index 71f9c3ed..a695dbe6 100644 --- a/src/platform/wxwidgets/settings-downloads.cpp +++ b/src/platform/wxwidgets/settings-downloads.cpp @@ -30,7 +30,7 @@ namespace }; wxeditor_esettings_download::wxeditor_esettings_download(wxWindow* parent, emulator_instance& _inst) - : settings_tab(parent, inst) + : settings_tab(parent, _inst) { CHECK_UI_THREAD; wxSizer* top_s = new wxBoxSizer(wxVERTICAL);