From dbb36178cc6402c036f9f4847cd46a28c55b3689 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 8 Jan 2020 14:14:48 +0100 Subject: [PATCH] contrib: sidplay2: fix signed char stored as int8_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using 0xXX notation the issue we also have to adjust the width. Fixes compilation with gcc 9 for Raspberry: compile: arm-linux-gnueabihf-g++ -DHAVE_CONFIG_H -Icontrib/arm-linux-gnueabihf/include -Icontrib/arm-linux-gnueabihf/include -g -O2 -DHAVE_UNIX -I../../include -I../../include/sidplay -c xsid.cpp -fPIC -DPIC -o xsid.o xsid.cpp:101:1: error: narrowing conversion of ‘'\200'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] 101 | }; | ^ xsid.cpp:101:1: error: narrowing conversion of ‘'\224'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] xsid.cpp:101:1: error: narrowing conversion of ‘'\251'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] xsid.cpp:101:1: error: narrowing conversion of ‘'\274'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] xsid.cpp:101:1: error: narrowing conversion of ‘'\316'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] xsid.cpp:101:1: error: narrowing conversion of ‘'\341'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] xsid.cpp:101:1: error: narrowing conversion of ‘'\362'’ from ‘char’ to ‘int8_t’ {aka ‘signed char’} [-Wnarrowing] make[4]: *** [Makefile:409: xsid.lo] Error 1 --- contrib/src/sidplay2/rules.mak | 1 + contrib/src/sidplay2/sidplay2-char-cast.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 contrib/src/sidplay2/sidplay2-char-cast.patch diff --git a/contrib/src/sidplay2/rules.mak b/contrib/src/sidplay2/rules.mak index 84c35ccfee..de77935774 100644 --- a/contrib/src/sidplay2/rules.mak +++ b/contrib/src/sidplay2/rules.mak @@ -25,6 +25,7 @@ sidplay-libs: sidplay-libs-$(SID_VERSION).tar.gz .sum-sidplay2 $(APPLY) $(SRC)/sidplay2/sidplay2-string.patch $(APPLY) $(SRC)/sidplay2/sidplay-fix-ln-s.patch $(APPLY) $(SRC)/sidplay2/sidplay2-resid-dependency.patch + $(APPLY) $(SRC)/sidplay2/sidplay2-char-cast.patch $(MOVE) .sidplay2: sidplay-libs diff --git a/contrib/src/sidplay2/sidplay2-char-cast.patch b/contrib/src/sidplay2/sidplay2-char-cast.patch new file mode 100644 index 0000000000..14eda13960 --- /dev/null +++ b/contrib/src/sidplay2/sidplay2-char-cast.patch @@ -0,0 +1,13 @@ +--- sidplay-libs/libsidplay/src/xsid/xsid.cpp.char 2004-06-14 22:08:02.000000000 +0200 ++++ sidplay-libs/libsidplay/src/xsid/xsid.cpp 2020-01-10 08:41:49.454974200 +0100 +@@ -96,8 +96,8 @@ const int8_t XSID::sampleConvertTable[16 + */ + const int8_t XSID::sampleConvertTable[16] = + { +- '\x80', '\x94', '\xa9', '\xbc', '\xce', '\xe1', '\xf2', '\x03', +- '\x1b', '\x2a', '\x3b', '\x49', '\x58', '\x66', '\x73', '\x7f' ++ (int8_t)0x80, (int8_t)0x94, (int8_t)0xa9, (int8_t)0xbc, (int8_t)0xce, (int8_t)0xe1, (int8_t)0xf2, (int8_t)0x03, ++ (int8_t)0x1b, (int8_t)0x2a, (int8_t)0x3b, (int8_t)0x49, (int8_t)0x58, (int8_t)0x66, (int8_t)0x73, (int8_t)0x7f + }; + + const char *XSID::credit =