Browse code

* 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).

Naram Qashat authored on 2014/09/25 12:28:21
Showing 33 changed files
... ...
@@ -19,12 +19,12 @@ DLLS:=	$(sort $(addsuffix .dll,$(DLLS)))
19 19
 
20 20
 COMPILER:=	$(shell $(CXX) -v 2>/dev/stdout)
21 21
 
22
-CPPFLAGS+=	-std=gnu++11 -I$(SRCDIR)in_xsf_framework -I/g/Code/Winamp\ SDK -DWINAMP_PLUGIN -DUNICODE_INPUT_PLUGIN
23
-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
22
+MY_CPPFLAGS=	$(CPPFLAGS) -std=gnu++11 -I$(SRCDIR)in_xsf_framework -I/g/Code/Winamp\ SDK -DWINAMP_PLUGIN -DUNICODE_INPUT_PLUGIN
23
+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
24 24
 ifeq (,$(findstring clang,$(COMPILER)))
25
-CXXFLAGS+=	-Wlogical-op
25
+MY_CXXFLAGS+=	-Wlogical-op
26 26
 endif
27
-LDFLAGS+=	-lz
27
+MY_LDFLAGS=	$(LDFLAGS) -lz
28 28
 
29 29
 DLL_SRCS_template=	$(1)_SRCS:=	$$(sort $$($(1)_SRCS))
30 30
 DLL_OBJS_template=	$(1)_OBJS:=	$$(subst $(SRCDIR),,$$($(1)_SRCS:%.cpp=%.o))
... ...
@@ -42,24 +42,24 @@ DEPS:=	$(OBJS:%.o=%.d)
42 42
 .SUFFIXES: .cpp .o .d .a .dll
43 43
 
44 44
 all: $(DLLS)
45
-debug: CXXFLAGS+=	-g -D_DEBUG
45
+debug: MY_CXXFLAGS+=	-g -D_DEBUG
46 46
 debug: all
47 47
 
48 48
 define DLL_template
49 49
 $(1): $$(FRAMEWORK_OBJS) $$($$(basename $$(notdir $(1)))_OBJS)
50 50
 	@echo "Linking $$@..."
51
-	@$$(CXX) -shared -fPIC $$(CXXFLAGS) -o $$@ $$^ $$(LDFLAGS)
51
+	@$$(CXX) -shared -fPIC $$(MY_CXXFLAGS) -o $$@ $$^ $$(MY_LDFLAGS)
52 52
 endef
53 53
 define SRC_template
54 54
 $$(subst $(SRCDIR),,$(1:%.cpp=%.o)): $(1)
55 55
 	@echo "Compiling $$<..."
56
-	@$$(CXX) $$(CXXFLAGS) -o $$(subst $(SRCDIR),,$$@) -c $$<
56
+	@$$(CXX) $$(MY_CXXFLAGS) -o $$(subst $(SRCDIR),,$$@) -c $$<
57 57
 endef
58 58
 define DEP_template
59 59
 $$(subst $(SRCDIR),,$(1:%.cpp=%.d)): $(1)
60 60
 	@echo "Calculating depends for $$<..."
61 61
 	-@mkdir -p $$(@D)
62
-	@$$(CXX) $$(CPPFLAGS) -MM -MF $$(subst $(SRCDIR),,$$@).tmp $$<
62
+	@$$(CXX) $$(MY_CPPFLAGS) -MM -MF $$(subst $(SRCDIR),,$$@).tmp $$<
63 63
 	@sed 's,$$(notdir $$*)\.o[ :]*,$$(subst /,\/,$$*).o $$(subst /,\/,$$@): ,g' < $$(subst $(SRCDIR),,$$@).tmp > $$(subst $(SRCDIR),,$$@)
64 64
 	@rm $$(subst $(SRCDIR),,$$@).tmp
65 65
 endef
... ...
@@ -68,24 +68,24 @@ $(foreach dll,$(DLLS),$(eval $(call DLL_template,$(dll))))
68 68
 $(foreach src,$(SRCS),$(eval $(call SRC_template,$(src))))
69 69
 $(foreach src,$(SRCS),$(eval $(call DEP_template,$(src))))
70 70
 
71
-$(subst $(SRCDIR),,$(in_2sf_SRCS:%.cpp=%.d)): CPPFLAGS+=	-msse
72
-$(in_2sf_OBJS): CXXFLAGS+=	-msse -DHAVE_LIBZ
71
+$(subst $(SRCDIR),,$(in_2sf_SRCS:%.cpp=%.d)): MY_CPPFLAGS+=	-msse
72
+$(in_2sf_OBJS): MY_CXXFLAGS+=	-msse -DHAVE_LIBZ
73 73
 
74
-in_2sf/desmume/MMU.o: CXXFLAGS+=	-Wno-shadow
75
-in_2sf/desmume/utils/AsmJit/base/codegen.o: CXXFLAGS+=	-Wno-unused-value
76
-in_2sf/desmume/utils/AsmJit/base/runtime.o: CXXFLAGS+=	-Wno-unused-parameter
77
-in_2sf/desmume/utils/AsmJit/base/vmem.o: CXXFLAGS+=	-Wno-missing-field-initializers -Wno-unused-function
74
+in_2sf/desmume/MMU.o: MY_CXXFLAGS+=	-Wno-shadow
75
+in_2sf/desmume/utils/AsmJit/base/codegen.o: MY_CXXFLAGS+=	-Wno-unused-value
76
+in_2sf/desmume/utils/AsmJit/base/runtime.o: MY_CXXFLAGS+=	-Wno-unused-parameter
77
+in_2sf/desmume/utils/AsmJit/base/vmem.o: MY_CXXFLAGS+=	-Wno-missing-field-initializers -Wno-unused-function
78 78
 ifneq (,$(findstring clang,$(COMPILER)))
79
-in_2sf/desmume/utils/AsmJit/base/vmem.o: CXXFLAGS+=	-Wno-missing-braces
79
+in_2sf/desmume/utils/AsmJit/base/vmem.o: MY_CXXFLAGS+=	-Wno-missing-braces
80 80
 endif
81
-in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: CXXFLAGS+=	-Wno-unused-variable
81
+in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: MY_CXXFLAGS+=	-Wno-unused-variable
82 82
 ifneq (,$(findstring clang,$(COMPILER)))
83
-in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: CXXFLAGS+=	-Wno-missing-braces
83
+in_2sf/desmume/utils/AsmJit/x86/x86assembler.o: MY_CXXFLAGS+=	-Wno-missing-braces
84 84
 endif
85
-in_2sf/desmume/utils/AsmJit/x86/x86context.o: CXXFLAGS+=	-Wno-unused-parameter -Wno-unused-value -Wno-unused-variable
86
-in_gsf/vbam/gba/GBA-arm.o: CXXFLAGS+=	-Wno-unused-variable
85
+in_2sf/desmume/utils/AsmJit/x86/x86context.o: MY_CXXFLAGS+=	-Wno-unused-parameter -Wno-unused-value -Wno-unused-variable
86
+in_gsf/vbam/gba/GBA-arm.o: MY_CXXFLAGS+=	-Wno-unused-variable
87 87
 ifeq (,$(findstring clang,$(COMPILER)))
88
-in_gsf/vbam/gba/GBA-arm.o: CXXFLAGS+=	-Wno-unused-but-set-variable
88
+in_gsf/vbam/gba/GBA-arm.o: MY_CXXFLAGS+=	-Wno-unused-but-set-variable
89 89
 endif
90 90
 
91 91
 clean:
... ...
@@ -174,14 +174,14 @@ uint32_t MMU_struct::MMU_MASK[2][256] =
174 174
 static const uint8_t VRAM_PAGE_UNMAPPED = 41;
175 175
 
176 176
 static const unsigned VRAM_LCDC_PAGES = 41;
177
-uint8_t vram_lcdc_map[VRAM_LCDC_PAGES];
177
+static uint8_t vram_lcdc_map[VRAM_LCDC_PAGES];
178 178
 
