From d307c24a8bb970541a90afb48934247a3e32d951 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Oct 2015 02:46:38 +1100 Subject: Cleanup: style Also use gcc style file:line: syntax for errors. --- source/blender/gpu/intern/gpu_debug.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index 1c194f517aa..29b7ff11586 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -43,7 +43,7 @@ #define CASE_CODE_RETURN_STR(code) case code: return #code; -static const char* gpu_gl_error_symbol(GLenum err) +static const char *gpu_gl_error_symbol(GLenum err) { switch (err) { CASE_CODE_RETURN_STR(GL_NO_ERROR) @@ -81,8 +81,8 @@ static bool gpu_report_gl_errors(const char *file, int line, const char *str) } else { /* glGetError should have cleared the error flag, so if we get the - same flag twice that means glGetError itself probably triggered - the error. This happens on Windows if the GL context is invalid. + * same flag twice that means glGetError itself probably triggered + * the error. This happens on Windows if the GL context is invalid. */ { GLenum new_error = glGetError(); @@ -92,22 +92,18 @@ static bool gpu_report_gl_errors(const char *file, int line, const char *str) } } - fprintf( - stderr, - "%s(%d): ``%s'' -> GL Error (0x%04X - %s): %s\n", - file, - line, - str, - gl_error, - gpu_gl_error_symbol(gl_error), - gpuErrorString(gl_error)); + fprintf(stderr, + "%s:%d: ``%s'' -> GL Error (0x%04X - %s): %s\n", + file, line, str, gl_error, + gpu_gl_error_symbol(gl_error), + gpuErrorString(gl_error)); return false; } } -const char* gpuErrorString(GLenum err) +const char *gpuErrorString(GLenum err) { switch (err) { case GL_NO_ERROR: @@ -208,9 +204,9 @@ void gpu_debug_init(void) if (GLEW_KHR_debug) { #ifndef GLEW_ES_ONLY - glDebugMessageCallback(gpu_debug_proc, mxGetCurrentContext()); - glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); - GPU_string_marker(sizeof(success), success); + glDebugMessageCallback(gpu_debug_proc, mxGetCurrentContext()); + glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); + GPU_string_marker(sizeof(success), success); #endif return; } @@ -324,7 +320,7 @@ void GPU_print_error_debug(const char *str) } -void GPU_assert_no_gl_errors(const char* file, int line, const char* str) +void GPU_assert_no_gl_errors(const char *file, int line, const char *str) { if (G.debug) { GLboolean gl_ok = gpu_report_gl_errors(file, line, str); -- cgit v1.2.3