From 4467292a2d5a5e0fbe2c3a28f8ffb1480c7b66ed Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 21 Jan 2019 10:32:14 +0100 Subject: [PATCH] Review last PR formatting --- src/raylib.h | 12 ++++++------ src/utils.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 11fe145b..f104ada8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -423,14 +423,14 @@ typedef enum { // Trace log type typedef enum { - LOG_ALL, // Display all logs + LOG_ALL, // Display all logs LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_FATAL, - LOG_NONE // Disable logging + LOG_NONE // Disable logging } TraceLogType; // Keyboard keys @@ -900,10 +900,10 @@ RLAPI Color Fade(Color color, float alpha); // Color fade- // Misc. functions RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS) -RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level. -RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level. -RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging bypassing raylib's one -RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG) +RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level +RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging +RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) diff --git a/src/utils.c b/src/utils.c index ffce11fb..9bf91896 100644 --- a/src/utils.c +++ b/src/utils.c @@ -66,8 +66,7 @@ AAssetManager *assetManager; //---------------------------------------------------------------------------------- #if defined(PLATFORM_ANDROID) /* This should be in , but Travis doesn't find it... */ -FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int), - int (*writefn)(void *, const char *, int), +FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int), int (*writefn)(void *, const char *, int), fpos_t (*seekfn)(void *, fpos_t, int), int (*closefn)(void *)); static int android_read(void *cookie, char *buf, int size); @@ -80,19 +79,19 @@ static int android_close(void *cookie); // Module Functions Definition - Utilities //---------------------------------------------------------------------------------- -// Set the current threshold (minimum) log level. +// Set the current threshold (minimum) log level void SetTraceLogLevel(int logType) { logTypeLevel = logType; } -// Set the exit threshold (minimum) log level. +// Set the exit threshold (minimum) log level void SetTraceLogExit(int logType) { logTypeExit = logType; } -// Set a trace log callback to enable custom logging bypassing raylib's one +// Set a trace log callback to enable custom logging void SetTraceLogCallback(TraceLogCallback callback) { logCallback = callback; @@ -102,9 +101,8 @@ void SetTraceLogCallback(TraceLogCallback callback) void TraceLog(int logType, const char *text, ...) { #if defined(SUPPORT_TRACELOG) - if (logType < logTypeLevel) { // Message has level below current threshold, don't emit. - return; - } + // Message has level below current threshold, don't emit + if (logType < logTypeLevel) return; va_list args; va_start(args, text);