1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-15 22:57:12 +02:00

Lazy fix for new changes to cpp fmt library.

This commit is contained in:
Sandu Liviu Catalin
2021-07-03 14:09:58 +03:00
parent 69d1b6a919
commit a710ceebff
19 changed files with 92 additions and 92 deletions

View File

@ -283,13 +283,13 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// Make sure that the specified element is withing buffer range
else if (n > (m_Cap - sizeof(T)))
{
ThrowMemExcept("Element of size (%d) at index (%u) is out of buffer capacity (%u)",
ThrowMemExcept(fmt::runtime("Element of size (%d) at index (%u) is out of buffer capacity (%u)"),
sizeof(T), n, m_Cap);
}
// Return the requested element
@ -304,13 +304,13 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// Make sure that the specified element is withing buffer range
else if (n > (m_Cap - sizeof(T)))
{
ThrowMemExcept("Element of size (%d) at index (%u) is out of buffer capacity (%u)",
ThrowMemExcept(fmt::runtime("Element of size (%d) at index (%u) is out of buffer capacity (%u)"),
sizeof(T), n, m_Cap);
}
// Return the requested element
@ -357,7 +357,7 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -372,7 +372,7 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -387,7 +387,7 @@ public:
// Make sure that the buffer can host at least two elements of this type
if (m_Cap < (sizeof(T) * 2))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host two elements of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host two elements of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -402,7 +402,7 @@ public:
// Make sure that the buffer can host at least two elements of this type
if (m_Cap < (sizeof(T) * 2))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host two elements of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host two elements of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -417,7 +417,7 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -432,7 +432,7 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -447,7 +447,7 @@ public:
// Make sure that the buffer can host at least two elements of this type
if (m_Cap < (sizeof(T) * 2))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host two elements of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host two elements of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -462,7 +462,7 @@ public:
// Make sure that the buffer can host at least two elements of this type
if (m_Cap < (sizeof(T) * 2))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host two elements of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host two elements of size (%u)"),
m_Cap, sizeof(T));
}
// Return the requested element
@ -538,7 +538,7 @@ public:
// Make sure that at least one element of this type exists after the cursor
if ((m_Cur + sizeof(T)) > m_Cap)
{
ThrowMemExcept("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)",
ThrowMemExcept(fmt::runtime("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)"),
sizeof(T), m_Cur, m_Cap);
}
// Return the requested element
@ -553,7 +553,7 @@ public:
// Make sure that at least one element of this type exists after the cursor
if ((m_Cur + sizeof(T)) > m_Cap)
{
ThrowMemExcept("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)",
ThrowMemExcept(fmt::runtime("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)"),
sizeof(T), m_Cur, m_Cap);
}
// Return the requested element
@ -568,7 +568,7 @@ public:
// The cursor must have at least one element of this type behind
if (m_Cur < sizeof(T))
{
ThrowMemExcept("Cannot read an element of size (%u) before the cursor at (%u)",
ThrowMemExcept(fmt::runtime("Cannot read an element of size (%u) before the cursor at (%u)"),
sizeof(T), m_Cur);
}
// Return the requested element
@ -583,7 +583,7 @@ public:
// The cursor must have at least one element of this type behind
if (m_Cur < sizeof(T))
{
ThrowMemExcept("Cannot read an element of size (%u) before the cursor at (%u)",
ThrowMemExcept(fmt::runtime("Cannot read an element of size (%u) before the cursor at (%u)"),
sizeof(T), m_Cur);
}
// Return the requested element
@ -598,13 +598,13 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// There must be buffer left for at least two elements of this type after the cursor
else if ((m_Cur + (sizeof(T) * 2)) > m_Cap)
{
ThrowMemExcept("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)",
ThrowMemExcept(fmt::runtime("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)"),
sizeof(T), m_Cur + sizeof(T), m_Cap);
}
// Return the requested element
@ -619,13 +619,13 @@ public:
// Make sure that the buffer can host at least one element of this type
if (m_Cap < sizeof(T))
{
ThrowMemExcept("Buffer capacity of (%u) is unable to host an element of size (%u)",
ThrowMemExcept(fmt::runtime("Buffer capacity of (%u) is unable to host an element of size (%u)"),
m_Cap, sizeof(T));
}
// There must be buffer left for at least two elements of this type after the cursor
else if ((m_Cur + (sizeof(T) * 2)) > m_Cap)
{
ThrowMemExcept("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)",
ThrowMemExcept(fmt::runtime("Element of size (%u) starting at (%u) exceeds buffer capacity (%u)"),
sizeof(T), m_Cur + sizeof(T), m_Cap);
}
// Return the requested element
@ -706,7 +706,7 @@ public:
// See if the requested capacity doesn't exceed the limit
if (n > Max< T >())
{
ThrowMemExcept("Requested buffer of (%u) elements exceeds the (%u) limit", n, Max< T >());
ThrowMemExcept(fmt::runtime("Requested buffer of (%u) elements exceeds the (%u) limit"), n, Max< T >());
}
// Is there an existing buffer?
else if (n && !m_Cap)

View File

@ -133,7 +133,7 @@ void SqThrowLastF(const SQChar * msg, ...)
if(error_num == 0)
{
// Invoker is responsible for making sure this doesn't happen!
SqThrowF("{} [Unknown error]", b.Data());
SqThrowF(fmt::runtime("{} [Unknown error]"), b.Data());
}
// The resulted message buffer
LPSTR msg_buff = nullptr;
@ -147,7 +147,7 @@ void SqThrowLastF(const SQChar * msg, ...)
//Free the message buffer
LocalFree(msg_buff);
// Now it's safe to throw the error
SqThrowF("{} [{}]", b.Data(), message);
SqThrowF(fmt::runtime("{} [{}]"), b.Data(), message);
#else
SqThrowF("{} [{}]", b.Data(), std::strerror(errno));
#endif // SQMOD_OS_WINDOWS

View File

@ -99,7 +99,7 @@ void ScriptSrc::Process()
// Read completely?
if (r != static_cast< size_t >(length))
{
return SqThrowF("Failed to read script contents."); // Not cool
return SqThrowF(fmt::runtime("Failed to read script contents.")); // Not cool
}
// Where the last line ended
size_t line_start = 0, line_end = 0;