From: <man...@us...> - 2015-03-03 16:07:13
|
Revision: 4813 http://sourceforge.net/p/modplug/code/4813 Author: manxorist Date: 2015-03-03 16:07:07 +0000 (Tue, 03 Mar 2015) Log Message: ----------- [Ref] Silence charset conversion warnings related to file formats storing paths to external samples in locale encoding. There is nothing we can do in that case anyway, thus there is no use in emitting compiler warnings. Modified Paths: -------------- trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_mt2.cpp Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2015-03-03 15:55:39 UTC (rev 4812) +++ trunk/OpenMPT/common/mptPathString.h 2015-03-03 16:07:07 UTC (rev 4813) @@ -152,6 +152,7 @@ mpt::ustring ToUnicode() const { return mpt::ToUnicode(path); } #if defined(MPT_WITH_CHARSET_LOCALE) MPT_DEPRECATED_PATH static PathString FromLocale(const std::string &path) { return PathString(mpt::ToWide(mpt::CharsetLocale, path)); } + static PathString FromLocaleSilent(const std::string &path) { return PathString(mpt::ToWide(mpt::CharsetLocale, path)); } #endif static PathString FromUTF8(const std::string &path) { return PathString(mpt::ToWide(mpt::CharsetUTF8, path)); } static PathString FromWide(const std::wstring &path) { return PathString(path); } @@ -189,6 +190,7 @@ #endif mpt::ustring ToUnicode() const { return mpt::ToUnicode(mpt::CharsetLocale, path); } static PathString FromLocale(const std::string &path) { return PathString(path); } + static PathString FromLocaleSilent(const std::string &path) { return PathString(path); } static PathString FromUTF8(const std::string &path) { return PathString(mpt::ToCharset(mpt::CharsetLocale, mpt::CharsetUTF8, path)); } #if MPT_WSTRING_CONVERT static PathString FromWide(const std::wstring &path) { return PathString(mpt::ToCharset(mpt::CharsetLocale, path)); } Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2015-03-03 15:55:39 UTC (rev 4812) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2015-03-03 16:07:07 UTC (rev 4813) @@ -149,7 +149,7 @@ file.ReadString<mpt::String::maybeNullTerminated>(path, size); if(version <= 0x00000102) { - instrPaths[ins] = mpt::PathString::FromLocale(path); + instrPaths[ins] = mpt::PathString::FromLocaleSilent(path); } else { instrPaths[ins] = mpt::PathString::FromUTF8(path); @@ -264,7 +264,7 @@ FileReader file = GetFileReader(f); if(!ReadInstrumentFromFile(ins + 1, file, mayNormalize)) { - AddToLog("Unable to open instrument: " + instrPaths[ins].ToLocale()); + AddToLog(LogWarning, MPT_USTRING("Unable to open instrument: ") + instrPaths[ins].ToUnicode()); } } Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mt2.cpp 2015-03-03 15:55:39 UTC (rev 4812) +++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2015-03-03 16:07:07 UTC (rev 4813) @@ -1061,7 +1061,7 @@ // Relative path in same folder or sub folder filename = ".\\" + filename; } - SetSamplePath(i + 1, mpt::PathString::FromLocale(filename)); + SetSamplePath(i + 1, mpt::PathString::FromLocaleSilent(filename)); #else #if defined(MPT_WITH_CHARSET_LOCALE) AddToLog(LogWarning, mpt::String::Print(MPT_USTRING("Loading external sample %1 ('%2') failed: External samples are not supported."), i, mpt::ToUnicode(mpt::CharsetLocale, filename))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |