* Small Makefile changes.
* Removed a couple files that were not being used.
* Cleanups found with clang's -Weverything (and shutting it up about a
lot of things that were ridiculous, as well as ignoring some of the
warnings still coming up).
--- a/src/Makefile
+++ b/src/Makefile
@@ -19,12 +19,12 @@
COMPILER:= $(shell $(CXX) -v 2>/dev/stdout)
-CPPFLAGS+= -std=gnu++11 -I$(SRCDIR)in_xsf_framework -I/g/Code/Winamp\ SDK -DWINAMP_PLUGIN -DUNICODE_INPUT_PLUGIN
-CXXFLAGS+= -std=gnu++11 -pipe -Wall -Wctor-dtor-privacy -Wold-style-cast -Wextra -Wno-div-by-zero -Wfloat-equal -Wshadow -Winit-self -Wcast-qual -Wunreachable-code -Wabi -Woverloaded-virtual -Wno-long-long -Wno-switch -I$(SRCDIR)in_xsf_framework -I/g/Code/Winamp\ SDK -DWINAMP_PLUGIN -DUNICODE_INPUT_PLUGIN
+MY_CPPFLAGS= $(CPPFLAGS) -std=gnu++11 -I$(SRCDIR)in_xsf_framework -I/g/Code/Winamp\ SDK -DWINAMP_PLUGIN -DUNICODE_INPUT_PLUGIN
+MY_CXXFLAGS= $(CXXFLAGS) -std=gnu++11 -pipe -Wall -Wctor-dtor-privacy -Wold-style-cast -Wextra -Wno-div-by-zero -Wfloat-equal -Wshadow -Winit-self -Wcast-qual -Wunreachable-code -Wabi -Woverloaded-virtual -Wno-long-long -Wno-switch -I$(SRCDIR)in_xsf_framework -I/g/Code/Winamp\ SDK -DWINAMP_PLUGIN -DUNICODE_INPUT_PLUGIN
ifeq (,$(findstring clang,$(COMPILER)))
-CXXFLAGS+= -Wlogical-op
+MY_CXXFLAGS+= -Wlogical-op
endif
-LDFLAGS+= -lz
+MY_LDFLAGS= $(LDFLAGS) -lz
DLL_SRCS_template= $(1)_SRCS:= $$(sort $$($(1)_SRCS))
DLL_OBJS_template= $(1)_OBJS:= $$(subst $(SRCDIR),,$$($(1)_SRCS:%.cpp=%.o))
@@ -42,24 +42,24 @@
.SUFFIXES: .cpp .o .d .a .dll
all: $(DLLS)
-debug: CXXFLAGS+= -g -D_DEBUG
+debug: MY_CXXFLAGS+= -g -D_DEBUG
debug: all
define DLL_template
$(1): $$(FRAMEWORK_OBJS) $$($$(basename $$(notdir $(1)))_OBJS)
@echo "Linking $$@..."
- @$$(CXX) -shared -fPIC $$(CXXFLAGS) -o $$@ $$^ $$(LDFLAGS)
+ @$$(CXX) -shared -fPIC $$(MY_CXXFLAGS) -o $$@ $$^ $$(MY_LDFLAGS)
endef
define SRC_template
$$(subst $(SRCDIR),,$(1:%.cpp=%.o)): $(1)
@echo "Compiling $$<..."
- @$$(CXX) $$(CXXFLAGS) -o $$(subst $(SRCDIR),,$$@) -c $$<
+ @$$(CXX) $$(MY_CXXFLAGS) -o $$(subst $(SRCDIR),,$$@) -c $$<
endef
define DEP_template
$$(subst $(SRCDIR),,$(1:%.cpp=%.d)): $(1)
@echo "Calculating depends for $$<..."
-@mkdir -p $$(@D)
- @$$(CXX) $$(CPPFLAGS) -MM -MF $$(subst $(SRCDIR),,$$@).tmp $$<
+ @$$(CXX) $$(MY_CPPFLAGS) -MM -MF $$(subst $(SRCDIR),,$$@).tmp $$<
@sed 's,$$(notdir $$*)\.o[ :]*,$$(subst /,\/,$$*).o $$(subst /,\/,$$@): ,g' < $$(subst $(SRCDIR),,$$@).tmp > $$(subst $(SRCDIR),,$$@)
@rm $$(subst $(SRCDIR),,$$@).tmp
endef
@@ -68,24 +68,24 @@
$(foreach src,$(SRCS),$(eval $(call SRC_template,$(src))))
$(foreach src,$(SRCS),$(eval $(call DEP_template,$(src))))
-$(subst $(SRCDIR),,$(in_2sf_SRCS:%.cpp=%.d)): CPPFLAGS+= -msse
-$(in_2sf_OBJS): CXXFLAGS+= -msse -DHAVE_LIBZ
+$(subst $(SRCDIR),,$(in_2sf_SRCS:%.cpp=%.d)): MY_CPPFLAGS+= -msse
+$(in_2sf_OBJS): MY_CXXFLAGS+= -msse -DHAVE_LIBZ
-in_2sf/desmume/MMU.o: CXXFLAGS+= -Wno-shadow
-in_2sf/desmume/utils/AsmJit/base/codegen.o: CXXFLAGS+= -Wno-unused-value
-in_2sf/desmume/utils/AsmJit/base/runtime.o: CXXFLAGS+= -Wno-unused-parameter
-in_2sf/desmume/utils/AsmJit/base/vmem.o: CXXFLAGS+= -Wno-missing-field-initializers -Wno-unused-function
+in_2sf/desmume/MMU.o: MY_CXXFLAGS+= -Wno-shadow
+in_2sf/desmume/utils/AsmJit/base/codegen.o: MY_CXXFLAGS+= -Wno-unused-value
+in_2sf/desmume/utils/AsmJit/base/runtime.o: MY_CXXFLAGS+= -Wno-unused-parameter
+in_2sf/desmume/utils/AsmJit/base/vmem.o: MY_CXXFLAGS+= -Wno-missing-field-initializers -Wno-unused-function
ifneq (,$(findstring clang,$(COMPILER)))
-in_2sf/desmume/utils/AsmJit/base/vmem.o: CXXFLAGS+= -Wno-missing-braces
+in_2sf/desmume/utils/AsmJit/base/vmem.o: MY_CXXFLAGS+= -Wno-missing-braces
endif
-in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: CXXFLAGS+= -Wno-unused-variable
+in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: MY_CXXFLAGS+= -Wno-unused-variable
ifneq (,$(findstring clang,$(COMPILER)))
-in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: CXXFLAGS+= -Wno-missing-braces
+in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: MY_CXXFLAGS+= -Wno-missing-braces
endif
-in_2sf/desmume/utils/AsmJit/x86/x86context.o: CXXFLAGS+= -Wno-unused-parameter -Wno-unused-value -Wno-unused-variable
-in_gsf/vbam/gba/GBA-arm.o: CXXFLAGS+= -Wno-unused-variable
+in_2sf/desmume/utils/AsmJit/x86/x86context.o: MY_CXXFLAGS+= -Wno-unused-parameter -Wno-unused-value -Wno-unused-variable
+in_gsf/vbam/gba/GBA-arm.o: MY_CXXFLAGS+= -Wno-unused-variable
ifeq (,$(findstring clang,$(COMPILER)))
-in_gsf/vbam/gba/GBA-arm.o: CXXFLAGS+= -Wno-unused-but-set-variable
+in_gsf/vbam/gba/GBA-arm.o: MY_CXXFLAGS+= -Wno-unused-but-set-variable
endif
clean:
--- a/src/in_2sf/desmume/MMU.cpp
+++ b/src/in_2sf/desmume/MMU.cpp
@@ -174,14 +174,14 @@
static const uint8_t VRAM_PAGE_UNMAPPED = 41;
static const unsigned VRAM_LCDC_PAGES = 41;
-uint8_t vram_lcdc_map[VRAM_LCDC_PAGES];
+static uint8_t vram_lcdc_map[VRAM_LCDC_PAGES];
// in the range of 0x06000000 - 0x06800000 in 16KB pages (the ARM9 vram mappable area)
// this maps to 16KB pages in the LCDC buffer which is what will actually contain the data
uint8_t vram_arm9_map[VRAM_ARM9_PAGES];
// this chooses which banks are mapped in the 128K banks starting at 0x06000000 in ARM7
-uint8_t vram_arm7_map[2];
+static uint8_t vram_arm7_map[2];
struct TVramBankInfo
{
@@ -1444,9 +1444,6 @@
break;
case EDMADestinationUpdate_IncrementReload:
dstinc = sz;
- break;
- default:
- bogarted = true;
}
switch (this->sar)
{
@@ -1460,7 +1457,6 @@
srcinc = 0;
break;
case EDMASourceUpdate_Invalid:
- default:
bogarted = true;
}
--- a/src/in_2sf/desmume/MMU.h
+++ b/src/in_2sf/desmume/MMU.h
@@ -82,6 +82,8 @@
class TRegister_32
{
public:
+ virtual ~TRegister_32() { }
+
virtual uint32_t read32() = 0;
virtual void write32(uint32_t val) = 0;
void write(int size, uint32_t adr, uint32_t val)
@@ -131,6 +133,7 @@
this->fifo_empty = true;
this->fifo_low = false;
}
+ virtual ~TGXSTAT() { }
uint8_t tb; // test busy
uint8_t tr; // test result
uint8_t se; // stack error
@@ -238,6 +241,7 @@
DmaController *controller;
uint32_t *const ptr;
AddressRegister(uint32_t *_ptr) : ptr(_ptr) { }
+ virtual ~AddressRegister() { }
virtual uint32_t read32()
{
return *this->ptr;
@@ -254,6 +258,7 @@
// we pass in a pointer to the controller here so we can alert it if anything changes
DmaController *controller;
ControlRegister() { }
+ virtual ~ControlRegister() { }
virtual uint32_t read32()
{
return this->controller->read32();
--- a/src/in_2sf/desmume/NDSSystem.cpp
+++ b/src/in_2sf/desmume/NDSSystem.cpp
@@ -36,9 +36,7 @@
GameInfo gameInfo;
NDSSystem nds;
-std::unique_ptr<CFIRMWARE> firmware;
-
-bool singleStep;
+static std::unique_ptr<CFIRMWARE> firmware;
namespace DLDI
{
@@ -162,13 +160,15 @@
};
uint64_t nds_timer;
-uint64_t nds_arm9_timer, nds_arm7_timer;
+static uint64_t nds_arm9_timer, nds_arm7_timer;
struct TSequenceItem
{
uint64_t timestamp;
uint32_t param;
bool enabled;
+
+ virtual ~TSequenceItem() { }
virtual bool isTriggered() const
{
@@ -330,7 +330,7 @@
}
};
-struct Sequencer
+static struct Sequencer
{
bool nds_vblankEnded;
bool reschedule;
@@ -1010,7 +1010,6 @@
void NDS_Reset()
{
- singleStep = false;
bool fw_success = false;
auto header = NDS_getROMHeader();
--- a/src/in_2sf/desmume/SPU.cpp
+++ b/src/in_2sf/desmume/SPU.cpp
@@ -800,13 +800,11 @@
// ratio2 = (1 - cos(ratio * M_PI)) / 2
// sampleI = sampleA * (1 - ratio2) + sampleB * ratio2
return s32floor((cos_lut[static_cast<unsigned>(ratio * COSINE_INTERPOLATION_RESOLUTION)] * (sampleB - sampleA)) + sampleA);
- break;
case SPUInterpolation_Linear:
// Linear Interpolation Formula:
// sampleI = sampleA * (1 - ratio) + sampleB * ratio
return s32floor((ratio * (sampleB - sampleA)) + sampleA);
- break;
default:
break;
@@ -1128,8 +1126,6 @@
case SPUInterpolation_Cosine:
__SPU_ChanUpdate(actuallyMix, SPU, chan, SPUInterpolation_Cosine);
break;
- default:
- assert(false);
}
}
--- a/src/in_2sf/desmume/SPU.h
+++ b/src/in_2sf/desmume/SPU.h
@@ -41,7 +41,7 @@
enum SPUInterpolationMode
{
- SPUInterpolation_None ,
+ SPUInterpolation_None,
SPUInterpolation_Linear,
SPUInterpolation_Cosine
};
--- a/src/in_2sf/desmume/addons/slot1_retail.cpp
+++ b/src/in_2sf/desmume/addons/slot1_retail.cpp
@@ -103,7 +103,6 @@
else
return 0;
}
- break;
// Data read
case 0x00:
@@ -135,7 +134,6 @@
return T1ReadLong(MMU.CART_ROM, address);
}
- break;
default:
return 0;
} //switch(card.command[0])
--- a/src/in_2sf/desmume/metaspu/SndOut.cpp
+++ b/src/in_2sf/desmume/metaspu/SndOut.cpp
@@ -20,8 +20,8 @@
#include "SndOut.h"
//----------------
-int SndOutLatencyMS = 160;
-bool timeStretchDisabled = false;
+static const int SndOutLatencyMS = 160;
+static bool timeStretchDisabled = false;
//----------------
StereoOut32 StereoOut32::Empty;
--- a/src/in_2sf/desmume/metaspu/SoundTouch/FIFOSamplePipe.h
+++ b/src/in_2sf/desmume/metaspu/SoundTouch/FIFOSamplePipe.h
@@ -83,7 +83,7 @@
this->putSamples(other.ptrBegin(), oNumSamples);
other.receiveSamples(oNumSamples);
- };
+ }
/// Output samples from beginning of the sample buffer. Copies requested samples to
/// output buffer and removes them from the sample buffer. If there are less than
--- a/src/in_2sf/desmume/metaspu/SoundTouch/STTypes.h
+++ b/src/in_2sf/desmume/metaspu/SoundTouch/STTypes.h
@@ -48,7 +48,7 @@
//#undef SOUNDTOUCH_INTEGER_SAMPLES
//#undef SOUNDTOUCH_FLOAT_SAMPLES
-#if !(SOUNDTOUCH_INTEGER_SAMPLES || SOUNDTOUCH_FLOAT_SAMPLES)
+#if !defined(SOUNDTOUCH_INTEGER_SAMPLES) || !defined(SOUNDTOUCH_FLOAT_SAMPLES)
/// Choose either 32bit floating point or 16bit integer sampletype
/// by choosing one of the following defines, unless this selection
/// has already been done in some other file.
@@ -67,7 +67,7 @@
# define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples
#endif
-#if (_M_IX86 || __i386__ || __x86_64__ || _M_X64)
+#if defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(_M_X64)
/// Define this to allow X86-specific assembler/intrinsic optimizations.
/// Notice that library contains also usual C++ versions of each of these
/// these routines, so if you're having difficulties getting the optimized
--- a/src/in_2sf/desmume/metaspu/metaspu.h
+++ b/src/in_2sf/desmume/metaspu/metaspu.h
@@ -27,6 +27,8 @@
class ISynchronizingAudioBuffer
{
public:
+ virtual ~ISynchronizingAudioBuffer() { }
+
virtual void enqueue_samples(int16_t *buf, int samples_provided) = 0;
// returns the number of samples actually supplied, which may not match the number requested
--- a/src/in_2sf/desmume/utils/AsmJit/base/codegen.h
+++ b/src/in_2sf/desmume/utils/AsmJit/base/codegen.h
@@ -263,7 +263,7 @@
uint32_t instOptions = _instOptions;
_instOptions = 0;
return instOptions;
- };
+ }
//! Set options of the next instruction.
ASMJIT_INLINE void setInstOptions(uint32_t instOptions) {
--- a/src/in_2sf/desmume/utils/AsmJit/base/vmem.cpp
+++ b/src/in_2sf/desmume/utils/AsmJit/base/vmem.cpp
@@ -226,7 +226,6 @@
// ============================================================================
#define M_DIV(x, y) ((x) / (y))
-#define M_MOD(x, y) ((x) % (y))
//! \internal
enum {
--- a/src/in_2sf/desmume/utils/AsmJit/x86/x86assembler.h
+++ b/src/in_2sf/desmume/utils/AsmJit/x86/x86assembler.h
@@ -946,7 +946,7 @@
INST_2x(mov, kX86InstIdMov, X86SegReg, X86Mem)
//! Move (AL|AX|EAX|RAX <- absolute address in immediate).
- INST_2x_(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm, o0.getRegIndex() == 0);
+ INST_2x_(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm, o0.getRegIndex() == 0)
//! \overload
ASMJIT_INLINE Error mov_ptr(const X86GpReg& o0, Ptr o1) {
ASMJIT_ASSERT(o0.getRegIndex() == 0);
@@ -954,7 +954,7 @@
}
//! Move (absolute address in immediate <- AL|AX|EAX|RAX).
- INST_2x_(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg, o1.getRegIndex() == 0);
+ INST_2x_(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg, o1.getRegIndex() == 0)
//! \overload
ASMJIT_INLINE Error mov_ptr(Ptr o0, const X86GpReg& o1) {
ASMJIT_ASSERT(o1.getRegIndex() == 0);
@@ -962,9 +962,9 @@
}
//! Move data after dwapping bytes (SSE3 - Atom).
- INST_2x_(movbe, kX86InstIdMovbe, X86GpReg, X86Mem, !o0.isGpb());
- //! \overload
- INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpReg, !o1.isGpb());
+ INST_2x_(movbe, kX86InstIdMovbe, X86GpReg, X86Mem, !o0.isGpb())
+ //! \overload
+ INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpReg, !o1.isGpb())
//! Move BYTE from DS:[ESI/RSI] to ES:[EDI/RDI].
INST_0x(movsb, kX86InstIdMovsB)
@@ -1027,7 +1027,7 @@
//! Pop a segment register from the stack.
//!
//! \note There is no instruction to pop a cs segment register.
- INST_1x_(pop, kX86InstIdPop, X86SegReg, o0.getRegIndex() != kX86SegCs);
+ INST_1x_(pop, kX86InstIdPop, X86SegReg, o0.getRegIndex() != kX86SegCs)
//! Pop all Gp registers - EDI|ESI|EBP|Ign|EBX|EDX|ECX|EAX (X86 Only).
INST_0x(popa, kX86InstIdPopa)
--- a/src/in_2sf/desmume/utils/AsmJit/x86/x86compiler.h
+++ b/src/in_2sf/desmume/utils/AsmJit/x86/x86compiler.h
@@ -2941,7 +2941,7 @@
INST_2x(mov, kX86InstIdMov, X86SegReg, X86Mem)
//! Move (AL|AX|EAX|RAX <- absolute address in immediate).
- INST_2x(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm);
+ INST_2x(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm)
//! \overload
ASMJIT_INLINE InstNode* mov_ptr(const X86GpReg& o0, Ptr o1) {
ASMJIT_ASSERT(o0.getRegIndex() == 0);
@@ -2949,7 +2949,7 @@
}
//! Move (absolute address in immediate <- AL|AX|EAX|RAX).
- INST_2x(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg);
+ INST_2x(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg)
//! \overload
ASMJIT_INLINE InstNode* mov_ptr(Ptr o0, const X86GpReg& o1) {
ASMJIT_ASSERT(o1.getRegIndex() == 0);
@@ -2957,9 +2957,9 @@
}
//! Move data after swapping bytes (SSE3 - Atom).
- INST_2x_(movbe, kX86InstIdMovbe, X86GpVar, X86Mem, !o0.isGpb());
- //! \overload
- INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpVar, !o1.isGpb());
+ INST_2x_(movbe, kX86InstIdMovbe, X86GpVar, X86Mem, !o0.isGpb())
+ //! \overload
+ INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpVar, !o1.isGpb())
//! Load BYTE from DS:`o1` to ES:`o0`.
INST_2x(movsb, kX86InstIdMovsB, X86GpVar, X86GpVar)
@@ -5444,9 +5444,9 @@
// --------------------------------------------------------------------------
//! Packed QWORD to OWORD carry-less multiply (PCLMULQDQ).
- INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86XmmVar, Imm);
- //! \overload
- INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86Mem, Imm);
+ INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86XmmVar, Imm)
+ //! \overload
+ INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86Mem, Imm)
#undef INST_0x
--- a/src/in_2sf/desmume/utils/AsmJit/x86/x86inst.cpp
+++ b/src/in_2sf/desmume/utils/AsmJit/x86/x86inst.cpp
@@ -32,7 +32,6 @@
#define G(_Group_) kX86InstGroup##_Group_
#define F(_Flags_) kX86InstFlag##_Flags_
#define O(_Op_) kX86InstOp##_Op_
-#define E(_Flags_) 0
#define U 0
#define L kX86InstOpCode_L_True
@@ -48,22 +47,17 @@
#define O_660F38(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_0F38 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_660F3A(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_0F3A | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_9B0000(_OpCode_, _R_) (kX86InstOpCode_PP_9B | kX86InstOpCode_MM_00 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
-#define O_F20000(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_00 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_F20F00(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_0F | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_F20F38(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_0F38 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_F20F3A(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_0F3A | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_F30000(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_00 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_F30F00(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_0F | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_F30F38(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_0F38 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
-#define O_F30F3A(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_0F3A | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
-
-#define O_00_M03(_OpCode_, _R_) (kX86InstOpCode_PP_00 | kX86InstOpCode_MM_00011| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
+
#define O_00_M08(_OpCode_, _R_) (kX86InstOpCode_PP_00 | kX86InstOpCode_MM_01000| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_00_M09(_OpCode_, _R_) (kX86InstOpCode_PP_00 | kX86InstOpCode_MM_01001| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_66_M03(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_00011| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
-#define O_66_M08(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_01000| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
-#define O_66_M09(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_01001| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_00_X(_OpCode_, _R_) (kX86InstOpCode_PP_00 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
#define O_9B_X(_OpCode_, _R_) (kX86InstOpCode_PP_9B | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
@@ -4632,22 +4626,17 @@
#undef O_00_X
#undef O_9B_X
-#undef O_66_M09
-#undef O_66_M08
#undef O_66_M03
#undef O_00_M09
#undef O_00_M08
-#undef O_00_M03
-
-#undef O_F30F3A
+
#undef O_F30F38
#undef O_F30F00
#undef O_F30000
#undef O_F20F3A
#undef O_F20F38
#undef O_F20F00
-#undef O_F20000
#undef O_9B0000
#undef O_660F3A
#undef O_660F38
--- a/src/in_2sf/desmume/utils/dlditool.cpp
+++ b/src/in_2sf/desmume/utils/dlditool.cpp
@@ -76,21 +76,10 @@
typedef int32_t addr_t;
typedef unsigned char data_t;
-#define FEATURE_MEDIUM_CANREAD 0x00000001
-#define FEATURE_MEDIUM_CANWRITE 0x00000002
-#define FEATURE_SLOT_GBA 0x00000010
-#define FEATURE_SLOT_NDS 0x00000020
-
-#define MAGIC_TOKEN 0xBF8DA5ED
-
#define FIX_ALL 0x01
#define FIX_GLUE 0x02
#define FIX_GOT 0x04
#define FIX_BSS 0x08
-
-#define DLDI_VERSION 1
-
-#define EXIT_NO_DLDI_SECTION 2
enum DldiOffsets
{
@@ -291,7 +280,7 @@
// Time: 6/14/2010 9:38 PM
// Orig. Offset: 0 / 0x00000000
// Length: 1876 / 0x00000754 (bytes)
-data_t mpcf_dldi[] =
+static data_t mpcf_dldi[] =
{
0xED, 0xA5, 0x8D, 0xBF, 0x20, 0x43, 0x68, 0x69, 0x73, 0x68, 0x6D, 0x00, 0x01, 0x0B, 0x0C, 0x00,
0x47, 0x42, 0x41, 0x20, 0x4D, 0x6F, 0x76, 0x69, 0x65, 0x20, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72,
--- a/src/in_2sf/desmume/version.cpp
+++ b/src/in_2sf/desmume/version.cpp
@@ -17,19 +17,6 @@
#include "version.h"
#include "types.h"
-
-// Helper macros to convert numerics to strings
-#ifdef _MSC_VER
-// re: http://72.14.203.104/search?q=cache:HG-okth5NGkJ:mail.python.org/pipermail/python-checkins/2002-November/030704.html+_msc_ver+compiler+version+string&hl=en&gl=us&ct=clnk&cd=5
-# define _Py_STRINGIZE(X) _Py_STRINGIZE1((X))
-# define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X
-# define _Py_STRINGIZE2(X) #X
-
-# define TOSTRING(X) _Py_STRINGIZE(X) // Alias _Py_STRINGIZE so that we have a common macro name
-#else
-# define STRINGIFY(x) #x
-# define TOSTRING(x) STRINGIFY(x)
-#endif
#define DESMUME_NAME "DeSmuME"
@@ -61,31 +48,6 @@
#define DESMUME_SUBVERSION_STRING " svn 4608"
-#ifdef __INTEL_COMPILER
-# define DESMUME_COMPILER " (Intel)"
-# define DESMUME_COMPILER_DETAIL " (Intel v" TOSTRING(__INTEL_COMPILER) ")"
-#elif defined(_MSC_VER)
-# define DESMUME_COMPILER " (MSVC)"
-# define DESMUME_COMPILER_DETAIL " (MSVC v" TOSTRING(_MSC_VER) ")"
-#elif defined(__clang__)
-# define DESMUME_COMPILER " (LLVM-Clang)"
-# define DESMUME_COMPILER_DETAIL " (LLVM-Clang v" TOSTRING(__clang_major__) "." TOSTRING(__clang_minor__) "." TOSTRING(__clang_patchlevel__) ")"
-#elif defined(__llvm__)
-# define DESMUME_COMPILER " (LLVM)"
-# define DESMUME_COMPILER_DETAIL " (LLVM)"
-#elif defined(__GNUC__) // Always make GCC the last check, since other compilers, such as Clang, may define __GNUC__ internally.
-# define DESMUME_COMPILER " (GCC)"
-
-# if defined(__GNUC_PATCHLEVEL__)
-# define DESMUME_COMPILER_DETAIL " (GCC v" TOSTRING(__GNUC__) "." TOSTRING(__GNUC_MINOR__) "." TOSTRING(__GNUC_PATCHLEVEL__) ")"
-# else
-# define DESMUME_COMPILER_DETAIL " (GCC v" TOSTRING(__GNUC__) "." TOSTRING(__GNUC_MINOR__) ")"
-# endif
-#else
-# define DESMUME_COMPILER ""
-# define DESMUME_COMPILER_DETAIL ""
-#endif
-
#ifdef HAVE_JIT
# define DESMUME_JIT "-JIT"
#else
--- a/src/in_gsf/vbam/apu/Blip_Buffer.cpp
+++ b/src/in_gsf/vbam/apu/Blip_Buffer.cpp
@@ -167,8 +167,7 @@
this->delta_factor = static_cast<int>(new_unit * (1L << blip_sample_bits) + 0.5);
}
-#if !BLIP_BUFFER_FAST
-
+#ifndef BLIP_BUFFER_FAST
Blip_Synth_::Blip_Synth_(short *p, int w) : impulses(p), width(w)
{
this->volume_unit_ = 0.0;
--- a/src/in_gsf/vbam/apu/Blip_Buffer.h
+++ b/src/in_gsf/vbam/apu/Blip_Buffer.h
@@ -120,7 +120,7 @@
// Affects size of Blip_Synth objects since they store the waveform directly.
enum
{
-#if BLIP_BUFFER_FAST
+#ifdef BLIP_BUFFER_FAST
BLIP_PHASE_BITS = 8
#else
BLIP_PHASE_BITS = 6
@@ -218,7 +218,7 @@
}
private:
-#if BLIP_BUFFER_FAST
+#ifdef BLIP_BUFFER_FAST
Blip_Synth_Fast_ impl;
#else
Blip_Synth_ impl;
@@ -316,7 +316,7 @@
auto buf = &blip_buf->buffer_[time >> BLIP_BUFFER_ACCURACY];
int phase = static_cast<int>(time >> (BLIP_BUFFER_ACCURACY - BLIP_PHASE_BITS) & (blip_res - 1));
-#if BLIP_BUFFER_FAST
+#ifdef BLIP_BUFFER_FAST
int32_t left = buf[0] + delta;
// Kind of crappy, but doing shift after multiply results in overflow.
--- a/src/in_gsf/vbam/gba/GBA.cpp
+++ b/src/in_gsf/vbam/gba/GBA.cpp
@@ -31,36 +31,36 @@
int cpuTotalTicks = 0;
-int lcdTicks = 208;
-uint8_t timerOnOffDelay = 0;
-uint16_t timer0Value = 0;
+static int lcdTicks = 208;
+static uint8_t timerOnOffDelay = 0;
+static uint16_t timer0Value = 0;
bool timer0On = false;
int timer0Ticks = 0;
-int timer0Reload = 0;
+static int timer0Reload = 0;
int timer0ClockReload = 0;
-uint16_t timer1Value = 0;
+static uint16_t timer1Value = 0;
bool timer1On = false;
int timer1Ticks = 0;
-int timer1Reload = 0;
+static int timer1Reload = 0;
int timer1ClockReload = 0;
-uint16_t timer2Value = 0;
+static uint16_t timer2Value = 0;
bool timer2On = false;
int timer2Ticks = 0;
-int timer2Reload = 0;
+static int timer2Reload = 0;
int timer2ClockReload = 0;
-uint16_t timer3Value = 0;
+static uint16_t timer3Value = 0;
bool timer3On = false;
int timer3Ticks = 0;
-int timer3Reload = 0;
+static int timer3Reload = 0;
int timer3ClockReload = 0;
-uint32_t dma0Source = 0;
-uint32_t dma0Dest = 0;
-uint32_t dma1Source = 0;
-uint32_t dma1Dest = 0;
-uint32_t dma2Source = 0;
-uint32_t dma2Dest = 0;
-uint32_t dma3Source = 0;
-uint32_t dma3Dest = 0;
+static uint32_t dma0Source = 0;
+static uint32_t dma0Dest = 0;
+static uint32_t dma1Source = 0;
+static uint32_t dma1Dest = 0;
+static uint32_t dma2Source = 0;
+static uint32_t dma2Dest = 0;
+static uint32_t dma3Source = 0;
+static uint32_t dma3Dest = 0;
static const int TIMER_TICKS[] = { 0, 6, 8, 10 };
@@ -83,14 +83,13 @@
//const u8 videoMemoryWait[16] =
// {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
uint8_t biosProtected[4];
#ifdef WORDS_BIGENDIAN
-bool cpuBiosSwapped = false;
+static bool cpuBiosSwapped = false;
#endif
-uint32_t myROM[] =
+static uint32_t myROM[] =
{
0xEA000006,
0xEA000093,
--- a/src/in_gsf/vbam/gba/bios.cpp
+++ b/src/in_gsf/vbam/gba/bios.cpp
@@ -6,7 +6,7 @@
#include "Globals.h"
#include "XSFCommon.h"
-int32_t sineTable[] =
+static int32_t sineTable[] =
{
0x0000, 0x0192, 0x0323, 0x04B5, 0x0645, 0x07D5, 0x0964, 0x0AF1,
0x0C7C, 0x0E05, 0x0F8C, 0x1111, 0x1294, 0x1413, 0x158F, 0x1708,
--- a/src/in_snsf/XSFPlayer_SNSF.cpp
+++ b/src/in_snsf/XSFPlayer_SNSF.cpp
@@ -1,7 +1,7 @@
/*
* xSF - SNSF Player
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
- * Last modification on 2014-09-24
+ * Last modification on 2014-09-25
*
* Based on a modified in_snsf by Caitsith2
* http://snsf.caitsith2.net/
@@ -58,8 +58,6 @@
return new XSFPlayer_SNSF(fn);
}
#endif
-
-volatile bool execute = false;
static struct
{
--- a/src/in_snsf/snes9x/apu/SNES_SPC.cpp
+++ b/src/in_snsf/snes9x/apu/SNES_SPC.cpp
@@ -19,7 +19,7 @@
//// Timers
-#if SPC_DISABLE_TEMPO
+#ifdef SPC_DISABLE_TEMPO
template<typename T> static inline T TIMER_DIV(SNES_SPC::Timer *t, const T &n) { return n >> t->prescaler; }
template<typename T> static inline T TIMER_MUL(SNES_SPC::Timer *t, const T &n) { return n << t->prescaler; }
#else
--- a/src/in_snsf/snes9x/apu/SNES_SPC_misc.cpp
+++ b/src/in_snsf/snes9x/apu/SNES_SPC_misc.cpp
@@ -79,7 +79,7 @@
static const int timer2_shift = 4; // 64 kHz
static const int other_shift = 3; // 8 kHz
-#if SPC_DISABLE_TEMPO
+#ifdef SPC_DISABLE_TEMPO
this->m.timers[2].prescaler = timer2_shift;
this->m.timers[1].prescaler = timer2_shift + other_shift;
this->m.timers[0].prescaler = timer2_shift + other_shift;
--- a/src/in_snsf/snes9x/apu/SPC_DSP.cpp
+++ b/src/in_snsf/snes9x/apu/SPC_DSP.cpp
@@ -731,7 +731,7 @@
PHASE(30) misc_30(); V(V3c, 0) echo_30(); \
PHASE(31) V(V4, 0) V(V1, 2)
-#if !SPC_DSP_CUSTOM_RUN
+#ifndef SPC_DSP_CUSTOM_RUN
void SPC_DSP::run(int clocks_remain)
{
assert(clocks_remain > 0);
--- a/src/in_snsf/snes9x/apu/blargg_endian.h
+++ b/src/in_snsf/snes9x/apu/blargg_endian.h
@@ -9,11 +9,17 @@
#if defined(_M_IX86) || defined(_M_IA64) || defined(__i486__) || defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
# define BLARGG_CPU_X86 1
# define BLARGG_CPU_CISC 1
+#else
+# define BLARGG_CPU_X86 0
+# define BLARGG_CPU_CISC 0
#endif
#if defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__) || defined(__powerc)
# define BLARGG_CPU_POWERPC 1
# define BLARGG_CPU_RISC 1
+#else
+# define BLARGG_CPU_POWERPC 0
+# define BLARGG_CPU_RISC 0
#endif
// BLARGG_BIG_ENDIAN, BLARGG_LITTLE_ENDIAN: Determined automatically, otherwise only
@@ -24,18 +30,22 @@
# include <endian.h>
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define BLARGG_LITTLE_ENDIAN 1
+# define BLARGG_BIG_ENDIAN 0
# elif __BYTE_ORDER == __BIG_ENDIAN
# define BLARGG_BIG_ENDIAN 1
+# define BLARGG_LITTLE_ENDIAN 0
# endif
# else
# if defined(LSB_FIRST) || defined(__LITTLE_ENDIAN__) || BLARGG_CPU_X86 || (defined(LITTLE_ENDIAN) && LITTLE_ENDIAN + 0 != 1234)
# define BLARGG_LITTLE_ENDIAN 1
-# endif
-# if defined(MSB_FIRST) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN) || defined (__sparc__) || BLARGG_CPU_POWERPC || (defined(BIG_ENDIAN) && BIG_ENDIAN + 0 != 4321)
+# define BLARGG_BIG_ENDIAN 0
+# elif defined(MSB_FIRST) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN) || defined(__sparc__) || BLARGG_CPU_POWERPC || (defined(BIG_ENDIAN) && BIG_ENDIAN + 0 != 4321)
# define BLARGG_BIG_ENDIAN 1
-# elif !defined (__mips__)
+# define BLARGG_LITTLE_ENDIAN 0
+# else
// No endian specified; assume little-endian, since it's most common
# define BLARGG_LITTLE_ENDIAN 1
+# define BLARGG_BIG_ENDIAN 0
# endif
# endif
#endif
--- a/src/in_xsf_framework/XSFTagList.cpp
+++ /dev/null
@@ -1,60 +1,1 @@
-/*
- * xSF Tag List
- * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
- * Last modification on 2013-03-21
- */
-#include <algorithm>
-#include "XSFTagList.h"
-
-eq_str XSFTagNameCompare::eqstr;
-
-bool XSFTagNameCompare::operator()(const std::pair<std::string, std::string> &v) const
-{
- return XSFTagNameCompare::eqstr(v.first, this->name);
-}
-
-std::vector<std::string> XSFTagList::GetAllKeys() const
-{
- std::vector<std::string> keys;
- for (XSFTagList::Tags::const_iterator curr = this->tags.begin(), end = this->tags.end(); curr != end; ++curr)
- keys.push_back(curr->first);
- return keys;
-}
-
-bool XSFTagList::Exists(const std::string &name) const
-{
- return std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name)) != this->tags.end();
-}
-
-std::string XSFTagList::operator[](const std::string &name) const
-{
- XSFTagList::Tags::const_iterator tag = std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name));
- if (tag == this->tags.end())
- return "";
- return tag->second;
-}
-
-std::string &XSFTagList::operator[](const std::string &name)
-{
- XSFTagList::Tags::iterator tag = std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name));
- if (tag == this->tags.end())
- {
- this->tags.push_back(std::make_pair(name, ""));
- return this->tags[this->tags.size() - 1].second;
- }
- return tag->second;
-}
-
-void XSFTagList::Remove(const std::string &name)
-{
- XSFTagList::Tags::iterator tag = std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name));
- if (tag != this->tags.end())
- this->tags.erase(tag);
-}
-
-void XSFTagList::Clear()
-{
- this->tags.clear();
-}
-
--- a/src/in_xsf_framework/XSFTagList.h
+++ /dev/null
@@ -1,39 +1,1 @@
-/*
- * xSF Tag List
- * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
- * Last modification on 2013-03-21
- */
-#ifndef XSFTAGLIST_H
-#define XSFTAGLIST_H
-
-#include <utility>
-#include <vector>
-#include "eqstr.h"
-
-struct XSFTagNameCompare
-{
- XSFTagNameCompare(const std::string &Name) : name(Name) { }
- bool operator()(const std::pair<std::string, std::string> &v) const;
-private:
- static eq_str eqstr;
- std::string name;
-};
-
-class XSFTagList
-{
- typedef std::vector<std::pair<std::string, std::string> > Tags;
-
- Tags tags;
-public:
- XSFTagList() : tags() { }
- std::vector<std::string> GetAllKeys() const;
- bool Exists(const std::string &name) const;
- std::string operator[](const std::string &name) const;
- std::string &operator[](const std::string &name);
- void Remove(const std::string &name);
- void Clear();
-};
-
-#endif
-
--- a/src/in_xsf_framework/codecvt.h
+++ b/src/in_xsf_framework/codecvt.h
@@ -1184,12 +1184,12 @@
return this->do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- int encoding() const throw()
+ int encoding() const noexcept
{
return this->do_encoding();
}
- bool always_noconv() const throw()
+ bool always_noconv() const noexcept
{
return this->do_always_noconv();
}
@@ -1199,7 +1199,7 @@
return this->do_length(__st, __frm, __end, __mx);
}
- int max_length() const throw()
+ int max_length() const noexcept
{
return this->do_max_length();
}
@@ -1242,15 +1242,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx);
}
- virtual int do_max_length() const throw() { return 4; }
+ virtual int do_max_length() const noexcept { return 4; }
};
template<> class codecvt<char32_t, char, mbstate_t> : public locale::facet, public codecvt_base
@@ -1277,12 +1277,12 @@
return this->do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
}
- int encoding() const throw()
+ int encoding() const noexcept
{
return this->do_encoding();
}
- bool always_noconv() const throw()
+ bool always_noconv() const noexcept
{
return this->do_always_noconv();
}
@@ -1292,7 +1292,7 @@
return this->do_length(__st, __frm, __end, __mx);
}
- int max_length() const throw()
+ int max_length() const noexcept
{
return this->do_max_length();
}
@@ -1335,15 +1335,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_ucs4_length(_frm, _frm_end, mx);
}
- virtual int do_max_length() const throw() { return 4; }
+ virtual int do_max_length() const noexcept { return 4; }
};
template<class _Elem> class __codecvt_utf8;
@@ -1412,15 +1412,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 7;
@@ -1470,15 +1470,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_ucs2_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 6;
@@ -1528,15 +1528,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 7;
@@ -1596,15 +1596,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf16be_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 6;
@@ -1654,15 +1654,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf16le_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 6;
@@ -1712,15 +1712,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf16be_to_ucs2_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 4;
@@ -1770,15 +1770,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf16le_to_ucs2_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 4;
@@ -1828,15 +1828,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf16be_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 6;
@@ -1886,15 +1886,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf16le_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 6;
@@ -1954,15 +1954,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 7;
@@ -2012,15 +2012,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 7;
@@ -2070,15 +2070,15 @@
to_nxt = to;
return noconv;
}
- virtual int do_encoding() const throw() { return 0; }
- virtual bool do_always_noconv() const throw() { return false; }
+ virtual int do_encoding() const noexcept { return 0; }
+ virtual bool do_always_noconv() const noexcept { return false; }
virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
{
auto _frm = reinterpret_cast<const uint8_t *>(frm);
auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
}
- virtual int do_max_length() const throw()
+ virtual int do_max_length() const noexcept
{
if (this->_Mode_ & consume_header)
return 7;
@@ -2094,6 +2094,6 @@
~codecvt_utf8_utf16() {}
};
-};
+}
#endif
--- a/src/in_xsf_framework/fstream_wfopen.h
+++ b/src/in_xsf_framework/fstream_wfopen.h
@@ -53,7 +53,7 @@
if (!this->__file_)
{
__rt = this;
- const char *__mdstr;
+ const char *__mdstr = nullptr;
switch (__mode & ~std::ios_base::ate)
{
case std::ios_base::out:
@@ -130,7 +130,7 @@
if (!this->__file_)
{
__rt = this;
- const wchar_t *__mdstr;
+ const wchar_t *__mdstr = nullptr;
switch (__mode & ~std::ios_base::ate)
{
case std::ios_base::out:
--- a/src/in_xsf_framework/in_xsf.cpp
+++ b/src/in_xsf_framework/in_xsf.cpp
@@ -1,7 +1,7 @@
/*
* xSF - Winamp plugin
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
- * Last modification on 2014-09-24
+ * Last modification on 2014-09-25
*
* Partially based on the vio*sf framework
*/
@@ -19,15 +19,15 @@
#endif
extern In_Module inMod;
-const XSFFile *xSFFile = nullptr;
+static const XSFFile *xSFFile = nullptr;
XSFFile *xSFFileInInfo = nullptr;
-XSFPlayer *xSFPlayer = nullptr;
+static XSFPlayer *xSFPlayer = nullptr;
XSFConfig *xSFConfig = nullptr;
-bool paused;
-int seek_needed;
-double decode_pos_ms;
-HANDLE thread_handle = INVALID_HANDLE_VALUE;
-bool killThread = false;
+static bool paused;
+static int seek_needed;
+static double decode_pos_ms;
+static HANDLE thread_handle = INVALID_HANDLE_VALUE;
+static bool killThread = false;
static const unsigned NumChannels = 2;
static const unsigned BitsPerSample = 16;
@@ -374,7 +374,7 @@
}
}
-std::unique_ptr<XSFFile> extendedXSFFile;
+static std::unique_ptr<XSFFile> extendedXSFFile;
int wrapperWinampSetExtendedFileInfo(const char *data, const wchar_t *val)
{
@@ -467,7 +467,7 @@
}
}
-int extendedSeekNeeded = -1;
+static int extendedSeekNeeded = -1;
extern "C" __declspec(dllexport) size_t winampGetExtendedRead_getData(intptr_t handle, char *dest, size_t len, int *killswitch)
{
--- a/src/in_xsf_framework/wstring_convert.h
+++ b/src/in_xsf_framework/wstring_convert.h
@@ -175,10 +175,10 @@
return this->__byte_err_string_;
}
- size_t converted() const throw() { return this->__cvtcount_; }
+ size_t converted() const noexcept { return this->__cvtcount_; }
state_type state() const { return this->__cvtstate_; }
};
-};
+}
#endif