179 179
 // in the range of 0x06000000 - 0x06800000 in 16KB pages (the ARM9 vram mappable area)
180 180
 // this maps to 16KB pages in the LCDC buffer which is what will actually contain the data
181 181
 uint8_t vram_arm9_map[VRAM_ARM9_PAGES];
182 182
 
183 183
 // this chooses which banks are mapped in the 128K banks starting at 0x06000000 in ARM7
184
-uint8_t vram_arm7_map[2];
184
+static uint8_t vram_arm7_map[2];
185 185
 
186 186
 struct TVramBankInfo
187 187
 {
... ...
@@ -1444,9 +1444,6 @@ template<int PROCNUM> void DmaController::doCopy()
1444 1444
 			break;
1445 1445
 		case EDMADestinationUpdate_IncrementReload:
1446 1446
 			dstinc = sz;
1447
-			break;
1448
-		default:
1449
-			bogarted = true;
1450 1447
 	}
1451 1448
 	switch (this->sar)
1452 1449
 	{
... ...
@@ -1460,7 +1457,6 @@ template<int PROCNUM> void DmaController::doCopy()
1460 1457
 			srcinc = 0;
1461 1458
 			break;
1462 1459
 		case EDMASourceUpdate_Invalid:
1463
-		default:
1464 1460
 			bogarted = true;
1465 1461
 	}
1466 1462
 
... ...
@@ -82,6 +82,8 @@ enum EDMADestinationUpdate
82 82
 class TRegister_32
83 83
 {
84 84
 public:
85
+	virtual ~TRegister_32() { }
86
+
85 87
 	virtual uint32_t read32() = 0;
86 88
 	virtual void write32(uint32_t val) = 0;
87 89
 	void write(int size, uint32_t adr, uint32_t val)
... ...
@@ -131,6 +133,7 @@ struct TGXSTAT : public TRegister_32
131 133
 		this->fifo_empty = true;
132 134
 		this->fifo_low = false;
133 135
 	}
136
+	virtual ~TGXSTAT() { }
134 137
 	uint8_t tb; // test busy
135 138
 	uint8_t tr; // test result
136 139
 	uint8_t se; // stack error
... ...
@@ -238,6 +241,7 @@ public:
238 241
 		DmaController *controller;
239 242
 		uint32_t *const ptr;
240 243
 		AddressRegister(uint32_t *_ptr) : ptr(_ptr) { }
244
+		virtual ~AddressRegister() { }
241 245
 		virtual uint32_t read32()
242 246
 		{
243 247
 			return *this->ptr;
... ...
@@ -254,6 +258,7 @@ public:
254 258
 		// we pass in a pointer to the controller here so we can alert it if anything changes
255 259
 		DmaController *controller;
256 260
 		ControlRegister() { }
261
+		virtual ~ControlRegister() { }
257 262
 		virtual uint32_t read32()
258 263
 		{
259 264
 			return this->controller->read32();
... ...
@@ -36,9 +36,7 @@ TCommonSettings CommonSettings;
36 36
 
37 37
 GameInfo gameInfo;
38 38
 NDSSystem nds;
39
-std::unique_ptr<CFIRMWARE> firmware;
40
-
41
-bool singleStep;
39
+static std::unique_ptr<CFIRMWARE> firmware;
42 40
 
43 41
 namespace DLDI
44 42
 {
... ...
@@ -162,7 +160,7 @@ enum ESI_DISPCNT
162 160
 };
163 161
 
164 162
 uint64_t nds_timer;
165
-uint64_t nds_arm9_timer, nds_arm7_timer;
163
+static uint64_t nds_arm9_timer, nds_arm7_timer;
166 164
 
167 165
 struct TSequenceItem
168 166
 {
... ...
@@ -170,6 +168,8 @@ struct TSequenceItem
170 168
 	uint32_t param;
171 169
 	bool enabled;
172 170
 
171
+	virtual ~TSequenceItem() { }
172
+
173 173
 	virtual bool isTriggered() const
174 174
 	{
175 175
 		return this->enabled && nds_timer >= this->timestamp;
... ...
@@ -330,7 +330,7 @@ struct TSequenceItem_sqrtunit : public TSequenceItem
330 330
 	}
331 331
 };
332 332
 
333
-struct Sequencer
333
+static struct Sequencer
334 334
 {
335 335
 	bool nds_vblankEnded;
336 336
 	bool reschedule;
... ...
@@ -1010,7 +1010,6 @@ static void PrepareBiosARM9()
1010 1010
 
1011 1011
 void NDS_Reset()
1012 1012
 {
1013
-	singleStep = false;
1014 1013
 	bool fw_success = false;
1015 1014
 	auto header = NDS_getROMHeader();
1016 1015
 
... ...
@@ -800,13 +800,11 @@ static inline int32_t Interpolate(int32_t a, int32_t b, double ratio, SPUInterpo
800 800
 			// ratio2 = (1 - cos(ratio * M_PI)) / 2
801 801
 			// sampleI = sampleA * (1 - ratio2) + sampleB * ratio2
802 802
 			return s32floor((cos_lut[static_cast<unsigned>(ratio * COSINE_INTERPOLATION_RESOLUTION)] * (sampleB - sampleA)) + sampleA);
803
-			break;
804 803
 
805 804
 		case SPUInterpolation_Linear:
806 805
 			// Linear Interpolation Formula:
807 806
 			// sampleI = sampleA * (1 - ratio) + sampleB * ratio
808 807
 			return s32floor((ratio * (sampleB - sampleA)) + sampleA);
809
-			break;
810 808
 
811 809
 		default:
812 810
 			break;
... ...
@@ -1128,8 +1126,6 @@ static inline void _SPU_ChanUpdate(bool actuallyMix, SPU_struct *const SPU, chan
1128 1126
 		case SPUInterpolation_Cosine:
1129 1127
 			__SPU_ChanUpdate(actuallyMix, SPU, chan, SPUInterpolation_Cosine);
1130 1128
 			break;
1131
-		default:
1132
-			assert(false);
1133 1129
 	}
1134 1130
 }
1135 1131
 
... ...
@@ -41,7 +41,7 @@ inline int32_t spumuldiv7(int32_t val, uint8_t multiplier)
41 41
 
42 42
 enum SPUInterpolationMode
43 43
 {
44
-	SPUInterpolation_None ,
44
+	SPUInterpolation_None,
45 45
 	SPUInterpolation_Linear,
46 46
 	SPUInterpolation_Cosine
47 47
 };
... ...
@@ -103,7 +103,6 @@ static uint32_t read32_GCDATAIN(uint8_t PROCNUM)
103 103
 				else
104 104
 					return 0;
105 105
 			}
106
-			break;
107 106
 
108 107
 		// Data read
109 108
 		case 0x00:
... ...
@@ -135,7 +134,6 @@ static uint32_t read32_GCDATAIN(uint8_t PROCNUM)
135 134
 
136 135
 				return T1ReadLong(MMU.CART_ROM, address);
137 136
 			}
138
-			break;
139 137
 		default:
140 138
 			return 0;
141 139
 	} //switch(card.command[0])
... ...
@@ -20,8 +20,8 @@
20 20
 #include "SndOut.h"
21 21
 
22 22
 //----------------
23
-int SndOutLatencyMS = 160;
24
-bool timeStretchDisabled = false;
23
+static const int SndOutLatencyMS = 160;
24
+static bool timeStretchDisabled = false;
25 25
 //----------------
26 26
 
27 27
 StereoOut32 StereoOut32::Empty;
... ...
@@ -83,7 +83,7 @@ public:
83 83
 
84 84
 		this->putSamples(other.ptrBegin(), oNumSamples);
85 85
 		other.receiveSamples(oNumSamples);
86
-	};
86
+	}
87 87
 
88 88
 	/// Output samples from beginning of the sample buffer. Copies requested samples to
89 89
 	/// output buffer and removes them from the sample buffer. If there are less than
