Fix a few compiler warnings in GCC 9

Apparently GCC 7 is EOL in Debian testing.
This commit is contained in:
Ilari Liusvaara 2020-06-07 15:45:14 +03:00
parent f537f4943c
commit 4312be19e5
4 changed files with 8 additions and 7 deletions

View file

@ -2,6 +2,7 @@
#define _instance__hpp__included__
#include "library/threads.hpp"
#include <cstring>
class movie_logic;
class memory_space;
@ -55,7 +56,7 @@ public:
{
entry e;
e.ptr = ptr = reinterpret_cast<T*>(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;

View file

@ -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<int16_t, int16_t>* output, size_t samples)
{
if(!song) {
memset(output, 0, samples * sizeof(std::pair<int16_t, int16_t>));
memset((char*)output, 0, samples * sizeof(std::pair<int16_t, int16_t>));
return;
}
const subsong_transition* strans1 = &song->transitions(mem.subsong1);

View file

@ -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]);

View file

@ -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);