[Bf-blender-cvs] [d307c24] master: Cleanup: style

Campbell Barton noreply at git.blender.org
Fri Oct 16 17:52:54 CEST 2015


Commit: d307c24a8bb970541a90afb48934247a3e32d951
Author: Campbell Barton
Date:   Sat Oct 17 02:46:38 2015 +1100
Branches: master
https://developer.blender.org/rBd307c24a8bb970541a90afb48934247a3e32d951

Cleanup: style

Also use gcc style file:line: syntax for errors.

===================================================================

M	source/blender/gpu/intern/gpu_debug.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c
index 1c194f5..29b7ff1 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);




More information about the Bf-blender-cvs mailing list