Browse code

Some conversion replacements:

* Replace the (w)stringify functions with the standard std::to_(w)string functions.
* Replace convertTo with versions that use type_traits to determine which standard string conversion function to call, as well as handle enums specically.

Naram Qashat authored on 2021/03/19 11:57:21
Showing 14 changed files
... ...
@@ -93,7 +93,7 @@ INT_PTR CALLBACK XSFConfig_2SF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM
93 93
 			// Mutes
94 94
 			for (size_t x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
95 95
 			{
96
-				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + wstringify(x + 1)).c_str()));
96
+				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + std::to_wstring(x + 1)).c_str()));
97 97
 				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, this->mutes[x], x);
98 98
 			}
99 99
 			break;
... ...
@@ -162,7 +162,7 @@ bool XSFPlayer_2SF::RecursiveLoad2SF(XSFFile *xSFToLoad, int level)
162 162
 	do
163 163
 	{
164 164
 		found = false;
165
-		std::string libTag = "_lib" + stringify(n++);
165
+		std::string libTag = "_lib" + std::to_string(n++);
166 166
 		if (xSFToLoad->GetTagExists(libTag))
167 167
 		{
168 168
 			found = true;
... ...
@@ -168,7 +168,7 @@ static bool RecursiveLoad2SF(XSFFile *xSF, int level)
168 168
 	do
169 169
 	{
170 170
 		found = false;
171
-		std::string libTag = "_lib" + stringify(n++);
171
+		std::string libTag = "_lib" + std::to_string(n++);
172 172
 		if (xSF->GetTagExists(libTag))
173 173
 		{
174 174
 			found = true;
... ...
@@ -42,7 +42,7 @@ SDAT::SDAT(PseudoFile &file, uint32_t sseqToLoad) : sseq(), sbnk(), player()
42 42
 		throw std::logic_error("No SSEQ records found in SDAT");
43 43
 
44 44
 	if (!infoSection.SEQrecord.entries.count(sseqToLoad))
45
-		throw std::range_error("SSEQ of " + stringify(sseqToLoad) + " is not found");
45
+		throw std::range_error("SSEQ of " + std::to_string(sseqToLoad) + " is not found");
46 46
 
47 47
 	// Read SSEQ
48 48
 	if (infoSection.SEQrecord.entries.count(sseqToLoad))
... ...
@@ -85,7 +85,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
85 85
 			// Mutes
86 86
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
87 87
 			{
88
-				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + wstringify(x + 1)).c_str()));
88
+				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + std::to_wstring(x + 1)).c_str()));
89 89
 				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, this->mutes[x], x);
90 90
 			}
91 91
 			break;
... ...
@@ -259,9 +259,9 @@ void XSFConfig_NCSF::RefreshSoundView()
259 259
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, vol);
260 260
 
261 261
 			if (this->soundViewData->volModeAlternative)
262
-				buf = wstringify(chn.reg.volumeMul) + L"/" + wstringify(1 << datashift);
262
+				buf = std::to_wstring(chn.reg.volumeMul) + L"/" + std::to_wstring(1 << datashift);
263 263
 			else
264
-				buf = wstringify(vol);
264
+				buf = std::to_wstring(vol);
265 265
 			SetDlgItemTextW(hDlg, IDC_SOUND0VOL + chanId, buf.c_str());
266 266
 
267 267
 			if (!chn.reg.panning)
... ...
@@ -271,18 +271,18 @@ void XSFConfig_NCSF::RefreshSoundView()
271 271
 			else if (chn.reg.panning == 127)
272 272
 				buf = L"R";
273 273
 			else if (chn.reg.panning < 64)
274
-				buf = L"L" + wstringify(64 - chn.reg.panning);
274
+				buf = L"L" + std::to_wstring(64 - chn.reg.panning);
275 275
 			else //if (chn.reg.panning > 64)
276
-				buf = L"R" + wstringify(chn.reg.panning - 64);
276
+				buf = L"R" + std::to_wstring(chn.reg.panning - 64);
277 277
 			SetDlgItemTextW(hDlg, IDC_SOUND0PAN + chanId, buf.c_str());
278 278
 
279 279
 			static const std::wstring modes[] = { L"Manual", L"Loop Infinite", L"One-Shot", L"Prohibited" };
280
-			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, (wstringify(chn.reg.repeatMode) + L" (" + modes[chn.reg.repeatMode] + L")").c_str());
280
+			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, (std::to_wstring(chn.reg.repeatMode) + L" (" + modes[chn.reg.repeatMode] + L")").c_str());
281 281
 
