From 060a50ab117826ae994ce44031f79d4bf13b6586 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu <tsuda.kageyu@gmail.com> Date: Wed, 2 Dec 2015 11:30:29 +0900 Subject: [PATCH] Use a standard type rather than TagLib::wchar. This won't break the ABI compatibility. --- taglib/mpeg/id3v1/id3v1genres.cpp | 2 +- taglib/toolkit/taglib.h | 2 +- taglib/toolkit/tstring.cpp | 4 ++-- taglib/toolkit/tstring.h | 8 ++++---- tests/test_ogg.cpp | 2 +- tests/test_oggflac.cpp | 2 +- tests/test_opus.cpp | 2 +- tests/test_speex.cpp | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/taglib/mpeg/id3v1/id3v1genres.cpp b/taglib/mpeg/id3v1/id3v1genres.cpp index def91910..1c707c30 100644 --- a/taglib/mpeg/id3v1/id3v1genres.cpp +++ b/taglib/mpeg/id3v1/id3v1genres.cpp @@ -29,7 +29,7 @@ using namespace TagLib; namespace { - const wchar *genres[] = { + const wchar_t *genres[] = { L"Blues", L"Classic Rock", L"Country", diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index ef7650ce..e9116e6d 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -73,7 +73,7 @@ namespace TagLib { * Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3) * so I'm providing something here that should be constant. */ - typedef std::basic_string<wchar> wstring; + typedef std::basic_string<wchar_t> wstring; } /*! diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp index 18b44d1a..9d68a23f 100644 --- a/taglib/toolkit/tstring.cpp +++ b/taglib/toolkit/tstring.cpp @@ -635,13 +635,13 @@ String String::number(int n) // static return Utils::formatString("%d", n); } -TagLib::wchar &String::operator[](int i) +wchar_t &String::operator[](int i) { detach(); return d->data[i]; } -const TagLib::wchar &String::operator[](int i) const +const wchar_t &String::operator[](int i) const { return d->data[i]; } diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h index d00d4947..839b2f23 100644 --- a/taglib/toolkit/tstring.h +++ b/taglib/toolkit/tstring.h @@ -86,8 +86,8 @@ namespace TagLib { public: #ifndef DO_NOT_DOCUMENT - typedef std::basic_string<wchar>::iterator Iterator; - typedef std::basic_string<wchar>::const_iterator ConstIterator; + typedef TagLib::wstring::iterator Iterator; + typedef TagLib::wstring::const_iterator ConstIterator; #endif /** @@ -395,12 +395,12 @@ namespace TagLib { /*! * Returns a reference to the character at position \a i. */ - wchar &operator[](int i); + wchar_t &operator[](int i); /*! * Returns a const reference to the character at position \a i. */ - const wchar &operator[](int i) const; + const wchar_t &operator[](int i) const; /*! * Compares each character of the String with each character of \a s and diff --git a/tests/test_ogg.cpp b/tests/test_ogg.cpp index 6a671d48..45620d61 100644 --- a/tests/test_ogg.cpp +++ b/tests/test_ogg.cpp @@ -49,7 +49,7 @@ public: String longText(std::string(128 * 1024, ' ').c_str()); for (size_t i = 0; i < longText.length(); ++i) - longText[i] = static_cast<wchar>(L'A' + (i % 26)); + longText[i] = static_cast<wchar_t>(L'A' + (i % 26)); { Vorbis::File f(newname.c_str()); diff --git a/tests/test_oggflac.cpp b/tests/test_oggflac.cpp index 737a7261..58781ea0 100644 --- a/tests/test_oggflac.cpp +++ b/tests/test_oggflac.cpp @@ -54,7 +54,7 @@ public: String longText(std::string(128 * 1024, ' ').c_str()); for(size_t i = 0; i < longText.length(); ++i) - longText[i] = static_cast<wchar>(L'A' + (i % 26)); + longText[i] = static_cast<wchar_t>(L'A' + (i % 26)); { Ogg::FLAC::File f(newname.c_str()); diff --git a/tests/test_opus.cpp b/tests/test_opus.cpp index 3113e55f..1d08d017 100644 --- a/tests/test_opus.cpp +++ b/tests/test_opus.cpp @@ -70,7 +70,7 @@ public: String longText(std::string(128 * 1024, ' ').c_str()); for(size_t i = 0; i < longText.length(); ++i) - longText[i] = static_cast<wchar>(L'A' + (i % 26)); + longText[i] = static_cast<wchar_t>(L'A' + (i % 26)); { Ogg::Opus::File f(newname.c_str()); diff --git a/tests/test_speex.cpp b/tests/test_speex.cpp index 258795ab..2bbdbc90 100644 --- a/tests/test_speex.cpp +++ b/tests/test_speex.cpp @@ -35,7 +35,7 @@ public: String longText(std::string(128 * 1024, ' ').c_str()); for (size_t i = 0; i < longText.length(); ++i) - longText[i] = static_cast<wchar>(L'A' + (i % 26)); + longText[i] = static_cast<wchar_t>(L'A' + (i % 26)); { Ogg::Speex::File f(newname.c_str()); -- 2.40.0