... ...
@@ -48,7 +48,7 @@ namespace soundtouch
48 48
 //#undef SOUNDTOUCH_INTEGER_SAMPLES
49 49
 //#undef SOUNDTOUCH_FLOAT_SAMPLES
50 50
 
51
-#if !(SOUNDTOUCH_INTEGER_SAMPLES || SOUNDTOUCH_FLOAT_SAMPLES)
51
+#if !defined(SOUNDTOUCH_INTEGER_SAMPLES) || !defined(SOUNDTOUCH_FLOAT_SAMPLES)
52 52
 /// Choose either 32bit floating point or 16bit integer sampletype
53 53
 /// by choosing one of the following defines, unless this selection
54 54
 /// has already been done in some other file.
... ...
@@ -67,7 +67,7 @@ namespace soundtouch
67 67
 # define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples
68 68
 #endif
69 69
 
70
-#if (_M_IX86 || __i386__ || __x86_64__ || _M_X64)
70
+#if defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(_M_X64)
71 71
 /// Define this to allow X86-specific assembler/intrinsic optimizations.
72 72
 /// Notice that library contains also usual C++ versions of each of these
73 73
 /// these routines, so if you're having difficulties getting the optimized
... ...
@@ -27,6 +27,8 @@
27 27
 class ISynchronizingAudioBuffer
28 28
 {
29 29
 public:
30
+	virtual ~ISynchronizingAudioBuffer() { }
31
+
30 32
 	virtual void enqueue_samples(int16_t *buf, int samples_provided) = 0;
31 33
 
32 34
 	// returns the number of samples actually supplied, which may not match the number requested
... ...
@@ -263,7 +263,7 @@ struct ASMJIT_VCLASS CodeGen {
263 263
     uint32_t instOptions = _instOptions;
264 264
     _instOptions = 0;
265 265
     return instOptions;
266
-  };
266
+  }
267 267
 
268 268
   //! Set options of the next instruction.