282 282
 			if (chn.reg.format != 3)
283 283
 			{
284 284
 				static const std::wstring formats[] = { L"PCM8", L"PCM16", L"IMA-ADPCM" };
285
-				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, (wstringify(chn.reg.format) + L" (" + formats[chn.reg.format] + L")").c_str());
285
+				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, (std::to_wstring(chn.reg.format) + L" (" + formats[chn.reg.format] + L")").c_str());
286 286
 			}
287 287
 			else
288 288
 			{
... ...
@@ -290,7 +290,7 @@ void XSFConfig_NCSF::RefreshSoundView()
290 290
 				if (chanId < 8)
291 291
 					buf += L"PSG/Noise?";
292 292
 				else if (chanId < 14)
293
-					buf += wstringify(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1)) + L"% Square";
293
+					buf += std::to_wstring(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1)) + L"% Square";
294 294
 				else
295 295
 					buf += L"Noise";
296 296
 				buf += L")";
... ...
@@ -300,17 +300,17 @@ void XSFConfig_NCSF::RefreshSoundView()
300 300
 			static const std::wstring states[] = { L"NONE", L"START", L"ATTACK", L"DECAY", L"SUSTAIN", L"RELEASE" };
301 301
 			SetDlgItemTextW(hDlg, IDC_SOUND0STATE + chanId, states[chn.state].c_str());
302 302
 
303
-			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + wstringify(chn.reg.loopStart)).c_str());
303
+			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + std::to_wstring(chn.reg.loopStart)).c_str());
304 304
 
305 305
 			std::wstring tmpBuf = ConvertFuncs::StringToWString(NumToHexString(chn.reg.timer)).substr(2);
306 306
 			buf = L"$" + tmpBuf + L" (";
307
-			tmpBuf = wstringify((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8);
307
+			tmpBuf = std::to_wstring((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8);
308 308
 			if (tmpBuf.find('.') != std::wstring::npos)
309 309
 				tmpBuf = tmpBuf.substr(0, tmpBuf.find('.') + 2);
310 310
 			buf += tmpBuf + L" Hz)";
311 311
 			SetDlgItemTextW(hDlg, IDC_SOUND0TMR + chanId, buf.c_str());
312 312
 
313
-			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + wstringify(static_cast<uint32_t>(chn.reg.samplePosition)) + L" / " + wstringify(chn.reg.totalLength)).c_str());
313
+			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + std::to_wstring(static_cast<uint32_t>(chn.reg.samplePosition)) + L" / " + std::to_wstring(chn.reg.totalLength)).c_str());
314 314
 		}
315 315
 		else if (this->soundViewData->channelLastStates[chanId] != CS_NONE)
316 316
 		{
... ...
@@ -83,7 +83,7 @@ bool XSFPlayer_NCSF::RecursiveLoadNCSF(XSFFile *xSFToLoad, int level)
83 83
 	do
84 84
 	{
85 85
 		found = false;
86
-		std::string libTag = "_lib" + stringify(n++);
86
+		std::string libTag = "_lib" + std::to_string(n++);
87 87
 		if (xSFToLoad->GetTagExists(libTag))
88 88
 		{
89 89
 			found = true;
... ...
@@ -101,7 +101,7 @@ INT_PTR CALLBACK XSFConfig_SNSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
101 101
 			// Mutes
102 102
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
103 103
 			{
104
-				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"BRRPCM " + wstringify(x + 1)).c_str()));
104
+				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"BRRPCM " + std::to_wstring(x + 1)).c_str()));
105 105
 				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, this->mutes[x], x);
106 106
 			}
107 107
 			break;
... ...
@@ -183,7 +183,7 @@ static bool RecursiveLoad2SF(XSFFile *xSF, int level)
183 183
 	do
184 184
 	{
185 185
 		found = false;
186
-		std::string libTag = "_lib" + stringify(n++);
186
+		std::string libTag = "_lib" + std::to_string(n++);
187 187
 		if (xSF->GetTagExists(libTag))
188 188
 		{
189 189
 			found = true;
... ...
@@ -228,7 +228,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
228 228
 			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::MSToWString(this->defaultFade).c_str());
229 229
 			SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::MSToWString(this->skipSilenceOnStartSec).c_str());
230 230
 			SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::MSToWString(this->detectSilenceSec).c_str());
