From daa7f8619eae3fb4c28e0f982fda455d84454a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 17 Feb 2018 12:26:45 -0800 Subject: [PATCH] Removed use of wchar_t. --- include/bx/string.h | 8 -------- src/string.cpp | 38 +------------------------------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/include/bx/string.h b/include/bx/string.h index 6bcbf66..21ea84c 100644 --- a/include/bx/string.h +++ b/include/bx/string.h @@ -244,17 +244,9 @@ namespace bx /// enough space had been available. int32_t vsnprintf(char* _out, int32_t _max, const char* _format, va_list _argList); - /// Cross platform implementation of vsnwprintf that returns number of - /// characters which would have been written to the final string if - /// enough space had been available. - int32_t vsnwprintf(wchar_t* _out, int32_t _max, const wchar_t* _format, va_list _argList); - /// int32_t snprintf(char* _out, int32_t _max, const char* _format, ...); - /// - int32_t swnprintf(wchar_t* _out, int32_t _max, const wchar_t* _format, ...); - /// template void stringPrintfVargs(Ty& _out, const char* _format, va_list _argList); diff --git a/src/string.cpp b/src/string.cpp index b2bf621..4b0d00f 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -10,8 +10,7 @@ #include #if !BX_CRT_NONE -# include // vsnprintf, vsnwprintf -# include // vswprintf +# include // vsnprintf #endif // !BX_CRT_NONE namespace bx @@ -1113,41 +1112,6 @@ namespace bx return total; } - int32_t vsnwprintf(wchar_t* _out, int32_t _max, const wchar_t* _format, va_list _argList) - { - va_list argList; - va_copy(argList, _argList); - int32_t total = 0; -#if BX_CRT_NONE - BX_UNUSED(_out, _max, _format, argList); -#elif BX_CRT_MSVC - int32_t len = -1; - if (NULL != _out) - { - va_list argListCopy; - va_copy(argListCopy, _argList); - len = ::_vsnwprintf_s(_out, _max, size_t(-1), _format, argListCopy); - va_end(argListCopy); - } - total = -1 == len ? ::_vscwprintf(_format, _argList) : len; -#elif BX_CRT_MINGW - total = ::vsnwprintf(_out, _max, _format, argList); -#else - total = ::vswprintf(_out, _max, _format, argList); -#endif // BX_COMPILER_MSVC - va_end(argList); - return total; - } - - int32_t swnprintf(wchar_t* _out, int32_t _max, const wchar_t* _format, ...) - { - va_list argList; - va_start(argList, _format); - int32_t len = vsnwprintf(_out, _max, _format, argList); - va_end(argList); - return len; - } - static const char s_units[] = { 'B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y' }; template