[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55514] trunk/blender/source/blender/ python/intern: code cleanup: shadowing, adjust type.

Campbell Barton ideasman42 at gmail.com
Fri Mar 22 16:47:02 CET 2013


Revision: 55514
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55514
Author:   campbellbarton
Date:     2013-03-22 15:47:02 +0000 (Fri, 22 Mar 2013)
Log Message:
-----------
code cleanup: shadowing, adjust type.

Modified Paths:
--------------
    trunk/blender/source/blender/python/intern/bpy_operator_wrap.c
    trunk/blender/source/blender/python/intern/bpy_rna.c
    trunk/blender/source/blender/python/intern/bpy_rna.h

Modified: trunk/blender/source/blender/python/intern/bpy_operator_wrap.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_operator_wrap.c	2013-03-22 15:46:38 UTC (rev 55513)
+++ trunk/blender/source/blender/python/intern/bpy_operator_wrap.c	2013-03-22 15:47:02 UTC (rev 55514)
@@ -45,7 +45,7 @@
 
 static void operator_properties_init(wmOperatorType *ot)
 {
-	PyObject *py_class = ot->ext.data;
+	PyTypeObject *py_class = ot->ext.data;
 	RNA_struct_blender_type_set(ot->ext.srna, ot);
 
 	/* only call this so pyrna_deferred_register_class gives a useful error
@@ -62,7 +62,6 @@
 	{
 		/* picky developers will notice that 'bl_property' won't work with inheritance
 		 * get direct from the dict to avoid raising a load of attribute errors (yes this isnt ideal) - campbell */
-		PyTypeObject *py_class = ot->ext.data;
 		PyObject *py_class_dict = py_class->tp_dict;
 		PyObject *bl_property = PyDict_GetItem(py_class_dict, bpy_intern_str_bl_property);
 		const char *prop_id;

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2013-03-22 15:46:38 UTC (rev 55513)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2013-03-22 15:47:02 UTC (rev 55514)
@@ -6823,14 +6823,14 @@
 	return pyrna_deferred_register_props(srna, py_class->tp_dict); /* getattr(..., "__dict__") returns a proxy */
 }
 
-int pyrna_deferred_register_class(StructRNA *srna, PyObject *py_class)
+int pyrna_deferred_register_class(StructRNA *srna, PyTypeObject *py_class)
 {
 	/* Panels and Menus don't need this
 	 * save some time and skip the checks here */
 	if (!RNA_struct_idprops_register_check(srna))
 		return 0;
 
-	return pyrna_deferred_register_class_recursive(srna, (PyTypeObject *)py_class);
+	return pyrna_deferred_register_class_recursive(srna, py_class);
 }
 
 /*-------------------- Type Registration ------------------------*/
@@ -7524,7 +7524,7 @@
 	 *
 	 * item = PyObject_GetAttrString(py_class, "__dict__");
 	 */
-	if (pyrna_deferred_register_class(srna_new, py_class) != 0)
+	if (pyrna_deferred_register_class(srna_new, (PyTypeObject *)py_class) != 0)
 		return NULL;
 
 	/* call classed register method () */

Modified: trunk/blender/source/blender/python/intern/bpy_rna.h
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.h	2013-03-22 15:46:38 UTC (rev 55513)
+++ trunk/blender/source/blender/python/intern/bpy_rna.h	2013-03-22 15:47:02 UTC (rev 55514)
@@ -189,7 +189,7 @@
 
 int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value, const char *error_prefix);
 
-int pyrna_deferred_register_class(struct StructRNA *srna, PyObject *py_class);
+int pyrna_deferred_register_class(struct StructRNA *srna, PyTypeObject *py_class);
 
 /* called before stopping python */
 void pyrna_alloc_types(void);




More information about the Bf-blender-cvs mailing list