[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44623] trunk/blender/source/blender/ python: style cleanup - comment formatting

Campbell Barton ideasman42 at gmail.com
Sat Mar 3 21:36:17 CET 2012


Revision: 44623
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44623
Author:   campbellbarton
Date:     2012-03-03 20:36:09 +0000 (Sat, 03 Mar 2012)
Log Message:
-----------
style cleanup - comment formatting

Modified Paths:
--------------
    trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
    trunk/blender/source/blender/python/generic/bgl.h
    trunk/blender/source/blender/python/generic/idprop_py_api.c
    trunk/blender/source/blender/python/generic/py_capi_utils.c
    trunk/blender/source/blender/python/intern/bpy.c
    trunk/blender/source/blender/python/intern/bpy_app_handlers.c
    trunk/blender/source/blender/python/intern/bpy_interface.c
    trunk/blender/source/blender/python/intern/bpy_rna.c
    trunk/blender/source/blender/python/intern/bpy_rna_array.c
    trunk/blender/source/blender/python/mathutils/mathutils.c
    trunk/blender/source/blender/python/mathutils/mathutils_Color.c
    trunk/blender/source/blender/python/mathutils/mathutils_Color.h
    trunk/blender/source/blender/python/mathutils/mathutils_Euler.c
    trunk/blender/source/blender/python/mathutils/mathutils_Euler.h
    trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c
    trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.c
    trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.h
    trunk/blender/source/blender/python/mathutils/mathutils_Vector.c
    trunk/blender/source/blender/python/mathutils/mathutils_geometry.c
    trunk/blender/source/blender/python/mathutils/mathutils_noise.c

Modified: trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
===================================================================
--- trunk/blender/source/blender/python/bmesh/bmesh_py_types.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/bmesh/bmesh_py_types.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -2307,14 +2307,14 @@
 	BPy_BMIter_Type.tp_dealloc    = NULL;
 
 	/*
-	BPy_BMesh_Type.
-	BPy_BMVert_Type.
-	BPy_BMEdge_Type.
-	BPy_BMFace_Type.
-	BPy_BMLoop_Type.
-	BPy_BMElemSeq_Type.
-	BPy_BMIter_Type.
-	*/
+	 * BPy_BMesh_Type.
+	 * BPy_BMVert_Type.
+	 * BPy_BMEdge_Type.
+	 * BPy_BMFace_Type.
+	 * BPy_BMLoop_Type.
+	 * BPy_BMElemSeq_Type.
+	 * BPy_BMIter_Type.
+	 */
 
 	BPy_BMesh_Type.tp_flags     = Py_TPFLAGS_DEFAULT;
 	BPy_BMVert_Type.tp_flags    = Py_TPFLAGS_DEFAULT;

Modified: trunk/blender/source/blender/python/generic/bgl.h
===================================================================
--- trunk/blender/source/blender/python/generic/bgl.h	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/generic/bgl.h	2012-03-03 20:36:09 UTC (rev 44623)
@@ -75,7 +75,7 @@
 
 /*@ By golly George! It looks like fancy pants macro time!!! */
 
-/*
+#if 0 /* unused so far */
 #define int_str       "i"
 #define int_var(number)   bgl_int##number
 #define int_ref(number)   &bgl_int##number
@@ -85,7 +85,7 @@
 #define float_var(number) bgl_float##number
 #define float_ref(number) &bgl_float##number
 #define float_def(number) float float_var(number)
-*/
+#endif
 
 /* TYPE_str is the string to pass to Py_ArgParse (for the format) */
 /* TYPE_var is the name to pass to the GL function */

Modified: trunk/blender/source/blender/python/generic/idprop_py_api.c
===================================================================
--- trunk/blender/source/blender/python/generic/idprop_py_api.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/generic/idprop_py_api.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -399,9 +399,9 @@
 		if ((val.array.type= idp_sequence_type(ob)) == -1)
 			return "only floats, ints and dicts are allowed in ID property arrays";
 
-		/*validate sequence and derive type.
-		we assume IDP_INT unless we hit a float
-		number; then we assume it's */
+		/* validate sequence and derive type.
+		 * we assume IDP_INT unless we hit a float
+		 * number; then we assume it's */
 
 		val.array.len = PySequence_Size(ob);
 
@@ -443,8 +443,8 @@
 		keys = PyMapping_Keys(ob);
 		vals = PyMapping_Values(ob);
 
-		/*we allocate the group first; if we hit any invalid data,
-		  we can delete it easily enough.*/
+		/* we allocate the group first; if we hit any invalid data,
+		 * we can delete it easily enough.*/
 		prop = IDP_New(IDP_GROUP, &val, name);
 		len = PyMapping_Length(ob);
 		for (i=0; i<len; i++) {
@@ -666,9 +666,9 @@
 		pyform = BPy_IDGroup_MapDataToPy(idprop);
 
 		if (!pyform) {
-			/*ok something bad happened with the pyobject,
-			  so don't remove the prop from the group.  if pyform is
-			  NULL, then it already should have raised an exception.*/
+			/* ok something bad happened with the pyobject,
+			 * so don't remove the prop from the group.  if pyform is
+			 * NULL, then it already should have raised an exception.*/
 			return NULL;
 		}
 

Modified: trunk/blender/source/blender/python/generic/py_capi_utils.c
===================================================================
--- trunk/blender/source/blender/python/generic/py_capi_utils.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/generic/py_capi_utils.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -419,16 +419,16 @@
 }
 
 /*****************************************************************************
-* Description: This function creates a new Python dictionary object.
-* note: dict is owned by sys.modules["__main__"] module, reference is borrowed
-* note: important we use the dict from __main__, this is what python expects
-  for 'pickle' to work as well as strings like this...
- >> foo = 10
- >> print(__import__("__main__").foo)
-*
-* note: this overwrites __main__ which gives problems with nested calles.
-* be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is
-* any chance that python is in the call stack.
+ * Description: This function creates a new Python dictionary object.
+ * note: dict is owned by sys.modules["__main__"] module, reference is borrowed
+ * note: important we use the dict from __main__, this is what python expects
+ *  for 'pickle' to work as well as strings like this...
+ * >> foo = 10
+ * >> print(__import__("__main__").foo)
+ *
+ * note: this overwrites __main__ which gives problems with nested calles.
+ * be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is
+ * any chance that python is in the call stack.
 *****************************************************************************/
 PyObject *PyC_DefaultNameSpace(const char *filename)
 {
@@ -475,7 +475,7 @@
 
 #ifdef __APPLE__
 	/* OSX allow file/directory names to contain : character (represented as / in the Finder)
-	 but current Python lib (release 3.1.1) doesn't handle these correctly */
+	 * but current Python lib (release 3.1.1) doesn't handle these correctly */
 	if (strchr(py_path_bundle, ':'))
 		printf("Warning : Blender application is located in a path containing : or / chars\
 			   \nThis may make python import function fail\n");
@@ -483,7 +483,7 @@
 
 #ifdef _WIN32
 	/* cmake/MSVC debug build crashes without this, why only
-	   in this case is unknown.. */
+	 * in this case is unknown.. */
 	{
 		BLI_setenv("PYTHONPATH", py_path_bundle);
 	}

Modified: trunk/blender/source/blender/python/intern/bpy.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/intern/bpy.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -227,9 +227,9 @@
 	return mod;
 }
 
-/*****************************************************************************
-* Description: Creates the bpy module and adds it to sys.modules for importing
-*****************************************************************************/
+/******************************************************************************
+ * Description: Creates the bpy module and adds it to sys.modules for importing
+ ******************************************************************************/
 void BPy_init_modules(void)
 {
 	extern BPy_StructRNA *bpy_context_module;

Modified: trunk/blender/source/blender/python/intern/bpy_app_handlers.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_app_handlers.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/intern/bpy_app_handlers.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -68,11 +68,11 @@
 	(sizeof(app_cb_info_fields) / sizeof(PyStructSequence_Field)) - 1
 };
 
-/*
-#if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field))))
-#  error "Callbacks are out of sync"
+#if 0
+#  if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field))))
+#    error "Callbacks are out of sync"
+#  endif
 #endif
-*/
 
 /* --------------------------------------------------------------------------*/
 /* permanent tagging code */

Modified: trunk/blender/source/blender/python/intern/bpy_interface.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_interface.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/intern/bpy_interface.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -671,11 +671,11 @@
 				PyObject *list_item = PySequence_Fast_GET_ITEM(seq_fast, i);
 
 				if (BPy_StructRNA_Check(list_item)) {
-					/*
+#if 0
 					CollectionPointerLink *link = MEM_callocN(sizeof(CollectionPointerLink), "bpy_context_get");
 					link->ptr = ((BPy_StructRNA *)item)->ptr;
 					BLI_addtail(&result->list, link);
-					*/
+#endif
 					ptr = &(((BPy_StructRNA *)list_item)->ptr);
 					CTX_data_list_add(result, ptr->id.data, ptr->type, ptr->data);
 				}

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2012-03-03 20:19:11 UTC (rev 44622)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2012-03-03 20:36:09 UTC (rev 44623)
@@ -1309,11 +1309,11 @@
 
 			if (free)
 				MEM_freeN(enum_item);
-			/*
+#if 0
 			PyErr_Format(PyExc_AttributeError,
 			             "RNA Error: Current value \"%d\" matches no enum", val);
 			ret = NULL;
-			*/
+#endif
 		}
 	}
 
@@ -2549,10 +2549,12 @@
 {
 	PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
 
-	/*if (PyUnicode_Check(key)) {
+#if 0
+	if (PyUnicode_Check(key)) {
 		return pyrna_prop_array_subscript_str(self, _PyUnicode_AsString(key));
 	}
-	else */
+	else
+#endif
 	if (PyIndex_Check(key)) {
 		Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
 		if (i == -1 && PyErr_Occurred())
@@ -3576,14 +3578,14 @@
 
 	if (srna == NULL) {
 		/* allow setting on unregistered classes which can be registered later on */
-		/*
+#if 0
 		if (value && is_deferred_prop) {
 			PyErr_Format(PyExc_AttributeError,
 			             "pyrna_struct_meta_idprop_setattro() unable to get srna from class '%.200s'",
 			             ((PyTypeObject *)cls)->tp_name);
 			return -1;
 		}
-		*/
+#endif
 		/* srna_from_self may set an error */
 		PyErr_Clear();
 		return PyType_Type.tp_setattro(cls, attr, value);
@@ -4571,15 +4573,15 @@
 		else if (PyType_IsSubtype(Py_TYPE(base), &pyrna_struct_Type)) {
 			/* this almost never runs, only when using user defined subclasses of built-in object.
 			 * this isn't common since its NOT related to registerable subclasses. eg:
-
-				>>> class MyObSubclass(bpy.types.Object):
-				...     def test_func(self):
-				...         print(100)
-				...
-				>>> myob = MyObSubclass(bpy.context.object)
-				>>> myob.test_func()
-				100
 			 *
+			 *  >>> class MyObSubclass(bpy.types.Object):
+			 *  ...     def test_func(self):
+			 *  ...         print(100)
+			 *  ...
+			 *  >>> myob = MyObSubclass(bpy.context.object)
+			 *  >>> myob.test_func()
+			 *  100
+			 *
 			 * Keep this since it could be useful.
 			 */
 			BPy_StructRNA *ret;
@@ -4866,7 +4868,7 @@
 	}
 
 	/* for testing */
-	/*
+#if 0
 	{
 		const char *fn;
 		int lineno;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list