269 269
   ASMJIT_INLINE void setInstOptions(uint32_t instOptions) {
... ...
@@ -226,7 +226,6 @@ Error VMemUtil::release(void* addr, size_t length) {
226 226
 // ============================================================================
227 227
 
228 228
 #define M_DIV(x, y) ((x) / (y))
229
-#define M_MOD(x, y) ((x) % (y))
230 229
 
231 230
 //! \internal
232 231
 enum {
... ...
@@ -946,7 +946,7 @@ struct ASMJIT_VCLASS X86Assembler : public Assembler {
946 946
   INST_2x(mov, kX86InstIdMov, X86SegReg, X86Mem)
947 947
 
948 948
   //! Move (AL|AX|EAX|RAX <- absolute address in immediate).
949
-  INST_2x_(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm, o0.getRegIndex() == 0);
949
+  INST_2x_(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm, o0.getRegIndex() == 0)
950 950
   //! \overload
951 951
   ASMJIT_INLINE Error mov_ptr(const X86GpReg& o0, Ptr o1) {
952 952
     ASMJIT_ASSERT(o0.getRegIndex() == 0);
... ...
@@ -954,7 +954,7 @@ struct ASMJIT_VCLASS X86Assembler : public Assembler {
954 954
   }
955 955
 
956 956
   //! Move (absolute address in immediate <- AL|AX|EAX|RAX).
957
-  INST_2x_(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg, o1.getRegIndex() == 0);
957
+  INST_2x_(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg, o1.getRegIndex() == 0)
958 958
   //! \overload
959 959
   ASMJIT_INLINE Error mov_ptr(Ptr o0, const X86GpReg& o1) {
960 960
     ASMJIT_ASSERT(o1.getRegIndex() == 0);
... ...
@@ -962,9 +962,9 @@ struct ASMJIT_VCLASS X86Assembler : public Assembler {
962 962
   }
963 963
 
964 964
   //! Move data after dwapping bytes (SSE3 - Atom).
965
-  INST_2x_(movbe, kX86InstIdMovbe, X86GpReg, X86Mem, !o0.isGpb());
965
+  INST_2x_(movbe, kX86InstIdMovbe, X86GpReg, X86Mem, !o0.isGpb())
966 966
   //! \overload
967
-  INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpReg, !o1.isGpb());
967
+  INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpReg, !o1.isGpb())
968 968
 
969 969
   //! Move BYTE from DS:[ESI/RSI] to ES:[EDI/RDI].
970 970
   INST_0x(movsb, kX86InstIdMovsB)
... ...
@@ -1027,7 +1027,7 @@ struct ASMJIT_VCLASS X86Assembler : public Assembler {
1027 1027
   //! Pop a segment register from the stack.
1028 1028
   //!
1029 1029
   //! \note There is no instruction to pop a cs segment register.
1030
-  INST_1x_(pop, kX86InstIdPop, X86SegReg, o0.getRegIndex() != kX86SegCs);
1030
+  INST_1x_(pop, kX86InstIdPop, X86SegReg, o0.getRegIndex() != kX86SegCs)
1031 1031
 
1032 1032
   //! Pop all Gp registers - EDI|ESI|EBP|Ign|EBX|EDX|ECX|EAX (X86 Only).
1033 1033
   INST_0x(popa, kX86InstIdPopa)
... ...
@@ -2941,7 +2941,7 @@ struct ASMJIT_VCLASS X86Compiler : public Compiler {
2941 2941
   INST_2x(mov, kX86InstIdMov, X86SegReg, X86Mem)
2942 2942
 
2943 2943
   //! Move (AL|AX|EAX|RAX <- absolute address in immediate).
2944
-  INST_2x(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm);
2944
+  INST_2x(mov_ptr, kX86InstIdMovPtr, X86GpReg, Imm)
2945 2945
   //! \overload
2946 2946
   ASMJIT_INLINE InstNode* mov_ptr(const X86GpReg& o0, Ptr o1) {
2947 2947
     ASMJIT_ASSERT(o0.getRegIndex() == 0);
... ...
@@ -2949,7 +2949,7 @@ struct ASMJIT_VCLASS X86Compiler : public Compiler {
2949 2949
   }
2950 2950
 
2951 2951
   //! Move (absolute address in immediate <- AL|AX|EAX|RAX).
2952
-  INST_2x(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg);
2952
+  INST_2x(mov_ptr, kX86InstIdMovPtr, Imm, X86GpReg)
2953 2953
   //! \overload
2954 2954
   ASMJIT_INLINE InstNode* mov_ptr(Ptr o0, const X86GpReg& o1) {
2955 2955
     ASMJIT_ASSERT(o1.getRegIndex() == 0);
... ...
@@ -2957,9 +2957,9 @@ struct ASMJIT_VCLASS X86Compiler : public Compiler {
2957 2957
   }
2958 2958
 
2959 2959
   //! Move data after swapping bytes (SSE3 - Atom).
2960
-  INST_2x_(movbe, kX86InstIdMovbe, X86GpVar, X86Mem, !o0.isGpb());
2960
+  INST_2x_(movbe, kX86InstIdMovbe, X86GpVar, X86Mem, !o0.isGpb())
2961 2961
   //! \overload
2962
-  INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpVar, !o1.isGpb());
2962
+  INST_2x_(movbe, kX86InstIdMovbe, X86Mem, X86GpVar, !o1.isGpb())
2963 2963
 
2964 2964
   //! Load BYTE from DS:`o1` to ES:`o0`.
2965 2965
   INST_2x(movsb, kX86InstIdMovsB, X86GpVar, X86GpVar)
... ...
@@ -5444,9 +5444,9 @@ struct ASMJIT_VCLASS X86Compiler : public Compiler {
5444 5444
   // --------------------------------------------------------------------------
5445 5445
 
5446 5446
   //! Packed QWORD to OWORD carry-less multiply (PCLMULQDQ).
5447
-  INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86XmmVar, Imm);
5447
+  INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86XmmVar, Imm)
5448 5448
   //! \overload
5449
-  INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86Mem, Imm);
5449
+  INST_3i(pclmulqdq, kX86InstIdPclmulqdq, X86XmmVar, X86Mem, Imm)
5450 5450
 
5451 5451
 #undef INST_0x
5452 5452
 
... ...
@@ -32,7 +32,6 @@ namespace asmjit {
32 32
 #define G(_Group_) kX86InstGroup##_Group_
33 33
 #define F(_Flags_) kX86InstFlag##_Flags_
34 34
 #define O(_Op_) kX86InstOp##_Op_
35
-#define E(_Flags_) 0
36 35
 
37 36
 #define U 0
38 37
 #define L kX86InstOpCode_L_True
... ...
@@ -48,22 +47,17 @@ namespace asmjit {
48 47
 #define O_660F38(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_0F38 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
49 48
 #define O_660F3A(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_0F3A | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
50 49
 #define O_9B0000(_OpCode_, _R_) (kX86InstOpCode_PP_9B | kX86InstOpCode_MM_00   | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
51
-#define O_F20000(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_00   | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
52 50
 #define O_F20F00(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_0F   | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
53 51
 #define O_F20F38(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_0F38 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
54 52
 #define O_F20F3A(_OpCode_, _R_) (kX86InstOpCode_PP_F2 | kX86InstOpCode_MM_0F3A | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
55 53
 #define O_F30000(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_00   | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
56 54
 #define O_F30F00(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_0F   | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
57 55
 #define O_F30F38(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_0F38 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
58
-#define O_F30F3A(_OpCode_, _R_) (kX86InstOpCode_PP_F3 | kX86InstOpCode_MM_0F3A | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
59 56
 
60
-#define O_00_M03(_OpCode_, _R_) (kX86InstOpCode_PP_00 | kX86InstOpCode_MM_00011| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
61 57
 #define O_00_M08(_OpCode_, _R_) (kX86InstOpCode_PP_00 | kX86InstOpCode_MM_01000| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
62 58
 #define O_00_M09(_OpCode_, _R_) (kX86InstOpCode_PP_00 | kX86InstOpCode_MM_01001| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
63 59
 
64 60
 #define O_66_M03(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_00011| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
65
-#define O_66_M08(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_01000| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
66
-#define O_66_M09(_OpCode_, _R_) (kX86InstOpCode_PP_66 | kX86InstOpCode_MM_01001| (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
67 61
 
68 62
 #define O_00_X(_OpCode_, _R_) (kX86InstOpCode_PP_00 | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
69 63
 #define O_9B_X(_OpCode_, _R_) (kX86InstOpCode_PP_9B | (0x##_OpCode_) | ((_R_) << kX86InstOpCode_O_Shift))
... ...
@@ -4632,22 +4626,17 @@ const X86InstInfo _x86InstInfo[] = {
4632 4626
 #undef O_00_X
4633 4627
 #undef O_9B_X
4634 4628
 
4635
-#undef O_66_M09
4636
-#undef O_66_M08
4637 4629
 #undef O_66_M03
4638 4630
 
4639 4631
 #undef O_00_M09
4640 4632
 #undef O_00_M08
4641
-#undef O_00_M03
4642 4633
 
4643
-#undef O_F30F3A
4644 4634
 #undef O_F30F38
4645 4635
 #undef O_F30F00
4646 4636
 #undef O_F30000
4647 4637
 #undef O_F20F3A
4648 4638
 #undef O_F20F38
4649 4639
 #undef O_F20F00
4650
-#undef O_F20000
4651 4640
 #undef O_9B0000
4652 4641
 #undef O_660F3A
4653 4642
 #undef O_660F38
... ...
@@ -76,22 +76,11 @@ namespace DLDI
76 76
 typedef int32_t addr_t;
77 77
 typedef unsigned char data_t;
78 78
 
79
-#define FEATURE_MEDIUM_CANREAD 0x00000001
80
-#define FEATURE_MEDIUM_CANWRITE 0x00000002
81
-#define FEATURE_SLOT_GBA 0x00000010
82
-#define FEATURE_SLOT_NDS 0x00000020
83
-
84
-#define MAGIC_TOKEN 0xBF8DA5ED
85
-
86 79
 #define FIX_ALL 0x01
87 80
 #define FIX_GLUE 0x02
88 81
 #define FIX_GOT 0x04
89 82
 #define FIX_BSS 0x08
90 83
 
91
-#define DLDI_VERSION 1
92
-
93
-#define EXIT_NO_DLDI_SECTION	2
94
-
95 84
 enum DldiOffsets
96 85
 {
97 86
 	DO_magicString = 0x00, // "\xED\xA5\x8D\xBF Chishm"
... ...
@@ -291,7 +280,7 @@ FILE *openDLDIFile(const char *argv0, char *dldiFileName )
291 280
 //         Time: 6/14/2010 9:38 PM
292 281
 // Orig. Offset: 0 / 0x00000000
293 282
 //       Length: 1876 / 0x00000754 (bytes)
294
-data_t mpcf_dldi[] =
283
+static data_t mpcf_dldi[] =
295 284
 {
296 285
     0xED, 0xA5, 0x8D, 0xBF, 0x20, 0x43, 0x68, 0x69, 0x73, 0x68, 0x6D, 0x00, 0x01, 0x0B, 0x0C, 0x00,
297 286
     0x47, 0x42, 0x41, 0x20, 0x4D, 0x6F, 0x76, 0x69, 0x65, 0x20, 0x50, 0x6C, 0x61, 0x79, 0x65, 0x72,
... ...
@@ -18,19 +18,6 @@
18 18
 #include "version.h"
19 19
 #include "types.h"
20 20
 
21
-// Helper macros to convert numerics to strings
22
-#ifdef _MSC_VER
23
-// 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
24
-# define _Py_STRINGIZE(X) _Py_STRINGIZE1((X))
25
-# define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X
26
-# define _Py_STRINGIZE2(X) #X
27
-
28
-# define TOSTRING(X) _Py_STRINGIZE(X) // Alias _Py_STRINGIZE so that we have a common macro name
29
-#else
30
-# define STRINGIFY(x) #x
31
-# define TOSTRING(x) STRINGIFY(x)
32
-#endif
33
-
34 21
 #define DESMUME_NAME "DeSmuME"
35 22
 
36 23
 #if defined(__x86_64__) || defined(__LP64) || defined(__IA64__) || defined(_M_X64) || defined(_WIN64)
... ...
@@ -61,31 +48,6 @@
61 48
 
62 49
 #define DESMUME_SUBVERSION_STRING " svn 4608"
63 50
 
64
-#ifdef __INTEL_COMPILER
65
-# define DESMUME_COMPILER " (Intel)"
66
-# define DESMUME_COMPILER_DETAIL " (Intel v" TOSTRING(__INTEL_COMPILER) ")"
67
-#elif defined(_MSC_VER)
68
-# define DESMUME_COMPILER " (MSVC)"
69
-# define DESMUME_COMPILER_DETAIL " (MSVC v" TOSTRING(_MSC_VER) ")"
70
-#elif defined(__clang__)
71
-# define DESMUME_COMPILER " (LLVM-Clang)"
72
-# define DESMUME_COMPILER_DETAIL " (LLVM-Clang v" TOSTRING(__clang_major__) "." TOSTRING(__clang_minor__) "." TOSTRING(__clang_patchlevel__) ")"
73
-#elif defined(__llvm__)
74
-# define DESMUME_COMPILER " (LLVM)"
75
-# define DESMUME_COMPILER_DETAIL " (LLVM)"
76
-#elif defined(__GNUC__) // Always make GCC the last check, since other compilers, such as Clang, may define __GNUC__ internally.
77
-# define DESMUME_COMPILER " (GCC)"
78
-
79
-# if defined(__GNUC_PATCHLEVEL__)
80
-#  define DESMUME_COMPILER_DETAIL " (GCC v" TOSTRING(__GNUC__) "." TOSTRING(__GNUC_MINOR__) "." TOSTRING(__GNUC_PATCHLEVEL__) ")"
81
-# else
82
-#  define DESMUME_COMPILER_DETAIL " (GCC v" TOSTRING(__GNUC__) "." TOSTRING(__GNUC_MINOR__) ")"
83
-# endif
84
-#else
85
-# define DESMUME_COMPILER ""
86
-# define DESMUME_COMPILER_DETAIL ""
87
-#endif
88
-
89 51
 #ifdef HAVE_JIT
90 52
 # define DESMUME_JIT "-JIT"
91 53
 #else
... ...
@@ -167,8 +167,7 @@ void Blip_Synth_Fast_::volume_unit(double new_unit)
167 167
 	this->delta_factor = static_cast<int>(new_unit * (1L << blip_sample_bits) + 0.5);
168 168
 }
169 169
 
170
-#if !BLIP_BUFFER_FAST
171
-
170
+#ifndef BLIP_BUFFER_FAST
172 171
 Blip_Synth_::Blip_Synth_(short *p, int w) : impulses(p), width(w)
173 172
 {
174 173
 	this->volume_unit_ = 0.0;
... ...
@@ -120,7 +120,7 @@ enum { BLIP_BUFFER_ACCURACY = 16 };
120 120
 // Affects size of Blip_Synth objects since they store the waveform directly.
121 121
 enum
122 122
 {
123
-#if BLIP_BUFFER_FAST
123
+#ifdef BLIP_BUFFER_FAST
124 124
 	BLIP_PHASE_BITS = 8
125 125
 #else
126 126
 	BLIP_PHASE_BITS = 6
... ...
@@ -218,7 +218,7 @@ public:
218 218
 	}
219 219
 
220 220
 private:
221
-#if BLIP_BUFFER_FAST
221
+#ifdef BLIP_BUFFER_FAST
222 222
 	Blip_Synth_Fast_ impl;
223 223
 #else
224 224
 	Blip_Synth_ impl;
... ...
@@ -316,7 +316,7 @@ template<int quality, int range> inline void Blip_Synth<quality, range>::offset_
316 316
 	auto buf = &blip_buf->buffer_[time >> BLIP_BUFFER_ACCURACY];
317 317
 	int phase = static_cast<int>(time >> (BLIP_BUFFER_ACCURACY - BLIP_PHASE_BITS) & (blip_res - 1));
318 318
 
319
-#if BLIP_BUFFER_FAST
319
+#ifdef BLIP_BUFFER_FAST
320 320
 	int32_t left = buf[0] + delta;
321 321
 
322 322
 	// Kind of crappy, but doing shift after multiply results in overflow.
... ...
@@ -31,36 +31,36 @@ uint32_t cpuPrefetch[2];
31 31
 
32 32
 int cpuTotalTicks = 0;
33 33
 
34
-int lcdTicks = 208;
35
-uint8_t timerOnOffDelay = 0;
36
-uint16_t timer0Value = 0;
34
+static int lcdTicks = 208;
35
+static uint8_t timerOnOffDelay = 0;
36
+static uint16_t timer0Value = 0;
37 37
 bool timer0On = false;
38 38
 int timer0Ticks = 0;
39
-int timer0Reload = 0;
39
+static int timer0Reload = 0;
40 40
 int timer0ClockReload  = 0;
41
-uint16_t timer1Value = 0;
41
+static uint16_t timer1Value = 0;
42 42
 bool timer1On = false;
43 43
 int timer1Ticks = 0;
44
-int timer1Reload = 0;
44
+static int timer1Reload = 0;
45 45
 int timer1ClockReload  = 0;
46
-uint16_t timer2Value = 0;
46
+static uint16_t timer2Value = 0;
47 47
 bool timer2On = false;
48 48
 int timer2Ticks = 0;
49
-int timer2Reload = 0;
49
+static int timer2Reload = 0;
50 50
 int timer2ClockReload  = 0;
51
-uint16_t timer3Value = 0;
51
+static uint16_t timer3Value = 0;
52 52
 bool timer3On = false;
53 53
 int timer3Ticks = 0;
54
-int timer3Reload = 0;
54
+static int timer3Reload = 0;
55 55
 int timer3ClockReload  = 0;
56
-uint32_t dma0Source = 0;
57
-uint32_t dma0Dest = 0;
58
-uint32_t dma1Source = 0;
59
-uint32_t dma1Dest = 0;
60
-uint32_t dma2Source = 0;
61
-uint32_t dma2Dest = 0;
62
-uint32_t dma3Source = 0;
63
-uint32_t dma3Dest = 0;
56
+static uint32_t dma0Source = 0;
57
+static uint32_t dma0Dest = 0;
58
+static uint32_t dma1Source = 0;
59
+static uint32_t dma1Dest = 0;
60
+static uint32_t dma2Source = 0;
61
+static uint32_t dma2Dest = 0;
62
+static uint32_t dma3Source = 0;
63
+static uint32_t dma3Dest = 0;
64 64
 
65 65
 static const int TIMER_TICKS[] = { 0, 6, 8, 10 };
66 66
 
... ...
@@ -83,14 +83,13 @@ uint8_t memoryWaitSeq32[] = { 0, 0, 5, 0, 0, 1, 1, 0, 5, 5, 9, 9, 17, 17, 4, 0 }
83 83
 //const u8 videoMemoryWait[16] =
84 84
 //  {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
85 85
 
86
-
87 86
 uint8_t biosProtected[4];
88 87
 
89 88
 #ifdef WORDS_BIGENDIAN
90
-bool cpuBiosSwapped = false;
89
+static bool cpuBiosSwapped = false;
91 90
 #endif
92 91
 
93
-uint32_t myROM[] =
92
+static uint32_t myROM[] =
94 93
 {
95 94
 	0xEA000006,
96 95
 	0xEA000093,
... ...
@@ -6,7 +6,7 @@
6 6
 #include "Globals.h"
7 7
 #include "XSFCommon.h"
8 8
 
9
-int32_t sineTable[] =
9
+static int32_t sineTable[] =
10 10
 {
11 11
 	0x0000, 0x0192, 0x0323, 0x04B5, 0x0645, 0x07D5, 0x0964, 0x0AF1,
12 12
 	0x0C7C, 0x0E05, 0x0F8C, 0x1111, 0x1294, 0x1413, 0x158F, 0x1708,
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - SNSF Player
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-24
4
+ * Last modification on 2014-09-25
5 5
  *
6 6
  * Based on a modified in_snsf by Caitsith2
7 7
  * http://snsf.caitsith2.net/
... ...
@@ -59,8 +59,6 @@ XSFPlayer *XSFPlayer::Create(const std::wstring &fn)
59 59
 }
60 60
 #endif
61 61
 
62
-volatile bool execute = false;
63
-
64 62
 static struct
65 63
 {
66 64
 	std::vector<uint8_t> rom, sram;
... ...
@@ -19,7 +19,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
19 19
 
20 20
 //// Timers
21 21
 
22
-#if SPC_DISABLE_TEMPO
22
+#ifdef SPC_DISABLE_TEMPO
23 23
 template<typename T> static inline T TIMER_DIV(SNES_SPC::Timer *t, const T &n) { return n >> t->prescaler; }
24 24
 template<typename T> static inline T TIMER_MUL(SNES_SPC::Timer *t, const T &n) { return n << t->prescaler; }
25 25
 #else
... ...
@@ -79,7 +79,7 @@ void SNES_SPC::set_tempo(int t)
79 79
 	static const int timer2_shift = 4; // 64 kHz
80 80
 	static const int other_shift = 3; //  8 kHz
81 81
 
82
-#if SPC_DISABLE_TEMPO
82
+#ifdef SPC_DISABLE_TEMPO
83 83
 	this->m.timers[2].prescaler = timer2_shift;
84 84
 	this->m.timers[1].prescaler = timer2_shift + other_shift;
85 85
 	this->m.timers[0].prescaler = timer2_shift + other_shift;
... ...
@@ -731,7 +731,7 @@ PHASE(29) misc_29(); echo_29(); \
731 731
 PHASE(30) misc_30(); V(V3c, 0) echo_30(); \
732 732
 PHASE(31) V(V4, 0) V(V1, 2)
733 733
 
734
-#if !SPC_DSP_CUSTOM_RUN
734
+#ifndef SPC_DSP_CUSTOM_RUN
735 735
 void SPC_DSP::run(int clocks_remain)
736 736
 {
737 737
 	assert(clocks_remain > 0);
... ...
@@ -9,11 +9,17 @@
9 9
 #if defined(_M_IX86) || defined(_M_IA64) || defined(__i486__) || defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
10 10
 # define BLARGG_CPU_X86 1
11 11
 # define BLARGG_CPU_CISC 1
12
+#else
13
+# define BLARGG_CPU_X86 0
14
+# define BLARGG_CPU_CISC 0
12 15
 #endif
13 16
 
14 17
 #if defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__) || defined(__powerc)
15 18
 # define BLARGG_CPU_POWERPC 1
16 19
 # define BLARGG_CPU_RISC 1
20
+#else
21
+# define BLARGG_CPU_POWERPC 0
22
+# define BLARGG_CPU_RISC 0
17 23
 #endif
18 24
 
19 25
 // BLARGG_BIG_ENDIAN, BLARGG_LITTLE_ENDIAN: Determined automatically, otherwise only
... ...
@@ -24,18 +30,22 @@
24 30
 #  include <endian.h>
25 31
 #  if __BYTE_ORDER == __LITTLE_ENDIAN
26 32
 #   define BLARGG_LITTLE_ENDIAN 1
33
+#   define BLARGG_BIG_ENDIAN 0
27 34
 #  elif __BYTE_ORDER == __BIG_ENDIAN
28 35
 #   define BLARGG_BIG_ENDIAN 1
36
+#   define BLARGG_LITTLE_ENDIAN 0
29 37
 #  endif
30 38
 # else
31 39
 #  if defined(LSB_FIRST) || defined(__LITTLE_ENDIAN__) || BLARGG_CPU_X86 || (defined(LITTLE_ENDIAN) && LITTLE_ENDIAN + 0 != 1234)
32 40
 #   define BLARGG_LITTLE_ENDIAN 1
33
-#  endif
34
-#  if defined(MSB_FIRST) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN) || defined (__sparc__) || BLARGG_CPU_POWERPC || (defined(BIG_ENDIAN) && BIG_ENDIAN + 0 != 4321)
41
+#   define BLARGG_BIG_ENDIAN 0
42
+#  elif defined(MSB_FIRST) || defined(__BIG_ENDIAN__) || defined(WORDS_BIGENDIAN) || defined(__sparc__) || BLARGG_CPU_POWERPC || (defined(BIG_ENDIAN) && BIG_ENDIAN + 0 != 4321)
35 43
 #   define BLARGG_BIG_ENDIAN 1
36
-#  elif !defined (__mips__)
44
+#   define BLARGG_LITTLE_ENDIAN 0
45
+#  else
37 46
 // No endian specified; assume little-endian, since it's most common
38 47
 #   define BLARGG_LITTLE_ENDIAN 1
48
+#   define BLARGG_BIG_ENDIAN 0
39 49
 #  endif
40 50
 # endif
41 51
 #endif
42 52
deleted file mode 100644
... ...
@@ -1,59 +0,0 @@
1
-/*
2
- * xSF Tag List
3
- * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-21
5
- */
6
-
7
-#include <algorithm>
8
-#include "XSFTagList.h"
9
-
10
-eq_str XSFTagNameCompare::eqstr;
11
-
12
-bool XSFTagNameCompare::operator()(const std::pair<std::string, std::string> &v) const
13
-{
14
-	return XSFTagNameCompare::eqstr(v.first, this->name);
15
-}
16
-
17
-std::vector<std::string> XSFTagList::GetAllKeys() const
18
-{
19
-	std::vector<std::string> keys;
20
-	for (XSFTagList::Tags::const_iterator curr = this->tags.begin(), end = this->tags.end(); curr != end; ++curr)
21
-		keys.push_back(curr->first);
22
-	return keys;
23
-}
24
-
25
-bool XSFTagList::Exists(const std::string &name) const
26
-{
27
-	return std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name)) != this->tags.end();
28
-}
29
-
30
-std::string XSFTagList::operator[](const std::string &name) const
31
-{
32
-	XSFTagList::Tags::const_iterator tag = std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name));
33
-	if (tag == this->tags.end())
34
-		return "";
35
-	return tag->second;
36
-}
37
-
38
-std::string &XSFTagList::operator[](const std::string &name)
39
-{
40
-	XSFTagList::Tags::iterator tag = std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name));
41
-	if (tag == this->tags.end())
42
-	{
43
-		this->tags.push_back(std::make_pair(name, ""));
44
-		return this->tags[this->tags.size() - 1].second;
45
-	}
46
-	return tag->second;
47
-}
48
-
49
-void XSFTagList::Remove(const std::string &name)
50
-{
51
-	XSFTagList::Tags::iterator tag = std::find_if(this->tags.begin(), this->tags.end(), XSFTagNameCompare(name));
52
-	if (tag != this->tags.end())
53
-		this->tags.erase(tag);
54
-}
55
-
56
-void XSFTagList::Clear()
57
-{
58
-	this->tags.clear();
59
-}
60 0
deleted file mode 100644
... ...
@@ -1,38 +0,0 @@
1
-/*
2
- * xSF Tag List
3
- * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-21
5
- */
6
-
7
-#ifndef XSFTAGLIST_H
8
-#define XSFTAGLIST_H
9
-
10
-#include <utility>
11
-#include <vector>
12
-#include "eqstr.h"
13
-
14
-struct XSFTagNameCompare
15
-{
16
-	XSFTagNameCompare(const std::string &Name) : name(Name) { }
17
-	bool operator()(const std::pair<std::string, std::string> &v) const;
18
-private:
19
-	static eq_str eqstr;
20
-	std::string name;
21
-};
22
-
23
-class XSFTagList
24
-{
25
-	typedef std::vector<std::pair<std::string, std::string> > Tags;
26
-
27
-	Tags tags;
28
-public:
29
-	XSFTagList() : tags() { }
30
-	std::vector<std::string> GetAllKeys() const;
31
-	bool Exists(const std::string &name) const;
32
-	std::string operator[](const std::string &name) const;
33
-	std::string &operator[](const std::string &name);
34
-	void Remove(const std::string &name);
35
-	void Clear();
36
-};
37
-
38
-#endif
... ...
@@ -1184,12 +1184,12 @@ public:
1184 1184
 		return this->do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1185 1185
 	}
1186 1186
 
1187
-	int encoding() const throw()
1187
+	int encoding() const noexcept
1188 1188
 	{
1189 1189
 		return this->do_encoding();
1190 1190
 	}
1191 1191
 
1192
-	bool always_noconv() const throw()
1192
+	bool always_noconv() const noexcept
1193 1193
 	{
1194 1194
 		return this->do_always_noconv();
1195 1195
 	}
... ...
@@ -1199,7 +1199,7 @@ public:
1199 1199
 		return this->do_length(__st, __frm, __end, __mx);
1200 1200
 	}
1201 1201
 
1202
-	int max_length() const throw()
1202
+	int max_length() const noexcept
1203 1203
 	{
1204 1204
 		return this->do_max_length();
1205 1205
 	}
... ...
@@ -1242,15 +1242,15 @@ protected:
1242 1242
 		to_nxt = to;
1243 1243
 		return noconv;
1244 1244
 	}
1245
-	virtual int do_encoding() const throw() { return 0; }
1246
-	virtual bool do_always_noconv() const throw() { return false; }
1245
+	virtual int do_encoding() const noexcept { return 0; }
1246
+	virtual bool do_always_noconv() const noexcept { return false; }
1247 1247
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1248 1248
 	{
1249 1249
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1250 1250
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1251 1251
 		return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx);
1252 1252
 	}
1253
-	virtual int do_max_length() const throw() { return 4; }
1253
+	virtual int do_max_length() const noexcept { return 4; }
1254 1254
 };
1255 1255
 
1256 1256
 template<> class codecvt<char32_t, char, mbstate_t> : public locale::facet, public codecvt_base
... ...
@@ -1277,12 +1277,12 @@ public:
1277 1277
 		return this->do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1278 1278
 	}
1279 1279
 
1280
-	int encoding() const throw()
1280
+	int encoding() const noexcept
1281 1281
 	{
1282 1282
 		return this->do_encoding();
1283 1283
 	}
1284 1284
 
1285
-	bool always_noconv() const throw()
1285
+	bool always_noconv() const noexcept
1286 1286
 	{
1287 1287
 		return this->do_always_noconv();
1288 1288
 	}
... ...
@@ -1292,7 +1292,7 @@ public:
1292 1292
 		return this->do_length(__st, __frm, __end, __mx);
1293 1293
 	}
