[Bf-blender-cvs] [b316aaa0d2d] master: Cleanup: use const variables

Campbell Barton noreply at git.blender.org
Fri Apr 30 08:18:15 CEST 2021


Commit: b316aaa0d2daa06b0e1d43c187f5e0b0a8b8a462
Author: Campbell Barton
Date:   Fri Apr 30 15:24:46 2021 +1000
Branches: master
https://developer.blender.org/rBb316aaa0d2daa06b0e1d43c187f5e0b0a8b8a462

Cleanup: use const variables

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

M	source/blender/gpu/intern/gpu_debug.cc
M	source/blender/gpu/intern/gpu_state.cc

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

diff --git a/source/blender/gpu/intern/gpu_debug.cc b/source/blender/gpu/intern/gpu_debug.cc
index 63e7024b74b..2d9fb7822ae 100644
--- a/source/blender/gpu/intern/gpu_debug.cc
+++ b/source/blender/gpu/intern/gpu_debug.cc
@@ -86,8 +86,8 @@ bool GPU_debug_group_match(const char *ref)
   if (ctx == nullptr) {
     return false;
   }
-  DebugStack &stack = ctx->debug_stack;
-  for (StringRef &name : stack) {
+  const DebugStack &stack = ctx->debug_stack;
+  for (const StringRef &name : stack) {
     if (name == ref) {
       return true;
     }
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index 782d25747bb..5c33066c720 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -248,7 +248,7 @@ eGPUWriteMask GPU_write_mask_get()
 
 uint GPU_stencil_mask_get()
 {
-  GPUStateMutable &state = Context::get()->state_manager->mutable_state;
+  const GPUStateMutable &state = Context::get()->state_manager->mutable_state;
   return state.stencil_write_mask;
 }
 
@@ -267,7 +267,7 @@ eGPUStencilTest GPU_stencil_test_get()
 /* NOTE: Already premultiplied by U.pixelsize. */
 float GPU_line_width_get()
 {
-  GPUStateMutable &state = Context::get()->state_manager->mutable_state;
+  const GPUStateMutable &state = Context::get()->state_manager->mutable_state;
   return state.line_width;
 }
 
@@ -292,7 +292,7 @@ void GPU_viewport_size_get_i(int coords[4])
 
 bool GPU_depth_mask_get()
 {
-  GPUState &state = Context::get()->state_manager->state;
+  const GPUState &state = Context::get()->state_manager->state;
   return (state.write_mask & GPU_WRITE_DEPTH) != 0;
 }



More information about the Bf-blender-cvs mailing list