feat(Core/Common): add support fmt style for ASSERT and ABORT (#10355)

* feat(Core/Common): add support fmt style for ASSERT and ABORT

* correct CheckCompactArrayMaskOverflow

* 1

* Update src/server/game/Spells/Spell.cpp
This commit is contained in:
Kargatum
2022-01-26 05:15:51 +07:00
committed by GitHub
parent 2fec54c442
commit e8f34b2309
14 changed files with 411 additions and 152 deletions

View File

@@ -193,11 +193,11 @@ void BigNumber::GetBytes(uint8* buf, size_t bufsize, bool littleEndian) const
{
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
int nBytes = GetNumBytes();
ASSERT(nBytes >= 0, "Bignum has negative number of bytes (%d).", nBytes);
ASSERT(nBytes >= 0, "Bignum has negative number of bytes ({}).", nBytes);
std::size_t numBytes = static_cast<std::size_t>(nBytes);
// too large to store
ASSERT(numBytes <= bufsize, "Buffer of size %zu is too small to hold bignum with %zu bytes.\n", bufsize, numBytes);
ASSERT(numBytes <= bufsize, "Buffer of size {} is too small to hold bignum with {} bytes.\n", bufsize, numBytes);
// If we need more bytes than length of BigNumber set the rest to 0
if (numBytes < bufsize)
@@ -214,7 +214,7 @@ void BigNumber::GetBytes(uint8* buf, size_t bufsize, bool littleEndian) const
}
#else
int res = littleEndian ? BN_bn2lebinpad(_bn, buf, bufsize) : BN_bn2binpad(_bn, buf, bufsize);
ASSERT(res > 0, "Buffer of size %zu is too small to hold bignum with %d bytes.\n", bufsize, BN_num_bytes(_bn));
ASSERT(res > 0, "Buffer of size {} is too small to hold bignum with {} bytes.\n", bufsize, BN_num_bytes(_bn));
#endif
}