231
-			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(this->volume).c_str());
231
+			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), std::to_wstring(this->volume).c_str());
232 232
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
233 233
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Use Volume Tag"));
234 234
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
... ...
@@ -241,7 +241,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
241 241
 			for (unsigned x = 0, rates = this->supportedSampleRates.size(); x < rates; ++x)
242 242
 			{
243 243
 				unsigned rate = this->supportedSampleRates[x];
244
-				SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(wstringify(rate).c_str()));
244
+				SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(std::to_wstring(rate).c_str()));
245 245
 				if (this->sampleRate == rate)
246 246
 					SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, x, 0);
247 247
 			}
... ...
@@ -335,7 +335,7 @@ void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
335 335
 	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::StringToWString(XSFConfig::initDefaultFade).c_str());
336 336
 	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::StringToWString(XSFConfig::initSkipSilenceOnStartSec).c_str());
337 337
 	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::StringToWString(XSFConfig::initDetectSilenceSec).c_str());
338
-	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(XSFConfig::initVolume).c_str());
338
+	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), std::to_wstring(XSFConfig::initVolume).c_str());
339 339
 	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
340 340
 	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
341 341
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
... ...
@@ -352,7 +352,7 @@ void XSFConfig::SaveConfigDialog(HWND hwndDlg)
352 352
 	this->defaultFade = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDefaultFade)));
353 353
 	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec)));
354 354
 	this->detectSilenceSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDetectSilenceSec)));
355
-	this->volume = convertTo<double>(this->GetTextFromWindow(GetDlgItem(hwndDlg, idVolume)), false);
355
+	this->volume = convertTo<double>(this->GetTextFromWindow(GetDlgItem(hwndDlg, idVolume)));
356 356
 	this->volumeType = static_cast<VolumeType>(SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_GETCURSEL, 0, 0));
357 357
 	this->peakType = static_cast<PeakType>(SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_GETCURSEL, 0, 0));
358 358
 	this->sampleRate = XSFConfig::supportedSampleRates[SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_GETCURSEL, 0, 0)];
... ...
@@ -24,10 +24,10 @@ public:
24 24
 
25 25
 	virtual ~XSFConfigIO() { }
26 26
 	virtual void SetValueString(const std::string &name, const std::string &value) = 0;
27
-	template<typename T> void SetValue(const std::string &name, const T &value) { this->SetValueString(name, stringify(value)); }
27
+	template<typename T> void SetValue(const std::string &name, const T &value) { this->SetValueString(name, std::to_string(value)); }
28 28
 	void SetValue(const std::string &name, const std::string &value) { this->SetValueString(name, value); }
29 29
 	virtual std::string GetValueString(const std::string &name, const std::string &defaultValue) const = 0;
30
-	template<typename T> T GetValue(const std::string &name, const T &defaultValue) const { return convertTo<T>(this->GetValueString(name, stringify(defaultValue))); }
30
+	template<typename T> T GetValue(const std::string &name, const T &defaultValue) const { return convertTo<T>(this->GetValueString(name, std::to_string(defaultValue))); }
31 31
 	std::string GetValue(const std::string &name, const std::string &defaultValue) const { return this->GetValueString(name, defaultValue); }
32 32
 	virtual void SetHInstance(HINSTANCE) { }
33 33
 	virtual HINSTANCE GetHInstance() const { return nullptr; }
... ...
@@ -325,24 +325,24 @@ double XSFFile::GetVolume(VolumeType preferredVolumeType, PeakType preferredPeak
325 325
 	bool hadReplayGain = false;
326 326
 	if (preferredVolumeType == VOLUMETYPE_REPLAYGAIN_ALBUM && !replaygain_album_gain.empty())
327 327
 	{
328
-		gain = convertTo<double>(replaygain_album_gain, false);
328
+		gain = convertTo<double>(replaygain_album_gain);
329 329
 		hadReplayGain = true;
330 330
 	}
331 331
 	if (!hadReplayGain && preferredVolumeType != VOLUMETYPE_VOLUME && !replaygain_track_gain.empty())
332 332
 	{
333
-		gain = convertTo<double>(replaygain_track_gain, false);
333
+		gain = convertTo<double>(replaygain_track_gain);
334 334
 		hadReplayGain = true;
335 335
 	}
336 336
 	if (hadReplayGain)
337 337
 	{
338 338
 		double vol = std::pow(10.0, gain / 20.0), peak = 1.0;
339 339
 		if (preferredPeakType == PEAKTYPE_REPLAYGAIN_ALBUM && !replaygain_album_peak.empty())
340
-			peak = convertTo<double>(replaygain_album_peak, false);
340
+			peak = convertTo<double>(replaygain_album_peak);
341 341
 		else if (preferredPeakType != PEAKTYPE_NONE && !replaygain_track_peak.empty())
342
-			peak = convertTo<double>(replaygain_track_peak, false);
342
+			peak = convertTo<double>(replaygain_track_peak);
343 343
 		return !fEqual(peak, 1.0) ? std::min(vol, 1.0 / peak) : vol;
344 344
 	}
345
-	return volume.empty() ? 1.0 : convertTo<double>(volume, false);
345
+	return volume.empty() ? 1.0 : convertTo<double>(volume);
346 346
 }
