[Bf-blender-cvs] [75a4872c90f] master: Cleanup: declare original function storage variables static

Campbell Barton noreply at git.blender.org
Wed Nov 18 02:59:55 CET 2020


Commit: 75a4872c90fb809fdb1df9a6270df940dcf97c44
Author: Campbell Barton
Date:   Wed Nov 18 12:43:33 2020 +1100
Branches: master
https://developer.blender.org/rB75a4872c90fb809fdb1df9a6270df940dcf97c44

Cleanup: declare original function storage variables static

Also minor comment formatting changes.

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

M	source/blender/gpu/opengl/gl_debug_layer.cc

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

diff --git a/source/blender/gpu/opengl/gl_debug_layer.cc b/source/blender/gpu/opengl/gl_debug_layer.cc
index 188083b0f50..9c2b6c0e547 100644
--- a/source/blender/gpu/opengl/gl_debug_layer.cc
+++ b/source/blender/gpu/opengl/gl_debug_layer.cc
@@ -42,7 +42,7 @@ typedef void *GPUvoidptr;
 #define void_ret
 
 #define DEBUG_FUNC_DECLARE(pfn, rtn_type, fn, ...) \
-  pfn real_##fn; \
+  static pfn real_##fn; \
   static rtn_type GLAPIENTRY debug_##fn(ARG_LIST(__VA_ARGS__)) \
   { \
     debug::check_gl_error("generated before " #fn); \
@@ -54,7 +54,7 @@ typedef void *GPUvoidptr;
 namespace blender::gpu::debug {
 
 /* List of wrapped functions. We dont have to support all of them.
- * Some functions might be declared as extern in GLEW. We cannot override them in this case.
+ * Some functions might be declared as `extern` in GLEW. We cannot override them in this case.
  * Keep the list in alphabetical order. */
 
 /* Avoid very long declarations. */
@@ -105,9 +105,11 @@ DEBUG_FUNC_DECLARE(PFNGLUSEPROGRAMPROC, void, glUseProgram, GLuint, program);
 
 #undef DEBUG_FUNC_DECLARE
 
-/* Init a fallback layer (to KHR_debug) that covers only some functions.
- * We override the functions pointers by our own implementation that just checks glGetError.
- * Some additional functions (not overridable) are covered inside the header using wrappers. */
+/**
+ * Initialize a fallback layer (to KHR_debug) that covers only some functions.
+ * We override the functions pointers by our own implementation that just checks #glGetError.
+ * Some additional functions (not overridable) are covered inside the header using wrappers.
+ */
 void init_debug_layer()
 {
 #define DEBUG_WRAP(function) \



More information about the Bf-blender-cvs mailing list