diff --git a/src/utils.c b/src/utils.c index 05cd59f2d..1cf5c0ff0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -32,21 +32,21 @@ #include "config.h" -#include "raylib.h" // WARNING: Required for: LogType enum +#include "raylib.h" // WARNING: Required for: LogType enum #include "utils.h" #if defined(PLATFORM_ANDROID) - #include - #include - #include + #include // Required for: Android error types + #include // Required for: Android log system: __android_log_vprint() + #include // Required for: Android assets manager: AAsset, AAssetManager_open(), ... #endif -#include // Required for: malloc(), free() -#include // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen() -#include // Required for: va_list, va_start(), vfprintf(), va_end() -#include // Required for: strlen(), strrchr(), strcmp() +#include // Required for: malloc(), free() +#include // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen() +#include // Required for: va_list, va_start(), vfprintf(), va_end() +#include // 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 @@ -95,7 +95,7 @@ void SetTraceLogCallback(TraceLogCallback callback) void TraceLog(int msgType, const char *text, ...) { #if defined(SUPPORT_TRACELOG) - char buffer[MAX_TRACELOG_BUFFER_SIZE]; + char buffer[MAX_TRACELOG_BUFFER_SIZE] = { 0 }; va_list args; va_start(args, text); @@ -148,16 +148,6 @@ void TraceLog(int msgType, const char *text, ...) #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) // Initialize asset manager from android app void InitAssetManager(AAssetManager *manager)