347 347
 
348 348
 std::string XSFFile::FormattedTitleOptionalBlock(const std::string &block, bool &hadReplacement, unsigned level) const
... ...
@@ -63,7 +63,7 @@ public:
63 63
 	std::string GetTagValue(const std::string &name) const;
64 64
 	template<typename T> T GetTagValue(const std::string &name, const T &defaultValue) const
65 65
 	{
66
-		return this->GetTagExists(name) ? convertTo<T>(this->GetTagValue(name), false) : defaultValue;
66
+		return this->GetTagExists(name) ? convertTo<T>(this->GetTagValue(name)) : defaultValue;
67 67
 	}
68 68
 	unsigned long GetLengthMS(unsigned long defaultLength) const;
69 69
 	unsigned long GetFadeMS(unsigned long defaultFade) const;
... ...
@@ -5,61 +5,54 @@
5 5
 
6 6
 #pragma once
7 7
 
8
-#include <stdexcept>
9 8
 #include <string>
10 9
 #include <sstream>
11
-#include <typeinfo>
12 10
 #include <locale>
13
-#include <codecvt>
14 11
 #include <vector>
15 12
 #include <memory>
13
+#include <type_traits>
16 14
 #include <cmath>
17 15
 #include "windowsh_wrapper.h"
18 16
 
19
-/*
20
- * The following exception class and the *stringify and convert* functions are
21
- * from the C++ FAQ, section 39, entry 3:
22
- * http://www.parashift.com/c++-faq/convert-string-to-any.html
23
- *
24
- * The convert and convertTo functions were made into templates of std::basic_string
25
- * to handle wide-character strings properly, as well as adding wstringify for the
26
- * same reason.
27
- */
28
-class BadConversion : public std::runtime_error
29
-{
30
-public:
31
-	BadConversion(const std::string &s) : std::runtime_error(s) { }
32
-};
33
-
34
-template<typename T> inline std::string stringify(const T &x)
35
-{
36
-	std::ostringstream o;
37
-	if (!(o << x))
38
-		throw BadConversion(std::string("stringify(") + typeid(x).name() + ")");
39
-	return o.str();
40
-}
41
-
42
-template<typename T> inline std::wstring wstringify(const T &x)
43
-{
44
-	std::wostringstream o;
45
-	if (!(o << x))
46
-		throw BadConversion(std::string("wstringify(") + typeid(x).name() + ")");
47
-	return o.str();
48
-}
49
-
50
-template<typename T, typename S> inline void convert(const std::basic_string<S> &s, T &x, bool failIfLeftoverChars = true)
17
+ /*
18
+  * Originally the convert* functions came from the C++ FAQ, Miscellaneous Technical Issues:
19
+  * https://isocpp.org/wiki/faq/misc-technical-issues#convert-string-to-any
20
+  *
21
+  * They have been replaced with a couple functions that use the C++11 std::enable_if
22
+  * construct along with various other type traits constructs to use the proper
23
+  * string conversions.
24
+  */
25
+template<typename T, typename S> inline typename std::enable_if_t<!std::is_enum_v<T> &&std::is_arithmetic_v<T>, T> convertTo(const std::basic_string<S> &s)
51 26
 {
52
-	std::basic_istringstream<S> i(s);
53
-	S c;
54
-	if (!(i >> x) || (failIfLeftoverChars && i.get(c)))
55
-		throw BadConversion(std::string("convert(") + typeid(S).name() + ")");
27
+	if (std::is_integral_v<T>)
28
+	{
29
+		if (std::is_unsigned_v<T>)
30
+		{
31
+			if (std::is_same_v<unsigned long long, std::remove_cv_t<T>>)
32
+				return static_cast<T>(std::stoull(s));
33
+			else
34
+				return static_cast<T>(std::stoul(s));
35
+		}
36
+		else if (std::is_same_v<long long, std::remove_cv_t<T>>)
37
+			return static_cast<T>(std::stoll(s));
38
+		else if (std::is_same_v<long, std::remove_cv_t<T>>)
39
+			return static_cast<T>(std::stol(s));
40
+		else
41
+			return static_cast<T>(std::stoi(s));
42
+	}
43
+	else if (std::is_floating_point_v<T>)
44
+	{
45
+		if (std::is_same_v<long double, std::remove_cv_t<T>>)
46
+			return static_cast<T>(std::stold(s));
47
+		else if (std::is_same_v<double, std::remove_cv_t<T>>)
48
+			return static_cast<T>(std::stod(s));
49
+		else
50
+			return static_cast<T>(std::stof(s));
51
+	}
56 52
 }
