[Bf-blender-cvs] [6d97f9a5c1c] master: Cleanup: use static local variables

Campbell Barton noreply at git.blender.org
Sun Mar 21 04:16:24 CET 2021


Commit: 6d97f9a5c1c77d30b4a1939ad81708a44f225280
Author: Campbell Barton
Date:   Sun Mar 21 13:58:34 2021 +1100
Branches: master
https://developer.blender.org/rB6d97f9a5c1c77d30b4a1939ad81708a44f225280

Cleanup: use static local variables

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

M	source/blender/blenkernel/intern/icons.cc
M	source/blender/blenlib/intern/BLI_mmap.c
M	source/blender/blenlib/tests/BLI_string_utf8_test.cc
M	source/blender/editors/animation/keyframes_general.c
M	source/blender/functions/tests/FN_cpp_type_test.cc
M	source/blender/modifiers/intern/MOD_boolean.c

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

diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc
index afb009b66cd..7e9f81f9c83 100644
--- a/source/blender/blenkernel/intern/icons.cc
+++ b/source/blender/blenkernel/intern/icons.cc
@@ -86,7 +86,7 @@ static int gNextIconId = 1;
 /* Protected by gIconMutex. */
 static int gFirstIconId = 1;
 
-std::mutex gIconMutex;
+static std::mutex gIconMutex;
 
 /* Not mutex-protected! */
 static GHash *gCachedPreviews = nullptr;
diff --git a/source/blender/blenlib/intern/BLI_mmap.c b/source/blender/blenlib/intern/BLI_mmap.c
index 2fd162de22c..71510b62ba1 100644
--- a/source/blender/blenlib/intern/BLI_mmap.c
+++ b/source/blender/blenlib/intern/BLI_mmap.c
@@ -67,7 +67,7 @@ struct BLI_mmap_file {
  * handler if one was configured and abort the process otherwise.
  */
 
-struct error_handler_data {
+static struct error_handler_data {
   ListBase open_mmaps;
   char configured;
   void (*next_handler)(int, siginfo_t *, void *);
diff --git a/source/blender/blenlib/tests/BLI_string_utf8_test.cc b/source/blender/blenlib/tests/BLI_string_utf8_test.cc
index 1833945b3fd..2796cbbfbda 100644
--- a/source/blender/blenlib/tests/BLI_string_utf8_test.cc
+++ b/source/blender/blenlib/tests/BLI_string_utf8_test.cc
@@ -22,7 +22,7 @@
  * Based on utf-8 decoder stress-test (https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt)
  *     by Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> - 2015-08-28 - CC BY 4.0
  */
-const char *utf8_invalid_tests[][3] = {
+static const char *utf8_invalid_tests[][3] = {
 /*    1  Some correct UTF-8 text. */
     {"You should see the Greek word 'kosme':       \"\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5\"                    |",
      "You should see the Greek word 'kosme':       \"\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5\"                    |", "\x00"},
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 72e65272f13..87291974e08 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -44,6 +44,7 @@
 #include "BKE_report.h"
 
 #include "RNA_access.h"
+#include "RNA_enum_types.h"
 
 #include "ED_anim_api.h"
 #include "ED_keyframes_edit.h"
diff --git a/source/blender/functions/tests/FN_cpp_type_test.cc b/source/blender/functions/tests/FN_cpp_type_test.cc
index 29368b251cc..479526b5e3a 100644
--- a/source/blender/functions/tests/FN_cpp_type_test.cc
+++ b/source/blender/functions/tests/FN_cpp_type_test.cc
@@ -79,7 +79,7 @@ MAKE_CPP_TYPE(TestType, blender::fn::tests::TestType)
 
 namespace blender::fn::tests {
 
-const CPPType &CPPType_TestType = CPPType::get<TestType>();
+static const CPPType &CPPType_TestType = CPPType::get<TestType>();
 
 TEST(cpp_type, Size)
 {
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index cc42c89a60e..fae8ac72108 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -77,9 +77,9 @@
 #endif
 
 #ifdef WITH_GMP
-const bool bypass_bmesh = true;
+static const bool bypass_bmesh = true;
 #else
-const bool bypass_bmesh = false;
+static const bool bypass_bmesh = false;
 #endif
 
 static void initData(ModifierData *md)
@@ -729,6 +729,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
     return exact_boolean_mesh(bmd, ctx, mesh);
   }
 #else
+  UNUSED_VARS(bypass_bmesh);
   const bool use_exact = false;
 #endif



More information about the Bf-blender-cvs mailing list