1294 1294
 
1295
-	int max_length() const throw()
1295
+	int max_length() const noexcept
1296 1296
 	{
1297 1297
 		return this->do_max_length();
1298 1298
 	}
... ...
@@ -1335,15 +1335,15 @@ protected:
1335 1335
 		to_nxt = to;
1336 1336
 		return noconv;
1337 1337
 	}
1338
-	virtual int do_encoding() const throw() { return 0; }
1339
-	virtual bool do_always_noconv() const throw() { return false; }
1338
+	virtual int do_encoding() const noexcept { return 0; }
1339
+	virtual bool do_always_noconv() const noexcept { return false; }
1340 1340
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1341 1341
 	{
1342 1342
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1343 1343
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1344 1344
 		return UnicodeConverters::utf8_to_ucs4_length(_frm, _frm_end, mx);
1345 1345
 	}
1346
-	virtual int do_max_length() const throw() { return 4; }
1346
+	virtual int do_max_length() const noexcept { return 4; }
1347 1347
 };
1348 1348
 
1349 1349
 template<class _Elem> class __codecvt_utf8;
... ...
@@ -1412,15 +1412,15 @@ protected:
1412 1412
 		to_nxt = to;
1413 1413
 		return noconv;
1414 1414
 	}
1415
-	virtual int do_encoding() const throw() { return 0; }
1416
-	virtual bool do_always_noconv() const throw() { return false; }
1415
+	virtual int do_encoding() const noexcept { return 0; }
1416
+	virtual bool do_always_noconv() const noexcept { return false; }
1417 1417
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1418 1418
 	{
1419 1419
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1420 1420
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1421 1421
 		return UnicodeConverters::utf8_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1422 1422
 	}
