[Bf-blender-cvs] [7a5854f4ce3] master: Cleanup: quiet undeclared variable warning

Campbell Barton noreply at git.blender.org
Sat Feb 23 09:39:51 CET 2019


Commit: 7a5854f4ce3e70b0ec6b18a688c79808d4110ff9
Author: Campbell Barton
Date:   Sat Feb 23 18:29:03 2019 +1100
Branches: master
https://developer.blender.org/rB7a5854f4ce3e70b0ec6b18a688c79808d4110ff9

Cleanup: quiet undeclared variable warning

Move bpy_context_module declaration to bpy_rna.h.

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

M	source/blender/python/intern/bpy.c
M	source/blender/python/intern/bpy_interface.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna.c
M	source/blender/python/intern/bpy_rna.h

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

diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 9af842a4b2e..05b471c4db7 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -294,7 +294,6 @@ static PyObject *bpy_import_test(const char *modname)
  ******************************************************************************/
 void BPy_init_modules(void)
 {
-	extern BPy_StructRNA *bpy_context_module;
 	PointerRNA ctx_ptr;
 	PyObject *mod;
 
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 7b8f52197fb..2a33c316f55 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -81,7 +81,6 @@ CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_RNA, "bpy.rna");
 
 /* in case a python script triggers another python call, stop bpy_context_clear from invalidating */
 static int py_call_level = 0;
-BPy_StructRNA *bpy_context_module = NULL; /* for fast access */
 
 // #define TIME_PY_RUN // simple python tests. prints on exit.
 
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 79b2e356713..c3c891ff6fc 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -52,8 +52,6 @@ enum {
 	BPY_DATA_CB_SLOT_SIZE       = 4,
 };
 
-extern BPy_StructRNA *bpy_context_module;
-
 static const EnumPropertyItem property_flag_items[] = {
 	{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
 	{PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 31c5600ff8f..cba6d2203fa 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -78,6 +78,8 @@
 #define USE_MATHUTILS
 #define USE_STRING_COERCE
 
+BPy_StructRNA *bpy_context_module = NULL; /* for fast access */
+
 static PyObject *pyrna_struct_Subtype(PointerRNA *ptr);
 static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self);
 
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 5de7704c3ab..c4c6944d46d 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -223,4 +223,6 @@ extern PyMethodDef meth_bpy_unregister_class;
 extern PyMethodDef meth_bpy_owner_id_set;
 extern PyMethodDef meth_bpy_owner_id_get;
 
+extern BPy_StructRNA *bpy_context_module;
+
 #endif



More information about the Bf-blender-cvs mailing list