Browse Source

contrib: sidplay2: fix signed char stored as int8_t

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
pull/101/head
Steve Lhomme 7 years ago
parent
commit
dbb36178cc
  1. 1
      contrib/src/sidplay2/rules.mak
  2. 13
      contrib/src/sidplay2/sidplay2-char-cast.patch

1
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

13
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 =
Loading…
Cancel
Save