1423
-	virtual int do_max_length() const throw()
1423
+	virtual int do_max_length() const noexcept
1424 1424
 	{
1425 1425
 		if (this->_Mode_ & consume_header)
1426 1426
 			return 7;
... ...
@@ -1470,15 +1470,15 @@ protected:
1470 1470
 		to_nxt = to;
1471 1471
 		return noconv;
1472 1472
 	}
1473
-	virtual int do_encoding() const throw() { return 0; }
1474
-	virtual bool do_always_noconv() const throw() { return false; }
1473
+	virtual int do_encoding() const noexcept { return 0; }
1474
+	virtual bool do_always_noconv() const noexcept { return false; }
1475 1475
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1476 1476
 	{
1477 1477
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1478 1478
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1479 1479
 		return UnicodeConverters::utf8_to_ucs2_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1480 1480
 	}
1481
-	virtual int do_max_length() const throw()
1481
+	virtual int do_max_length() const noexcept
1482 1482
 	{
1483 1483
 		if (this->_Mode_ & consume_header)
1484 1484
 			return 6;
... ...
@@ -1528,15 +1528,15 @@ protected:
1528 1528
 		to_nxt = to;
1529 1529
 		return noconv;
1530 1530
 	}
1531
-	virtual int do_encoding() const throw() { return 0; }
1532
-	virtual bool do_always_noconv() const throw() { return false; }
1531
+	virtual int do_encoding() const noexcept { return 0; }
1532
+	virtual bool do_always_noconv() const noexcept { return false; }
1533 1533
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1534 1534
 	{
1535 1535
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1536 1536
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1537 1537
 		return UnicodeConverters::utf8_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1538 1538
 	}
