Cleanup: use static local variables

This commit is contained in:
Campbell Barton 2021-03-21 13:58:34 +11:00
parent 4abafa2062
commit 6d97f9a5c1
6 changed files with 8 additions and 6 deletions

View File

@ -86,7 +86,7 @@ static int gNextIconId = 1;
/* Protected by gIconMutex. */ /* Protected by gIconMutex. */
static int gFirstIconId = 1; static int gFirstIconId = 1;
std::mutex gIconMutex; static std::mutex gIconMutex;
/* Not mutex-protected! */ /* Not mutex-protected! */
static GHash *gCachedPreviews = nullptr; static GHash *gCachedPreviews = nullptr;

View File

@ -67,7 +67,7 @@ struct BLI_mmap_file {
* handler if one was configured and abort the process otherwise. * handler if one was configured and abort the process otherwise.
*/ */
struct error_handler_data { static struct error_handler_data {
ListBase open_mmaps; ListBase open_mmaps;
char configured; char configured;
void (*next_handler)(int, siginfo_t *, void *); void (*next_handler)(int, siginfo_t *, void *);

View File

@ -22,7 +22,7 @@
* Based on utf-8 decoder stress-test (https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt) * 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 * 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. */ /* 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\" |",
"You should see the Greek word 'kosme': \"\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5\" |", "\x00"}, "You should see the Greek word 'kosme': \"\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5\" |", "\x00"},

View File

@ -44,6 +44,7 @@
#include "BKE_report.h" #include "BKE_report.h"
#include "RNA_access.h" #include "RNA_access.h"
#include "RNA_enum_types.h"
#include "ED_anim_api.h" #include "ED_anim_api.h"
#include "ED_keyframes_edit.h" #include "ED_keyframes_edit.h"

View File

@ -79,7 +79,7 @@ MAKE_CPP_TYPE(TestType, blender::fn::tests::TestType)
namespace blender::fn::tests { namespace blender::fn::tests {
const CPPType &CPPType_TestType = CPPType::get<TestType>(); static const CPPType &CPPType_TestType = CPPType::get<TestType>();
TEST(cpp_type, Size) TEST(cpp_type, Size)
{ {

View File

@ -77,9 +77,9 @@
#endif #endif
#ifdef WITH_GMP #ifdef WITH_GMP
const bool bypass_bmesh = true; static const bool bypass_bmesh = true;
#else #else
const bool bypass_bmesh = false; static const bool bypass_bmesh = false;
#endif #endif
static void initData(ModifierData *md) 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); return exact_boolean_mesh(bmd, ctx, mesh);
} }
#else #else
UNUSED_VARS(bypass_bmesh);
const bool use_exact = false; const bool use_exact = false;
#endif #endif