diff options
Diffstat (limited to 'thirdparty/bullet/Bullet3Common/b3Logging.cpp')
-rw-r--r-- | thirdparty/bullet/Bullet3Common/b3Logging.cpp | 87 |
1 files changed, 36 insertions, 51 deletions
diff --git a/thirdparty/bullet/Bullet3Common/b3Logging.cpp b/thirdparty/bullet/Bullet3Common/b3Logging.cpp index a8e9507155..9c9f7c09ea 100644 --- a/thirdparty/bullet/Bullet3Common/b3Logging.cpp +++ b/thirdparty/bullet/Bullet3Common/b3Logging.cpp @@ -20,17 +20,16 @@ subject to the following restrictions: #ifdef _WIN32 #include <windows.h> -#endif //_WIN32 - +#endif //_WIN32 void b3PrintfFuncDefault(const char* msg) { #ifdef _WIN32 OutputDebugStringA(msg); #endif - printf("%s",msg); - //is this portable? - fflush(stdout); + printf("%s", msg); + //is this portable? + fflush(stdout); } void b3WarningMessageFuncDefault(const char* msg) @@ -38,32 +37,26 @@ void b3WarningMessageFuncDefault(const char* msg) #ifdef _WIN32 OutputDebugStringA(msg); #endif - printf("%s",msg); - //is this portable? - fflush(stdout); - + printf("%s", msg); + //is this portable? + fflush(stdout); } - void b3ErrorMessageFuncDefault(const char* msg) { #ifdef _WIN32 OutputDebugStringA(msg); #endif - printf("%s",msg); + printf("%s", msg); - //is this portable? - fflush(stdout); - + //is this portable? + fflush(stdout); } - - static b3PrintfFunc* b3s_printfFunc = b3PrintfFuncDefault; static b3WarningMessageFunc* b3s_warningMessageFunc = b3WarningMessageFuncDefault; static b3ErrorMessageFunc* b3s_errorMessageFunc = b3ErrorMessageFuncDefault; - ///The developer can route b3Printf output using their own implementation void b3SetCustomPrintfFunc(b3PrintfFunc* printfFunc) { @@ -81,54 +74,50 @@ void b3SetCustomErrorMessageFunc(b3PrintfFunc* errorMessageFunc) //#define B3_MAX_DEBUG_STRING_LENGTH 2048 #define B3_MAX_DEBUG_STRING_LENGTH 32768 - -void b3OutputPrintfVarArgsInternal(const char *str, ...) +void b3OutputPrintfVarArgsInternal(const char* str, ...) { - char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0}; - va_list argList; - va_start(argList, str); + char strDebug[B3_MAX_DEBUG_STRING_LENGTH] = {0}; + va_list argList; + va_start(argList, str); #ifdef _MSC_VER - vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); + vsprintf_s(strDebug, B3_MAX_DEBUG_STRING_LENGTH, str, argList); #else - vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); + vsnprintf(strDebug, B3_MAX_DEBUG_STRING_LENGTH, str, argList); #endif - (b3s_printfFunc)(strDebug); - va_end(argList); + (b3s_printfFunc)(strDebug); + va_end(argList); } -void b3OutputWarningMessageVarArgsInternal(const char *str, ...) +void b3OutputWarningMessageVarArgsInternal(const char* str, ...) { - char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0}; - va_list argList; - va_start(argList, str); + char strDebug[B3_MAX_DEBUG_STRING_LENGTH] = {0}; + va_list argList; + va_start(argList, str); #ifdef _MSC_VER - vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); + vsprintf_s(strDebug, B3_MAX_DEBUG_STRING_LENGTH, str, argList); #else - vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); + vsnprintf(strDebug, B3_MAX_DEBUG_STRING_LENGTH, str, argList); #endif - (b3s_warningMessageFunc)(strDebug); - va_end(argList); + (b3s_warningMessageFunc)(strDebug); + va_end(argList); } -void b3OutputErrorMessageVarArgsInternal(const char *str, ...) +void b3OutputErrorMessageVarArgsInternal(const char* str, ...) { - - char strDebug[B3_MAX_DEBUG_STRING_LENGTH]={0}; - va_list argList; - va_start(argList, str); + char strDebug[B3_MAX_DEBUG_STRING_LENGTH] = {0}; + va_list argList; + va_start(argList, str); #ifdef _MSC_VER - vsprintf_s(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); + vsprintf_s(strDebug, B3_MAX_DEBUG_STRING_LENGTH, str, argList); #else - vsnprintf(strDebug,B3_MAX_DEBUG_STRING_LENGTH,str,argList); + vsnprintf(strDebug, B3_MAX_DEBUG_STRING_LENGTH, str, argList); #endif - (b3s_errorMessageFunc)(strDebug); - va_end(argList); - + (b3s_errorMessageFunc)(strDebug); + va_end(argList); } - -void b3EnterProfileZoneDefault(const char* name) +void b3EnterProfileZoneDefault(const char* name) { } -void b3LeaveProfileZoneDefault() +void b3LeaveProfileZoneDefault() { } static b3EnterProfileZoneFunc* b3s_enterFunc = b3EnterProfileZoneDefault; @@ -151,10 +140,6 @@ void b3SetCustomLeaveProfileZoneFunc(b3LeaveProfileZoneFunc* leaveFunc) b3s_leaveFunc = leaveFunc; } - - - #ifndef _MSC_VER #undef vsprintf_s #endif - |