Update utils.c

This commit is contained in:
Ray 2019-01-15 12:32:41 +01:00
parent f1bcc131dc
commit c93bf336fe

View file

@ -36,9 +36,9 @@
#include "utils.h" #include "utils.h"
#if defined(PLATFORM_ANDROID) #if defined(PLATFORM_ANDROID)
#include <errno.h> #include <errno.h> // Required for: Android error types
#include <android/log.h> #include <android/log.h> // Required for: Android log system: __android_log_vprint()
#include <android/asset_manager.h> #include <android/asset_manager.h> // Required for: Android assets manager: AAsset, AAssetManager_open(), ...
#endif #endif
#include <stdlib.h> // Required for: malloc(), free() #include <stdlib.h> // Required for: malloc(), free()
@ -46,7 +46,7 @@
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() #include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end()
#include <string.h> // Required for: strlen(), strrchr(), strcmp() #include <string.h> // Required for: strlen(), strrchr(), strcmp()
#define MAX_TRACELOG_BUFFER_SIZE 128 // Max length of a trace-log message. #define MAX_TRACELOG_BUFFER_SIZE 128 // Max length of one trace-log message
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Global Variables Definition // Global Variables Definition
@ -95,7 +95,7 @@ void SetTraceLogCallback(TraceLogCallback callback)
void TraceLog(int msgType, const char *text, ...) void TraceLog(int msgType, const char *text, ...)
{ {
#if defined(SUPPORT_TRACELOG) #if defined(SUPPORT_TRACELOG)
char buffer[MAX_TRACELOG_BUFFER_SIZE]; char buffer[MAX_TRACELOG_BUFFER_SIZE] = { 0 };
va_list args; va_list args;
va_start(args, text); va_start(args, text);
@ -148,16 +148,6 @@ void TraceLog(int msgType, const char *text, ...)
#endif // SUPPORT_TRACELOG #endif // SUPPORT_TRACELOG
} }
// Keep track of memory allocated
// NOTE: mallocType defines the type of data allocated
/*
void RecordMalloc(int mallocType, int mallocSize, const char *msg)
{
// TODO: Investigate how to record memory allocation data...
// Maybe creating my own malloc function...
}
*/
#if defined(PLATFORM_ANDROID) #if defined(PLATFORM_ANDROID)
// Initialize asset manager from android app // Initialize asset manager from android app
void InitAssetManager(AAssetManager *manager) void InitAssetManager(AAssetManager *manager)