1539
-	virtual int do_max_length() const throw()
1539
+	virtual int do_max_length() const noexcept
1540 1540
 	{
1541 1541
 		if (this->_Mode_ & consume_header)
1542 1542
 			return 7;
... ...
@@ -1596,15 +1596,15 @@ protected:
1596 1596
 		to_nxt = to;
1597 1597
 		return noconv;
1598 1598
 	}
1599
-	virtual int do_encoding() const throw() { return 0; }
1600
-	virtual bool do_always_noconv() const throw() { return false; }
1599
+	virtual int do_encoding() const noexcept { return 0; }
1600
+	virtual bool do_always_noconv() const noexcept { return false; }
1601 1601
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1602 1602
 	{
1603 1603
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1604 1604
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1605 1605
 		return UnicodeConverters::utf16be_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1606 1606
 	}
1607
-	virtual int do_max_length() const throw()
1607
+	virtual int do_max_length() const noexcept
1608 1608
 	{
1609 1609
 		if (this->_Mode_ & consume_header)
1610 1610
 			return 6;
... ...
@@ -1654,15 +1654,15 @@ protected:
1654 1654
 		to_nxt = to;
1655 1655
 		return noconv;
1656 1656
 	}
1657
-	virtual int do_encoding() const throw() { return 0; }
1658
-	virtual bool do_always_noconv() const throw() { return false; }
1657
+	virtual int do_encoding() const noexcept { return 0; }
1658
+	virtual bool do_always_noconv() const noexcept { return false; }
1659 1659
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1660 1660
 	{
1661 1661
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1662 1662
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1663 1663
 		return UnicodeConverters::utf16le_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1664 1664
 	}
1665
-	virtual int do_max_length() const throw()
1665
+	virtual int do_max_length() const noexcept
1666 1666
 	{
1667 1667
 		if (this->_Mode_ & consume_header)
1668 1668
 			return 6;
... ...
@@ -1712,15 +1712,15 @@ protected:
1712 1712
 		to_nxt = to;
1713 1713
 		return noconv;
1714 1714
 	}
1715
-	virtual int do_encoding() const throw() { return 0; }
1716
-	virtual bool do_always_noconv() const throw() { return false; }
1715
+	virtual int do_encoding() const noexcept { return 0; }
1716
+	virtual bool do_always_noconv() const noexcept { return false; }
1717 1717
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1718 1718
 	{
1719 1719
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1720 1720
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1721 1721
 		return UnicodeConverters::utf16be_to_ucs2_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1722 1722
 	}
1723
-	virtual int do_max_length() const throw()
1723
+	virtual int do_max_length() const noexcept
1724 1724
 	{
1725 1725
 		if (this->_Mode_ & consume_header)
1726 1726
 			return 4;
... ...
@@ -1770,15 +1770,15 @@ protected:
1770 1770
 		to_nxt = to;
1771 1771
 		return noconv;
1772 1772
 	}
1773
-	virtual int do_encoding() const throw() { return 0; }
1774
-	virtual bool do_always_noconv() const throw() { return false; }
1773
+	virtual int do_encoding() const noexcept { return 0; }
1774
+	virtual bool do_always_noconv() const noexcept { return false; }
1775 1775
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1776 1776
 	{
1777 1777
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1778 1778
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1779 1779
 		return UnicodeConverters::utf16le_to_ucs2_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1780 1780
 	}
1781
-	virtual int do_max_length() const throw()
1781
+	virtual int do_max_length() const noexcept
1782 1782
 	{
1783 1783
 		if (this->_Mode_ & consume_header)
1784 1784
 			return 4;
... ...
@@ -1828,15 +1828,15 @@ protected:
1828 1828
 		to_nxt = to;
1829 1829
 		return noconv;
1830 1830
 	}
1831
-	virtual int do_encoding() const throw() { return 0; }
1832
-	virtual bool do_always_noconv() const throw() { return false; }
1831
+	virtual int do_encoding() const noexcept { return 0; }
1832
+	virtual bool do_always_noconv() const noexcept { return false; }
1833 1833
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1834 1834
 	{
1835 1835
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1836 1836
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1837 1837
 		return UnicodeConverters::utf16be_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1838 1838
 	}
1839
-	virtual int do_max_length() const throw()
1839
+	virtual int do_max_length() const noexcept
1840 1840
 	{
1841 1841
 		if (this->_Mode_ & consume_header)
1842 1842
 			return 6;
... ...
@@ -1886,15 +1886,15 @@ protected:
1886 1886
 		to_nxt = to;
1887 1887
 		return noconv;
1888 1888
 	}
1889
-	virtual int do_encoding() const throw() { return 0; }
1890
-	virtual bool do_always_noconv() const throw() { return false; }
1889
+	virtual int do_encoding() const noexcept { return 0; }
1890
+	virtual bool do_always_noconv() const noexcept { return false; }
1891 1891
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1892 1892
 	{
1893 1893
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1894 1894
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1895 1895
 		return UnicodeConverters::utf16le_to_ucs4_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1896 1896
 	}
1897
-	virtual int do_max_length() const throw()
1897
+	virtual int do_max_length() const noexcept
1898 1898
 	{
1899 1899
 		if (this->_Mode_ & consume_header)
1900 1900
 			return 6;
... ...
@@ -1954,15 +1954,15 @@ protected:
1954 1954
 		to_nxt = to;
1955 1955
 		return noconv;
1956 1956
 	}
1957
-	virtual int do_encoding() const throw() { return 0; }
1958
-	virtual bool do_always_noconv() const throw() { return false; }
1957
+	virtual int do_encoding() const noexcept { return 0; }
1958
+	virtual bool do_always_noconv() const noexcept { return false; }
1959 1959
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
1960 1960
 	{
1961 1961
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
1962 1962
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
1963 1963
 		return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
1964 1964
 	}
1965
-	virtual int do_max_length() const throw()
1965
+	virtual int do_max_length() const noexcept
1966 1966
 	{
1967 1967
 		if (this->_Mode_ & consume_header)
1968 1968
 			return 7;
... ...
@@ -2012,15 +2012,15 @@ protected:
2012 2012
 		to_nxt = to;
2013 2013
 		return noconv;
2014 2014
 	}
2015
-	virtual int do_encoding() const throw() { return 0; }
2016
-	virtual bool do_always_noconv() const throw() { return false; }
2015
+	virtual int do_encoding() const noexcept { return 0; }
2016
+	virtual bool do_always_noconv() const noexcept { return false; }
2017 2017
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
2018 2018
 	{
2019 2019
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
2020 2020
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
2021 2021
 		return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
2022 2022
 	}
2023
-	virtual int do_max_length() const throw()
2023
+	virtual int do_max_length() const noexcept
2024 2024
 	{
2025 2025
 		if (this->_Mode_ & consume_header)
2026 2026
 			return 7;
... ...
@@ -2070,15 +2070,15 @@ protected:
2070 2070
 		to_nxt = to;
2071 2071
 		return noconv;
2072 2072
 	}
2073
-	virtual int do_encoding() const throw() { return 0; }
2074
-	virtual bool do_always_noconv() const throw() { return false; }
2073
+	virtual int do_encoding() const noexcept { return 0; }
2074
+	virtual bool do_always_noconv() const noexcept { return false; }
2075 2075
 	virtual int do_length(state_type &, const extern_type *frm, const extern_type *frm_end, size_t mx) const
2076 2076
 	{
2077 2077
 		auto _frm = reinterpret_cast<const uint8_t *>(frm);
2078 2078
 		auto _frm_end = reinterpret_cast<const uint8_t *>(frm_end);
2079 2079
 		return UnicodeConverters::utf8_to_utf16_length(_frm, _frm_end, mx, this->_Maxcode_, this->_Mode_);
2080 2080
 	}
2081
-	virtual int do_max_length() const throw()
2081
+	virtual int do_max_length() const noexcept
2082 2082
 	{
2083 2083
 		if (this->_Mode_ & consume_header)
2084 2084
 			return 7;
... ...
@@ -2094,5 +2094,5 @@ public:
2094 2094
 	~codecvt_utf8_utf16() {}
2095 2095
 };
2096 2096
 
2097
-};
2097
+}
2098 2098
 #endif
... ...
@@ -53,7 +53,7 @@ public:
53 53
 		if (!this->__file_)
54 54
 		{
55 55
 			__rt = this;
56
-			const char *__mdstr;
56
+			const char *__mdstr = nullptr;
57 57
 			switch (__mode & ~std::ios_base::ate)
58 58
 			{
59 59
 				case std::ios_base::out:
... ...
@@ -130,7 +130,7 @@ public:
130 130
 		if (!this->__file_)
131 131
 		{
132 132
 			__rt = this;
133
-			const wchar_t *__mdstr;
133
+			const wchar_t *__mdstr = nullptr;
134 134
 			switch (__mode & ~std::ios_base::ate)
135 135
 			{
136 136
 				case std::ios_base::out:
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Winamp plugin
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-24
4
+ * Last modification on 2014-09-25
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -19,15 +19,15 @@ std::locale::id std::codecvt<char32_t, char, mbstate_t>::id;
19 19
 #endif
20 20
 
21 21
 extern In_Module inMod;
22
-const XSFFile *xSFFile = nullptr;
22
+static const XSFFile *xSFFile = nullptr;
23 23
 XSFFile *xSFFileInInfo = nullptr;
24
-XSFPlayer *xSFPlayer = nullptr;
24
+static XSFPlayer *xSFPlayer = nullptr;
25 25
 XSFConfig *xSFConfig = nullptr;
26
-bool paused;
27
-int seek_needed;
28
-double decode_pos_ms;
29
-HANDLE thread_handle = INVALID_HANDLE_VALUE;
30
-bool killThread = false;
26
+static bool paused;
27
+static int seek_needed;
28
+static double decode_pos_ms;
29
+static HANDLE thread_handle = INVALID_HANDLE_VALUE;
30
+static bool killThread = false;
31 31
 
32 32
 static const unsigned NumChannels = 2;
33 33
 static const unsigned BitsPerSample = 16;
... ...
@@ -374,7 +374,7 @@ extern "C" __declspec(dllexport) int winampGetExtendedFileInfoW(const wchar_t *f
374 374
 	}
375 375
 }
376 376
 
377
-std::unique_ptr<XSFFile> extendedXSFFile;
377
+static std::unique_ptr<XSFFile> extendedXSFFile;
378 378
 
379 379
 int wrapperWinampSetExtendedFileInfo(const char *data, const wchar_t *val)
380 380
 {
... ...
@@ -467,7 +467,7 @@ extern "C" __declspec(dllexport) intptr_t winampGetExtendedRead_openW(const wcha
467 467
 	}
468 468
 }
469 469
 
470
-int extendedSeekNeeded = -1;
470
+static int extendedSeekNeeded = -1;
471 471
 
472 472
 extern "C" __declspec(dllexport) size_t winampGetExtendedRead_getData(intptr_t handle, char *dest, size_t len, int *killswitch)
473 473
 {
... ...
@@ -175,9 +175,9 @@ public:
175 175
 		return this->__byte_err_string_;
176 176
 	}
177 177
 
178
-	size_t converted() const throw() { return this->__cvtcount_; }
178
+	size_t converted() const noexcept { return this->__cvtcount_; }
179 179
 	state_type state() const { return this->__cvtstate_; }
180 180
 };
181 181
 
182
-};
182
+}
183 183
 #endif