If you have an issue with any of our projects. feel free to register.

Commit 24231ecd authored by Christopher Snowhill's avatar Christopher Snowhill

Update libopenmpt to version 0.5.4

parent b375f06f
MPT_SVNVERSION=13775
MPT_SVNURL=https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.5.3
MPT_SVNDATE=2020-10-25T14:02:16.624929Z
MPT_SVNVERSION=13932
MPT_SVNURL=https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.5.4
MPT_SVNDATE=2020-11-29T15:01:39.790705Z
#pragma once
#define OPENMPT_VERSION_SVNVERSION "13775"
#define OPENMPT_VERSION_REVISION 13775
#define OPENMPT_VERSION_SVNVERSION "13932"
#define OPENMPT_VERSION_REVISION 13932
#define OPENMPT_VERSION_DIRTY 0
#define OPENMPT_VERSION_MIXEDREVISIONS 0
#define OPENMPT_VERSION_URL "https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.5.3"
#define OPENMPT_VERSION_DATE "2020-10-25T14:02:16.624929Z"
#define OPENMPT_VERSION_URL "https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.5.4"
#define OPENMPT_VERSION_DATE "2020-11-29T15:01:39.790705Z"
#define OPENMPT_VERSION_IS_PACKAGE 1
......@@ -423,7 +423,7 @@ std::shared_ptr<const type> ReloadComponent()
}
static inline mpt::PathString GetComponentPath()
inline mpt::PathString GetComponentPath()
{
return ComponentManager::Instance()->GetComponentPath();
}
......@@ -454,7 +454,7 @@ std::shared_ptr<const type> GetComponent()
}
static inline mpt::PathString GetComponentPath()
inline mpt::PathString GetComponentPath()
{
return mpt::PathString();
}
......
......@@ -44,22 +44,22 @@ using std::endian;
static_assert(mpt::endian::big != mpt::endian::little, "platform with all scalar types having size 1 is not supported");
static constexpr mpt::endian get_endian() noexcept
constexpr mpt::endian get_endian() noexcept
{
return mpt::endian::native;
}
static constexpr bool endian_is_little() noexcept
constexpr bool endian_is_little() noexcept
{
return get_endian() == mpt::endian::little;
}
static constexpr bool endian_is_big() noexcept
constexpr bool endian_is_big() noexcept
{
return get_endian() == mpt::endian::big;
}
static constexpr bool endian_is_weird() noexcept
constexpr bool endian_is_weird() noexcept
{
return !endian_is_little() && !endian_is_big();
}
......@@ -128,7 +128,7 @@ static_assert(mpt::endian::big != mpt::endian::little, "platform with all scalar
namespace detail {
static MPT_FORCEINLINE mpt::endian endian_probe() noexcept
MPT_FORCEINLINE mpt::endian endian_probe() noexcept
{
using endian_probe_type = uint32;
static_assert(sizeof(endian_probe_type) == 4);
......@@ -154,7 +154,7 @@ namespace detail {
} // namespace detail
static MPT_FORCEINLINE mpt::endian get_endian() noexcept
MPT_FORCEINLINE mpt::endian get_endian() noexcept
{
#if MPT_COMPILER_MSVC
#pragma warning(push)
......@@ -172,17 +172,17 @@ static MPT_FORCEINLINE mpt::endian get_endian() noexcept
#endif // MPT_COMPILER_MSVC
}
static MPT_FORCEINLINE bool endian_is_little() noexcept
MPT_FORCEINLINE bool endian_is_little() noexcept
{
return get_endian() == mpt::endian::little;
}
static MPT_FORCEINLINE bool endian_is_big() noexcept
MPT_FORCEINLINE bool endian_is_big() noexcept
{
return get_endian() == mpt::endian::big;
}
static MPT_FORCEINLINE bool endian_is_weird() noexcept
MPT_FORCEINLINE bool endian_is_weird() noexcept
{
return !endian_is_little() && !endian_is_big();
}
......@@ -265,19 +265,19 @@ namespace mpt { namespace detail {
// catch system macros
#ifndef MPT_bswap16
#ifdef bswap16
static MPT_FORCEINLINE uint16 mpt_bswap16(uint16 x) { return bswap16(x); }
MPT_FORCEINLINE uint16 mpt_bswap16(uint16 x) { return bswap16(x); }
#define MPT_bswap16 mpt::detail::mpt_bswap16
#endif
#endif
#ifndef MPT_bswap32
#ifdef bswap32
static MPT_FORCEINLINE uint32 mpt_bswap32(uint32 x) { return bswap32(x); }
MPT_FORCEINLINE uint32 mpt_bswap32(uint32 x) { return bswap32(x); }
#define MPT_bswap32 mpt::detail::mpt_bswap32
#endif
#endif
#ifndef MPT_bswap64
#ifdef bswap64
static MPT_FORCEINLINE uint64 mpt_bswap64(uint64 x) { return bswap64(x); }
MPT_FORCEINLINE uint64 mpt_bswap64(uint64 x) { return bswap64(x); }
#define MPT_bswap64 mpt::detail::mpt_bswap64
#endif
#endif
......@@ -297,7 +297,7 @@ static MPT_FORCEINLINE uint64 mpt_bswap64(uint64 x) { return bswap64(x); }
template <typename T, typename Tendian, std::size_t size>
static MPT_CONSTEXPR17_FUN std::array<std::byte, size> EndianEncode(T val) noexcept
MPT_CONSTEXPR17_FUN std::array<std::byte, size> EndianEncode(T val) noexcept
{
static_assert(Tendian::endian == mpt::endian::little || Tendian::endian == mpt::endian::big);
static_assert(std::numeric_limits<T>::is_integer);
......@@ -325,7 +325,7 @@ static MPT_CONSTEXPR17_FUN std::array<std::byte, size> EndianEncode(T val) noexc
}
template <typename T, typename Tendian, std::size_t size>
static MPT_CONSTEXPR17_FUN T EndianDecode(std::array<std::byte, size> data) noexcept
MPT_CONSTEXPR17_FUN T EndianDecode(std::array<std::byte, size> data) noexcept
{
static_assert(Tendian::endian == mpt::endian::little || Tendian::endian == mpt::endian::big);
static_assert(std::numeric_limits<T>::is_integer);
......@@ -359,20 +359,20 @@ namespace mpt
namespace detail
{
static MPT_CONSTEXPR20_FUN uint64 SwapBytes(uint64 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap64(value); } else { return MPT_bswap64(value); } }
static MPT_CONSTEXPR20_FUN uint32 SwapBytes(uint32 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap32(value); } else { return MPT_bswap32(value); } }
static MPT_CONSTEXPR20_FUN uint16 SwapBytes(uint16 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap16(value); } else { return MPT_bswap16(value); } }
static MPT_CONSTEXPR20_FUN int64 SwapBytes(int64 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap64(value); } else { return MPT_bswap64(value); } }
static MPT_CONSTEXPR20_FUN int32 SwapBytes(int32 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap32(value); } else { return MPT_bswap32(value); } }
static MPT_CONSTEXPR20_FUN int16 SwapBytes(int16 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap16(value); } else { return MPT_bswap16(value); } }
MPT_CONSTEXPR20_FUN uint64 SwapBytes(uint64 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap64(value); } else { return MPT_bswap64(value); } }
MPT_CONSTEXPR20_FUN uint32 SwapBytes(uint32 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap32(value); } else { return MPT_bswap32(value); } }
MPT_CONSTEXPR20_FUN uint16 SwapBytes(uint16 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap16(value); } else { return MPT_bswap16(value); } }
MPT_CONSTEXPR20_FUN int64 SwapBytes(int64 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap64(value); } else { return MPT_bswap64(value); } }
MPT_CONSTEXPR20_FUN int32 SwapBytes(int32 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap32(value); } else { return MPT_bswap32(value); } }
MPT_CONSTEXPR20_FUN int16 SwapBytes(int16 value) noexcept { MPT_MAYBE_CONSTANT_IF(MPT_IS_CONSTANT_EVALUATED20()) { return MPT_constexpr_bswap16(value); } else { return MPT_bswap16(value); } }
// Do NOT remove these overloads, even if they seem useless.
// We do not want risking to extend 8bit integers to int and then
// endian-converting and casting back to int.
// Thus these overloads.
static MPT_CONSTEXPR20_FUN uint8 SwapBytes(uint8 value) noexcept { return value; }
static MPT_CONSTEXPR20_FUN int8 SwapBytes(int8 value) noexcept { return value; }
static MPT_CONSTEXPR20_FUN char SwapBytes(char value) noexcept { return value; }
MPT_CONSTEXPR20_FUN uint8 SwapBytes(uint8 value) noexcept { return value; }
MPT_CONSTEXPR20_FUN int8 SwapBytes(int8 value) noexcept { return value; }
MPT_CONSTEXPR20_FUN char SwapBytes(char value) noexcept { return value; }
} // namespace detail
} // namespace mpt
......@@ -387,7 +387,7 @@ static MPT_CONSTEXPR20_FUN char SwapBytes(char value) noexcept { return valu
// 1.0f --> 0x3f800000u
static MPT_FORCEINLINE uint32 EncodeIEEE754binary32(float32 f)
MPT_FORCEINLINE uint32 EncodeIEEE754binary32(float32 f)
{
if constexpr(mpt::float_traits<float32>::is_ieee754_binary32ne)
{
......@@ -419,7 +419,7 @@ static MPT_FORCEINLINE uint32 EncodeIEEE754binary32(float32 f)
}
}
}
static MPT_FORCEINLINE uint64 EncodeIEEE754binary64(float64 f)
MPT_FORCEINLINE uint64 EncodeIEEE754binary64(float64 f)
{
if constexpr(mpt::float_traits<float64>::is_ieee754_binary64ne)
{
......@@ -453,7 +453,7 @@ static MPT_FORCEINLINE uint64 EncodeIEEE754binary64(float64 f)
}
// 0x3f800000u --> 1.0f
static MPT_FORCEINLINE float32 DecodeIEEE754binary32(uint32 i)
MPT_FORCEINLINE float32 DecodeIEEE754binary32(uint32 i)
{
if constexpr(mpt::float_traits<float32>::is_ieee754_binary32ne)
{
......@@ -479,7 +479,7 @@ static MPT_FORCEINLINE float32 DecodeIEEE754binary32(uint32 i)
}
}
}
static MPT_FORCEINLINE float64 DecodeIEEE754binary64(uint64 i)
MPT_FORCEINLINE float64 DecodeIEEE754binary64(uint64 i)
{
if constexpr(mpt::float_traits<float64>::is_ieee754_binary64ne)
{
......
......@@ -1348,7 +1348,7 @@ using MemoryFileReader = detail::FileReader<FileReaderTraitsMemory>;
// Initialize file reader object with pointer to data and data length.
template <typename Tbyte> static inline FileReader make_FileReader(mpt::span<Tbyte> bytedata, const mpt::PathString *filename = nullptr)
template <typename Tbyte> inline FileReader make_FileReader(mpt::span<Tbyte> bytedata, const mpt::PathString *filename = nullptr)
{
return FileReader(mpt::byte_cast<mpt::const_byte_span>(bytedata), filename);
}
......@@ -1356,7 +1356,7 @@ template <typename Tbyte> static inline FileReader make_FileReader(mpt::span<Tby
#if defined(MPT_FILEREADER_CALLBACK_STREAM)
// Initialize file reader object with a CallbackStream.
static inline FileReader make_FileReader(CallbackStream s, const mpt::PathString *filename = nullptr)
inline FileReader make_FileReader(CallbackStream s, const mpt::PathString *filename = nullptr)
{
return FileReader(
FileDataContainerCallbackStreamSeekable::IsSeekable(s) ?
......@@ -1369,7 +1369,7 @@ static inline FileReader make_FileReader(CallbackStream s, const mpt::PathString
#endif // MPT_FILEREADER_CALLBACK_STREAM
// Initialize file reader object with a std::istream.
static inline FileReader make_FileReader(std::istream *s, const mpt::PathString *filename = nullptr)
inline FileReader make_FileReader(std::istream *s, const mpt::PathString *filename = nullptr)
{
return FileReader(
FileDataContainerStdStreamSeekable::IsSeekable(s) ?
......
......@@ -126,7 +126,7 @@ extern bool ConsoleEnabled;
void SetFacilities(const std::string &solo, const std::string &blocked);
bool IsFacilityActive(const char *facility);
#else
static MPT_FORCEINLINE bool IsFacilityActive(const char * /*facility*/ ) { return true; }
MPT_FORCEINLINE bool IsFacilityActive(const char * /*facility*/ ) { return true; }
#endif
......@@ -179,7 +179,7 @@ namespace Trace {
// if there are not multiple thread adding trace points at high frequency (way greater than 1000Hz),
// which, in OpenMPT, is only ever the case for just a single thread (the audio thread), if at all.
extern std::atomic<bool> g_Enabled;
static inline bool IsEnabled() { return g_Enabled; }
inline bool IsEnabled() { return g_Enabled; }
enum class Direction : int8
{
......
......@@ -52,13 +52,13 @@ extern uint8 ProcStepping;
void InitProcSupport();
// enabled processor features for inline asm and intrinsics
static inline uint32 GetProcSupport()
inline uint32 GetProcSupport()
{
return ProcSupport;
}
// available processor features
static inline uint32 GetRealProcSupport()
inline uint32 GetRealProcSupport()
{
return RealProcSupport;
}
......
......@@ -169,7 +169,7 @@ enum class FlushMode
Full = 2, // explicitly flush *all* layers, up to and including disk write caches
};
static inline FlushMode FlushModeFromBool(bool flush)
inline FlushMode FlushModeFromBool(bool flush)
{
return flush ? FlushMode::Full : FlushMode::None;
}
......
......@@ -277,17 +277,17 @@ public:
#if defined(MPT_ENABLE_CHARSET_LOCALE)
#if MPT_OS_WINDOWS
#ifdef UNICODE
[[deprecated]] static inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::Charset::Locale, x.ToUnicode()); }
[[deprecated]] inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::Charset::Locale, x.ToUnicode()); }
#else
MPT_DEPRECATED_PATH static inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::Charset::Locale, x.AsNative()); }
MPT_DEPRECATED_PATH inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::Charset::Locale, x.AsNative()); }
#endif
#else
MPT_DEPRECATED_PATH static inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::Charset::Locale, x.ToUnicode()); }
MPT_DEPRECATED_PATH inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::Charset::Locale, x.ToUnicode()); }
#endif
#endif
static inline mpt::ustring ToUString(const mpt::PathString & x) { return x.ToUnicode(); }
inline mpt::ustring ToUString(const mpt::PathString & x) { return x.ToUnicode(); }
#if MPT_WSTRING_FORMAT
static inline std::wstring ToWString(const mpt::PathString & x) { return x.ToWide(); }
inline std::wstring ToWString(const mpt::PathString & x) { return x.ToWide(); }
#endif
} // namespace mpt
......
......@@ -958,7 +958,7 @@ static widestring FromUTF8(const Tsrcstring &str, widechar replacement = wide_de
if ( charsleft == 0 ) {
if ( ( c & 0x80 ) == 0x00 ) {
out.push_back( (wchar_t)c );
out.push_back( (widechar)c );
} else if ( ( c & 0xE0 ) == 0xC0 ) {
ucs4 = c & 0x1F;
charsleft = 1;
......@@ -1030,7 +1030,7 @@ static Tdststring ToUTF8(const widestring &str, char replacement = '?')
for ( std::size_t i=0; i<in.length(); i++ ) {
wchar_t wc = in[i];
widechar wc = in[i];
char32_t ucs4 = 0;
if constexpr ( sizeof( widechar ) == 2 ) {
......
......@@ -179,7 +179,7 @@ inline Tstring Replace(Tstring str, const Tstring2 &oldStr_, const Tstring3 &new
} // namespace String
static inline std::string truncate(std::string str, std::size_t maxLen)
inline std::string truncate(std::string str, std::size_t maxLen)
{
if(str.length() > maxLen)
{
......@@ -343,10 +343,10 @@ using u8string = MPT_ENCODED_STRING_TYPE(mpt::Charset::UTF8);
// The wide encoding is UTF-16 or UTF-32, based on sizeof(wchar_t).
// If str does not contain any invalid characters, this conversion is lossless.
// Invalid source bytes will be replaced by some replacement character or string.
static inline std::wstring ToWide(const std::wstring &str) { return str; }
static inline std::wstring ToWide(const wchar_t * str) { return (str ? std::wstring(str) : std::wstring()); }
inline std::wstring ToWide(const std::wstring &str) { return str; }
inline std::wstring ToWide(const wchar_t * str) { return (str ? std::wstring(str) : std::wstring()); }
std::wstring ToWide(Charset from, const std::string &str);
static inline std::wstring ToWide(Charset from, const char * str) { return ToWide(from, str ? std::string(str) : std::string()); }
inline std::wstring ToWide(Charset from, const char * str) { return ToWide(from, str ? std::string(str) : std::string()); }
#if defined(MPT_ENABLE_CHARSET_LOCALE)
std::wstring ToWide(const mpt::lstring &str);
#endif // MPT_ENABLE_CHARSET_LOCALE
......@@ -360,10 +360,10 @@ std::wstring ToWide(const mpt::lstring &str);
// destination charset will be replaced by some replacement character or string.
#if MPT_WSTRING_CONVERT
std::string ToCharset(Charset to, const std::wstring &str);
static inline std::string ToCharset(Charset to, const wchar_t * str) { return ToCharset(to, str ? std::wstring(str) : std::wstring()); }
inline std::string ToCharset(Charset to, const wchar_t * str) { return ToCharset(to, str ? std::wstring(str) : std::wstring()); }
#endif
std::string ToCharset(Charset to, Charset from, const std::string &str);
static inline std::string ToCharset(Charset to, Charset from, const char * str) { return ToCharset(to, from, str ? std::string(str) : std::string()); }
inline std::string ToCharset(Charset to, Charset from, const char * str) { return ToCharset(to, from, str ? std::string(str) : std::string()); }
#if defined(MPT_ENABLE_CHARSET_LOCALE)
std::string ToCharset(Charset to, const mpt::lstring &str);
#endif // MPT_ENABLE_CHARSET_LOCALE
......@@ -371,20 +371,20 @@ std::string ToCharset(Charset to, const mpt::lstring &str);
#if defined(MPT_ENABLE_CHARSET_LOCALE)
#if MPT_WSTRING_CONVERT
mpt::lstring ToLocale(const std::wstring &str);
static inline mpt::lstring ToLocale(const wchar_t * str) { return ToLocale(str ? std::wstring(str): std::wstring()); }
inline mpt::lstring ToLocale(const wchar_t * str) { return ToLocale(str ? std::wstring(str): std::wstring()); }
#endif
mpt::lstring ToLocale(Charset from, const std::string &str);
static inline mpt::lstring ToLocale(Charset from, const char * str) { return ToLocale(from, str ? std::string(str): std::string()); }
static inline mpt::lstring ToLocale(const mpt::lstring &str) { return str; }
inline mpt::lstring ToLocale(Charset from, const char * str) { return ToLocale(from, str ? std::string(str): std::string()); }
inline mpt::lstring ToLocale(const mpt::lstring &str) { return str; }
#endif // MPT_ENABLE_CHARSET_LOCALE
#if MPT_OS_WINDOWS
#if MPT_WSTRING_CONVERT
mpt::winstring ToWin(const std::wstring &str);
static inline mpt::winstring ToWin(const wchar_t * str) { return ToWin(str ? std::wstring(str): std::wstring()); }
inline mpt::winstring ToWin(const wchar_t * str) { return ToWin(str ? std::wstring(str): std::wstring()); }
#endif
mpt::winstring ToWin(Charset from, const std::string &str);
static inline mpt::winstring ToWin(Charset from, const char * str) { return ToWin(from, str ? std::string(str): std::string()); }
inline mpt::winstring ToWin(Charset from, const char * str) { return ToWin(from, str ? std::string(str): std::string()); }
#if defined(MPT_ENABLE_CHARSET_LOCALE)
mpt::winstring ToWin(const mpt::lstring &str);
#endif // MPT_ENABLE_CHARSET_LOCALE
......@@ -399,11 +399,11 @@ mpt::winstring ToWin(const mpt::lstring &str);
// Convert to a MFC CString. The CString encoding depends on UNICODE.
// This should also be used when converting to TCHAR strings.
// If UNICODE is defined, this is a completely lossless operation.
static inline CString ToCString(const CString &str) { return str; }
inline CString ToCString(const CString &str) { return str; }
CString ToCString(const std::wstring &str);
static inline CString ToCString(const wchar_t * str) { return ToCString(str ? std::wstring(str) : std::wstring()); }
inline CString ToCString(const wchar_t * str) { return ToCString(str ? std::wstring(str) : std::wstring()); }
CString ToCString(Charset from, const std::string &str);
static inline CString ToCString(Charset from, const char * str) { return ToCString(from, str ? std::string(str) : std::string()); }
inline CString ToCString(Charset from, const char * str) { return ToCString(from, str ? std::string(str) : std::string()); }
#if defined(MPT_ENABLE_CHARSET_LOCALE)
CString ToCString(const mpt::lstring &str);
mpt::lstring ToLocale(const CString &str);
......@@ -476,24 +476,24 @@ using uchar = MPT_U8CHAR_TYPE;
#if !(MPT_WSTRING_CONVERT)
#error "MPT_USTRING_MODE_WIDE depends on MPT_WSTRING_CONVERT)"
#endif
static inline mpt::ustring ToUnicode(const std::wstring &str) { return str; }
static inline mpt::ustring ToUnicode(const wchar_t * str) { return (str ? std::wstring(str) : std::wstring()); }
static inline mpt::ustring ToUnicode(Charset from, const std::string &str) { return ToWide(from, str); }
static inline mpt::ustring ToUnicode(Charset from, const char * str) { return ToUnicode(from, str ? std::string(str) : std::string()); }
inline mpt::ustring ToUnicode(const std::wstring &str) { return str; }
inline mpt::ustring ToUnicode(const wchar_t * str) { return (str ? std::wstring(str) : std::wstring()); }
inline mpt::ustring ToUnicode(Charset from, const std::string &str) { return ToWide(from, str); }
inline mpt::ustring ToUnicode(Charset from, const char * str) { return ToUnicode(from, str ? std::string(str) : std::string()); }
#if defined(MPT_ENABLE_CHARSET_LOCALE)
static inline mpt::ustring ToUnicode(const mpt::lstring &str) { return ToWide(str); }
inline mpt::ustring ToUnicode(const mpt::lstring &str) { return ToWide(str); }
#endif // MPT_ENABLE_CHARSET_LOCALE
#if defined(MPT_WITH_MFC)
static inline mpt::ustring ToUnicode(const CString &str) { return ToWide(str); }
inline mpt::ustring ToUnicode(const CString &str) { return ToWide(str); }
#endif // MFC
#else // !MPT_USTRING_MODE_WIDE
static inline mpt::ustring ToUnicode(const mpt::ustring &str) { return str; }
inline mpt::ustring ToUnicode(const mpt::ustring &str) { return str; }
#if MPT_WSTRING_CONVERT
mpt::ustring ToUnicode(const std::wstring &str);
static inline mpt::ustring ToUnicode(const wchar_t * str) { return ToUnicode(str ? std::wstring(str) : std::wstring()); }
inline mpt::ustring ToUnicode(const wchar_t * str) { return ToUnicode(str ? std::wstring(str) : std::wstring()); }
#endif
mpt::ustring ToUnicode(Charset from, const std::string &str);
static inline mpt::ustring ToUnicode(Charset from, const char * str) { return ToUnicode(from, str ? std::string(str) : std::string()); }
inline mpt::ustring ToUnicode(Charset from, const char * str) { return ToUnicode(from, str ? std::string(str) : std::string()); }
#if defined(MPT_ENABLE_CHARSET_LOCALE)
mpt::ustring ToUnicode(const mpt::lstring &str);
#endif // MPT_ENABLE_CHARSET_LOCALE
......
......@@ -76,8 +76,8 @@ template <typename T> auto ToString(const T & x) -> decltype(mpt::ToCharset(mpt:
template <typename T> auto ToString(const T & x) -> decltype(mpt::ToCharset(mpt::CharsetLocaleOrUTF8, x.ToUString())) { return mpt::ToCharset(mpt::CharsetLocaleOrUTF8, x.ToUString()); }
#endif
static inline std::string ToString(const std::string & x) { return x; }
static inline std::string ToString(const char * const & x) { return x; }
inline std::string ToString(const std::string & x) { return x; }
inline std::string ToString(const char * const & x) { return x; }
std::string ToString(const char &x) = delete; // deprecated to catch potential API mis-use, use std::string(1, x) instead
#if MPT_WSTRING_FORMAT
std::string ToString(const std::wstring & x) = delete; // Unknown encoding.
......@@ -108,7 +108,7 @@ std::string ToString(const long double & x);
// fallback to member function ToUString()
template <typename T> auto ToUString(const T & x) -> decltype(x.ToUString()) { return x.ToUString(); }
static inline mpt::ustring ToUString(const mpt::ustring & x) { return x; }
inline mpt::ustring ToUString(const mpt::ustring & x) { return x; }
mpt::ustring ToUString(const std::string & x) = delete; // Unknown encoding.
mpt::ustring ToUString(const char * const & x) = delete; // Unknown encoding. Note that this also applies to TCHAR in !UNICODE builds as the type is indistinguishable from char. Wrap with CString or FromTcharStr in this case.
mpt::ustring ToUString(const char & x) = delete; // deprecated to catch potential API mis-use, use std::string(1, x) instead
......@@ -141,8 +141,8 @@ mpt::ustring ToUString(const long double & x);
std::wstring ToWString(const std::string & x) = delete; // Unknown encoding.
std::wstring ToWString(const char * const & x) = delete; // Unknown encoding. Note that this also applies to TCHAR in !UNICODE builds as the type is indistinguishable from char. Wrap with CString or FromTcharStr in this case.
std::wstring ToWString(const char & x) = delete; // deprecated to catch potential API mis-use, use std::string(1, x) instead
static inline std::wstring ToWString(const std::wstring & x) { return x; }
static inline std::wstring ToWString(const wchar_t * const & x) { return x; }
inline std::wstring ToWString(const std::wstring & x) { return x; }
inline std::wstring ToWString(const wchar_t * const & x) { return x; }
std::wstring ToWString(const wchar_t & x) = delete; // deprecated to catch potential API mis-use, use std::wstring(1, x) instead
#if MPT_USTRING_MODE_UTF8
std::wstring ToWString(const mpt::ustring & x);
......
......@@ -17,7 +17,7 @@ OPENMPT_NAMESPACE_BEGIN
// Version definitions. The only thing that needs to be changed when changing version number.
#define VER_MAJORMAJOR 1
#define VER_MAJOR 29
#define VER_MINOR 05
#define VER_MINOR 06
#define VER_MINORMINOR 00
OPENMPT_NAMESPACE_END
......@@ -5,6 +5,20 @@ Changelog {#changelog}
For fully detailed change log, please see the source repository directly. This
is just a high-level summary.
### libopenmpt 0.5.4 (2020-11-29)
* AMS: An upper bound for uncompressed sample size is now established to
avoid memory exhaustion from malformed files.
* DMF: Support early format beta versions (in particular versions 1-4).
* MED: Also use octave wrapping in 8-channel mode for MMD0/MMD1 modules.
* MED: If 8-channel mode is activated, ignore BPM mode.
* MED: Emulate tempo commands F01 and F02 quirk.
* MED: Tempo commands below 32 BPM were interpreted as tempo slides.
* IMF: Instrument sample mapping was off by one octave, notable in the guitar
part of Astaris by Karsten Koch.
* pugixml: Update to v1.11 (2020-11-26).
### libopenmpt 0.5.3 (2020-10-25)
* [**Sec**] Possible hang if a MED file claimed to contain 256 songs. (r13704)
......
......@@ -14,8 +14,6 @@
#include "libopenmpt_impl.hpp"
#include "libopenmpt_ext.hpp"
using namespace OpenMPT;
namespace openmpt {
class module_ext_impl
......
......@@ -19,7 +19,7 @@
/*! \brief libopenmpt minor version number */
#define OPENMPT_API_VERSION_MINOR 5
/*! \brief libopenmpt patch version number */
#define OPENMPT_API_VERSION_PATCH 3
#define OPENMPT_API_VERSION_PATCH 4
/*! \brief libopenmpt pre-release tag */
#define OPENMPT_API_VERSION_PREREL ""
/*! \brief libopenmpt pre-release flag */
......
LIBOPENMPT_VERSION_MAJOR=0
LIBOPENMPT_VERSION_MINOR=5
LIBOPENMPT_VERSION_PATCH=3
LIBOPENMPT_VERSION_PATCH=4
LIBOPENMPT_VERSION_PREREL=
LIBOPENMPT_LTVER_CURRENT=2
LIBOPENMPT_LTVER_REVISION=3
LIBOPENMPT_LTVER_REVISION=4
LIBOPENMPT_LTVER_AGE=2
......@@ -123,10 +123,9 @@ struct IMFInstrument
if(smpNum)
{
static_assert(mpt::array_size<decltype(mptIns.Keyboard)>::size >= mpt::array_size<decltype(map)>::size);
for(size_t note = 0; note < std::size(map); note++)
for(size_t note = 0; note < std::min(std::size(map), std::size(mptIns.Keyboard) - 12u); note++)
{
mptIns.Keyboard[note] = firstSample + map[note];
mptIns.Keyboard[note + 12] = firstSample + map[note];
}
}
......
......@@ -266,16 +266,20 @@ struct MMDInstrExt
// Below fields saved by >= V5
uint8be defaultPitch;
uint8be instrFlags;
uint16be longMidiPreset;
uint16be longMidiPreset; // Legacy MIDI program mode that doesn't use banks but a combination of two program change commands
// Below fields saved by >= V5.02
uint8be outputDevice;
uint8be reserved;
// Below fields saved by >= V7
uint32be loopStart;
uint32be loopLength;
// Not sure which version starts saving those but they are saved by MED Soundstudio for Windows
uint8 volume; // 0...127
uint8 outputPort; // Index into user-configurable device list (NOT WinAPI port index)
uint16le midiBank;
};
MPT_BINARY_STRUCT(MMDInstrExt, 18)
MPT_BINARY_STRUCT(MMDInstrExt, 22)
struct MMDInstrInfo
......@@ -350,9 +354,19 @@ struct MMDTag