Skip to content

Commit

Permalink
Remove -Wno-narrowing, bump to gnu++14
Browse files Browse the repository at this point in the history
  • Loading branch information
m45t3r committed May 25, 2020
1 parent 713e6b1 commit 9f2d996
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ OFLAGS = -Ofast -march=armv5te -mtune=arm926ej-s -marm \
-flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections \
-fno-stack-protector -fomit-frame-pointer \
-Wall -Wno-narrowing -Wno-restrict
-Wall -Wno-restrict

ifeq ($(PGO), GENERATE)
OFLAGS += -fprofile-generate -fprofile-dir=./profile
Expand Down Expand Up @@ -95,7 +95,7 @@ $(UNZIPDEFINES) \
-D_ZAURUS \
-D__SDL__ \

CXXFLAGS = --std=gnu++03 \
CXXFLAGS = --std=gnu++14 \
-fno-exceptions -fno-rtti -fno-threadsafe-statics \
$(CCFLAGS)

Expand Down
20 changes: 11 additions & 9 deletions src/apu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#undef __WIN32__
#endif

#include <limits.h>

#include "snes9x.h"
#include "spc700.h"
#include "apu.h"
Expand Down Expand Up @@ -624,10 +626,10 @@ void S9xFixEnvelope(int channel, uint8 gain, uint8 adsr1, uint8 adsr2)
static unsigned long AttackRate[16] = {4100, 2600, 1500, 1000, 640, 380, 260, 160,
96, 64, 40, 24, 16, 10, 6, 1};
static unsigned long DecayRate[8] = {1200, 740, 440, 290, 180, 110, 74, 37};
static unsigned long SustainRate[32] = {~0, 38000, 28000, 24000, 19000, 14000, 12000, 9400,
7100, 5900, 4700, 3500, 2900, 2400, 1800, 1500,
1200, 880, 740, 590, 440, 370, 290, 220,
180, 150, 110, 92, 74, 55, 37, 18};
static unsigned long SustainRate[32] = {ULONG_MAX, 38000, 28000, 24000, 19000, 14000, 12000, 9400,
7100, 5900, 4700, 3500, 2900, 2400, 1800, 1500,
1200, 880, 740, 590, 440, 370, 290, 220,
180, 150, 110, 92, 74, 55, 37, 18};
// XXX: can DSP be switched to ADSR mode directly from GAIN/INCREASE/ DECREASE mode? And if so, what
// stage of the sequence does it start at?
if (S9xSetSoundMode(channel, MODE_ADSR)) {
Expand Down Expand Up @@ -655,12 +657,12 @@ void S9xFixEnvelope(int channel, uint8 gain, uint8 adsr1, uint8 adsr2)
}
} else {
static unsigned long IncreaseRate[32] = {
~0, 4100, 3100, 2600, 2000, 1500, 1300, 1000, 770, 640, 510, 380, 320, 260, 190, 160,
130, 96, 80, 64, 48, 40, 32, 24, 20, 16, 12, 10, 8, 6, 4, 2};
ULONG_MAX, 4100, 3100, 2600, 2000, 1500, 1300, 1000, 770, 640, 510, 380, 320, 260, 190, 160,
130, 96, 80, 64, 48, 40, 32, 24, 20, 16, 12, 10, 8, 6, 4, 2};
static unsigned long DecreaseRateExp[32] = {
~0, 38000, 28000, 24000, 19000, 14000, 12000, 9400, 7100, 5900, 4700,
3500, 2900, 2400, 1800, 1500, 1200, 880, 740, 590, 440, 370,
290, 220, 180, 150, 110, 92, 74, 55, 37, 18};
ULONG_MAX, 38000, 28000, 24000, 19000, 14000, 12000, 9400, 7100, 5900, 4700,
3500, 2900, 2400, 1800, 1500, 1200, 880, 740, 590, 440, 370,
290, 220, 180, 150, 110, 92, 74, 55, 37, 18};
if (gain & 0x40) {
// Increase mode
if (S9xSetSoundMode(channel,
Expand Down
30 changes: 15 additions & 15 deletions src/snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,22 +353,22 @@ static FreezeData SnapPPU[] = {{OFFSET(BGMode), 1, INT_V},

static FreezeData SnapDMA[] = {
#define O(N) \
{OFFSET(TransferDirection) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(AAddressFixed) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(AAddressDecrement) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(TransferMode) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(ABank) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(AAddress) + N * sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(Address) + N * sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(BAddress) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(TransferBytes) + N * sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(HDMAIndirectAddressing) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(IndirectAddress) + N * sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(IndirectBank) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(Repeat) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(LineCount) + N * sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(TransferDirection) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(AAddressFixed) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(AAddressDecrement) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(TransferMode) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(ABank) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(AAddress) + N * (int)sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(Address) + N * (int)sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(BAddress) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(TransferBytes) + N * (int)sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(HDMAIndirectAddressing) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(IndirectAddress) + N * (int)sizeof(struct SDMA), 2, INT_V}, \
{OFFSET(IndirectBank) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(Repeat) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{OFFSET(LineCount) + N * (int)sizeof(struct SDMA), 1, INT_V}, \
{ \
OFFSET(FirstLine) + N * sizeof(struct SDMA), 1, INT_V \
OFFSET(FirstLine) + N *(int)sizeof(struct SDMA), 1, INT_V \
}

O(0), O(1), O(2), O(3), O(4),
Expand Down

0 comments on commit 9f2d996

Please sign in to comment.