57
-
58
-template<typename T, typename S> inline T convertTo(const std::basic_string<S> &s, bool failIfLeftoverChars = true)
53
+template<typename T, typename S> inline typename std::enable_if_t<std::is_enum_v<T>, T> convertTo(const std::basic_string<S> &s)
59 54
 {
60
-	T x;
61
-	convert(s, x, failIfLeftoverChars);
62
-	return x;
55
+	return static_cast<T>(convertTo<std::underlying_type_t<T>>(s));
63 56
 }
64 57
 
65 58
 // Miscellaneous conversion functions
... ...
@@ -107,13 +100,13 @@ public:
107 100
 		{
108 101
 			if (!ConvertFuncs::IsDigitsOnly(hoursStr))
109 102
 				return 0;
110
-			hours = convertTo<unsigned long>(hoursStr, false);
103
+			hours = convertTo<unsigned long>(hoursStr);
111 104
 		}
112 105
 		if (!minutesStr.empty())
113 106
 		{
114 107
 			if (!ConvertFuncs::IsDigitsOnly(minutesStr))
115 108
 				return 0;
116
-			minutes = convertTo<unsigned long>(minutesStr, false);
109
+			minutes = convertTo<unsigned long>(minutesStr);
117 110
 		}
118 111
 		if (!secondsStr.empty())
119 112
 		{
... ...
@@ -122,7 +115,7 @@ public:
122 115
 			size_t comma = secondsStr.find(',');
123 116
 			if (comma != std::string::npos)
124 117
 				secondsStr[comma] = '.';
125
-			seconds = convertTo<double>(secondsStr, false);
118
+			seconds = convertTo<double>(secondsStr);
126 119
 		}
127 120
 		seconds += minutes * 60 + hours * 1440;
128 121
 		return static_cast<unsigned long>(std::floor(seconds * 1000 + 0.5));
... ...
@@ -137,14 +130,14 @@ public:
137 130
 	{
138 131
 		double seconds = time / 1000.0;
139 132
 		if (seconds < 60)
140
-			return stringify(seconds);
133
+			return std::to_string(seconds);
141 134
 		unsigned long minutes = static_cast<unsigned long>(seconds) / 60;
142 135
 		seconds -= minutes * 60;
143 136
 		if (minutes < 60)
144
-			return stringify(minutes) + ":" + (seconds < 10 ? "0" : "") + stringify(seconds);
137
+			return std::to_string(minutes) + ":" + (seconds < 10 ? "0" : "") + std::to_string(seconds);
145 138
 		unsigned long hours = minutes / 60;
146 139
 		minutes %= 60;
147
-		return stringify(hours) + ":" + (minutes < 10 ? "0" : "") + stringify(minutes) + ":" + (seconds < 10 ? "0" : "") + stringify(seconds);
140
+		return std::to_string(hours) + ":" + (minutes < 10 ? "0" : "") + std::to_string(minutes) + ":" + (seconds < 10 ? "0" : "") + std::to_string(seconds);
148 141
 	}
149 142
 
150 143
 	static std::wstring MSToWString(unsigned long time)
... ...
@@ -335,7 +335,7 @@ template<typename T> int wrapperWinampGetExtendedFileInfo(const XSFFile &file, c
335 335
 				return 0;
336 336
 			}
337 337
 			else if (eqstr(tagToGet, "length"))
338
-				tag = stringify(file.GetLengthMS(xSFConfig->GetDefaultLength()) + file.GetFadeMS(xSFConfig->GetDefaultFade()));
338
+				tag = std::to_string(file.GetLengthMS(xSFConfig->GetDefaultLength()) + file.GetFadeMS(xSFConfig->GetDefaultFade()));
339 339
 			else
340 340
 				tag = file.GetTagValue(tagToGet);
341 341
 			CopyToString(tag.substr(0, destlen - 1), dest);