Hi
This fixes the build of frodo on amd64 clang 6.
SID.cpp:813:2: error: constant expression evaluates to 32768 which cannot be
narrowed to type 'int16' (aka 'short') [-Wc++11-narrowing]
0x8000, 0x9111, 0xa222, 0xb333, 0xc444, 0xd555, 0xe666, 0xf777,
^~~~~~
ok?
bluhm
Index: emulators/frodo/Makefile
===================================================================
RCS file: /data/mirror/openbsd/cvs/ports/emulators/frodo/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- emulators/frodo/Makefile 26 Jul 2017 22:45:19 -0000 1.28
+++ emulators/frodo/Makefile 15 Apr 2018 20:53:21 -0000
@@ -4,7 +4,7 @@ COMMENT= Commodore 64 emulator
DISTNAME= FrodoV4_1b.Src
PKGNAME= frodo-4.1b
-REVISION= 8
+REVISION= 9
DISTFILES= FrodoV4_1b.Src${EXTRACT_SUFX}
CATEGORIES= emulators games
Index: emulators/frodo/patches/patch-Src_SID_cpp
===================================================================
RCS file:
/data/mirror/openbsd/cvs/ports/emulators/frodo/patches/patch-Src_SID_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Src_SID_cpp
--- emulators/frodo/patches/patch-Src_SID_cpp 30 Jun 2010 22:25:57 -0000
1.2
+++ emulators/frodo/patches/patch-Src_SID_cpp 15 Apr 2018 20:49:41 -0000
@@ -1,6 +1,7 @@
$OpenBSD: patch-Src_SID_cpp,v 1.2 2010/06/30 22:25:57 jakemsr Exp $
---- Src/SID.cpp.orig Wed Jan 2 13:18:59 2002
-+++ Src/SID.cpp Thu Jan 14 09:16:38 2010
+Index: Src/SID.cpp
+--- Src/SID.cpp.orig
++++ Src/SID.cpp
@@ -64,6 +64,9 @@ class DigitalPlayer;
#define ldSINTAB 9 // size of sinus table (0 to 90 degrees)
#endif
@@ -11,6 +12,15 @@ $OpenBSD: patch-Src_SID_cpp,v 1.2 2010/0
#ifdef USE_FIXPOINT_MATHS
#include "FixPoint.i"
+@@ -374,7 +377,7 @@ class DigitalRenderer : public SIDRenderer { (private)
+ static const uint16 TriSawRectTable[0x100];
+ static const uint32 EGTable[16]; // Increment/decrement values
for all A/D/R settings
+ static const uint8 EGDRShift[256]; // For exponential approximation of
D/R
+- static const int16 SampleTab[16]; // Table for sampled voice
++ static const uint16 SampleTab[16]; // Table for sampled voice
+
+ DRVoice voice[3]; // Data for 3 voices
+
@@ -481,6 +484,12 @@ class DigitalRenderer : public SIDRenderer { (private)
uint8 *sound_buffer;
C64 *the_c64;
@@ -24,6 +34,15 @@ $OpenBSD: patch-Src_SID_cpp,v 1.2 2010/0
};
// Static data members
+@@ -800,7 +809,7 @@ const uint8 DigitalRenderer::EGDRShift[256] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ };
+
+-const int16 DigitalRenderer::SampleTab[16] = {
++const uint16 DigitalRenderer::SampleTab[16] = {
+ 0x8000, 0x9111, 0xa222, 0xb333, 0xc444, 0xd555, 0xe666, 0xf777,
+ 0x0888, 0x1999, 0x2aaa, 0x3bbb, 0x4ccc, 0x5ddd, 0x6eee, 0x7fff,
+ };
@@ -1353,6 +1362,9 @@ void DigitalRenderer::calc_buffer(int16 *buf, long cou
#elif defined(__linux__)