Tier1: fix type demotion warning

Promote type to signed size type.
This commit is contained in:
Kawe Mazidjatari 2024-02-03 23:53:22 +01:00
parent eae0d0964b
commit a2ceab52da
3 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@
#define FmtStrVSNPrintf( szBuf, nBufSize, bQuietTruncation, ppszFormat, nPrevLen, lastArg ) \ #define FmtStrVSNPrintf( szBuf, nBufSize, bQuietTruncation, ppszFormat, nPrevLen, lastArg ) \
do \ do \
{ \ { \
int result; \ ssize_t result; \
va_list arg_ptr; \ va_list arg_ptr; \
bool bTruncated = false; \ bool bTruncated = false; \
static int scAsserted = 0; \ static int scAsserted = 0; \

View File

@ -81,7 +81,7 @@ inline bool V_iswdigit(int c)
} }
void V_binarytohex(const byte* in, size_t inputbytes, char* out, size_t outsize); void V_binarytohex(const byte* in, size_t inputbytes, char* out, size_t outsize);
int V_vsnprintfRet(char* pDest, int maxLen, const char* pFormat, va_list params, bool* pbTruncated); ssize_t V_vsnprintfRet(char* pDest, size_t maxLen, const char* pFormat, va_list params, bool* pbTruncated);
// Strip white space at the beginning and end of a string // Strip white space at the beginning and end of a string
ssize_t V_StrTrim(char* pStr); ssize_t V_StrTrim(char* pStr);

View File

@ -266,12 +266,12 @@ void V_binarytohex(const byte* in, size_t inputbytes, char* out, size_t outsize)
} }
int V_vsnprintfRet(char* pDest, int maxLen, const char* pFormat, va_list params, bool* pbTruncated) ssize_t V_vsnprintfRet(char* pDest, size_t maxLen, const char* pFormat, va_list params, bool* pbTruncated)
{ {
Assert(maxLen > 0); Assert(maxLen > 0);
int len = _vsnprintf(pDest, maxLen, pFormat, params); ssize_t len = _vsnprintf(pDest, maxLen, pFormat, params);
bool bTruncated = (len < 0) || (len >= maxLen); const bool bTruncated = (len < 0) || (len >= (ssize_t)maxLen);
if (pbTruncated) if (pbTruncated)
{ {