[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44953] trunk/blender/source/blender/ python/mathutils: code cleanup: not all mathutils callback creation functions tool unsigned char for type & subtype args .

Campbell Barton ideasman42 at gmail.com
Sat Mar 17 23:32:01 CET 2012


Revision: 44953
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44953
Author:   campbellbarton
Date:     2012-03-17 22:31:57 +0000 (Sat, 17 Mar 2012)
Log Message:
-----------
code cleanup: not all mathutils callback creation functions tool unsigned char for type & subtype args.

Modified Paths:
--------------
    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_Matrix.h
    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.h

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Color.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Color.c	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Color.c	2012-03-17 22:31:57 UTC (rev 44953)
@@ -885,14 +885,15 @@
 	return (PyObject *)self;
 }
 
-PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
+PyObject *Color_CreatePyObject_cb(PyObject *cb_user,
+                                  unsigned char cb_type, unsigned char cb_subtype)
 {
 	ColorObject *self = (ColorObject *)Color_CreatePyObject(NULL, Py_NEW, NULL);
 	if (self) {
 		Py_INCREF(cb_user);
-		self->cb_user =			cb_user;
-		self->cb_type =			(unsigned char)cb_type;
-		self->cb_subtype =		(unsigned char)cb_subtype;
+		self->cb_user         = cb_user;
+		self->cb_type         = cb_type;
+		self->cb_subtype      = cb_subtype;
 		PyObject_GC_Track(self);
 	}
 

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Color.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Color.h	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Color.h	2012-03-17 22:31:57 UTC (rev 44953)
@@ -49,6 +49,7 @@
 
 //prototypes
 PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type);
-PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
+PyObject *Color_CreatePyObject_cb(PyObject *cb_user,
+                                  unsigned char cb_type, unsigned char cb_subtype);
 
 #endif /* __MATHUTILS_COLOR_H__ */

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Euler.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Euler.c	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Euler.c	2012-03-17 22:31:57 UTC (rev 44953)
@@ -732,14 +732,15 @@
 	return (PyObject *)self;
 }
 
-PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order, int cb_type, int cb_subtype)
+PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order,
+                                  unsigned char cb_type, unsigned char cb_subtype)
 {
 	EulerObject *self = (EulerObject *)Euler_CreatePyObject(NULL, order, Py_NEW, NULL);
 	if (self) {
 		Py_INCREF(cb_user);
-		self->cb_user =			cb_user;
-		self->cb_type =			(unsigned char)cb_type;
-		self->cb_subtype =		(unsigned char)cb_subtype;
+		self->cb_user         = cb_user;
+		self->cb_type         = cb_type;
+		self->cb_subtype      = cb_subtype;
 		PyObject_GC_Track(self);
 	}
 

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Euler.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Euler.h	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Euler.h	2012-03-17 22:31:57 UTC (rev 44953)
@@ -51,7 +51,8 @@
 
 //prototypes
 PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *base_type);
-PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order, int cb_type, int cb_subtype);
+PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order,
+                                  unsigned char cb_type, unsigned char cb_subtype);
 
 short euler_order_from_string(const char *str, const char *error_prefix);
 

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c	2012-03-17 22:31:57 UTC (rev 44953)
@@ -1739,8 +1739,7 @@
 	tuple = PyTuple_New(end - begin);
 	for (count = begin; count < end; count++) {
 		PyTuple_SET_ITEM(tuple, count - begin,
-				Vector_CreatePyObject_cb((PyObject *)self, self->num_col, mathutils_matrix_row_cb_index, count));
-
+		                 Vector_CreatePyObject_cb((PyObject *)self, self->num_col, mathutils_matrix_row_cb_index, count));
 	}
 
 	return tuple;
@@ -2399,14 +2398,14 @@
 
 PyObject *Matrix_CreatePyObject_cb(PyObject *cb_user,
                                    const unsigned short num_col, const unsigned short num_row,
-                                   int cb_type, int cb_subtype)
+                                   unsigned char cb_type, unsigned char cb_subtype)
 {
 	MatrixObject *self = (MatrixObject *)Matrix_CreatePyObject(NULL, num_col, num_row, Py_NEW, NULL);
 	if (self) {
 		Py_INCREF(cb_user);
-		self->cb_user =			cb_user;
-		self->cb_type =			(unsigned char)cb_type;
-		self->cb_subtype =		(unsigned char)cb_subtype;
+		self->cb_user         = cb_user;
+		self->cb_type         = cb_type;
+		self->cb_subtype      = cb_subtype;
 		PyObject_GC_Track(self);
 	}
 	return (PyObject *) self;

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Matrix.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Matrix.h	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Matrix.h	2012-03-17 22:31:57 UTC (rev 44953)
@@ -71,7 +71,7 @@
                                 int type, PyTypeObject *base_type);
 PyObject *Matrix_CreatePyObject_cb(PyObject *user,
                                    const unsigned short num_col, const unsigned short num_row,
-                                   int cb_type, int cb_subtype);
+                                   unsigned char cb_type, unsigned char cb_subtype);
 
 extern unsigned char mathutils_matrix_row_cb_index; /* default */
 extern unsigned char mathutils_matrix_col_cb_index;

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.c	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.c	2012-03-17 22:31:57 UTC (rev 44953)
@@ -1268,14 +1268,15 @@
 	return (PyObject *) self;
 }
 
-PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype)
+PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
+                                       unsigned char cb_type, unsigned char cb_subtype)
 {
 	QuaternionObject *self = (QuaternionObject *)Quaternion_CreatePyObject(NULL, Py_NEW, NULL);
 	if (self) {
 		Py_INCREF(cb_user);
-		self->cb_user =			cb_user;
-		self->cb_type =			(unsigned char)cb_type;
-		self->cb_subtype =		(unsigned char)cb_subtype;
+		self->cb_user         = cb_user;
+		self->cb_type         = cb_type;
+		self->cb_subtype      = cb_subtype;
 		PyObject_GC_Track(self);
 	}
 

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.h	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Quaternion.h	2012-03-17 22:31:57 UTC (rev 44953)
@@ -49,6 +49,7 @@
 
 //prototypes
 PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type);
-PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
+PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
+                                       unsigned char cb_type, unsigned char cb_subtype);
 
 #endif /* __MATHUTILS_QUATERNION_H__ */

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Vector.h
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Vector.h	2012-03-17 22:14:52 UTC (rev 44952)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Vector.h	2012-03-17 22:31:57 UTC (rev 44953)
@@ -46,7 +46,8 @@
 
 /*prototypes*/
 PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type);
-PyObject *Vector_CreatePyObject_cb(PyObject *user, int size, unsigned char callback_type, unsigned char subtype);
+PyObject *Vector_CreatePyObject_cb(PyObject *user, int size,
+                                   unsigned char cb_type, unsigned char subtype);
 PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type);
 
 #endif				/* __MATHUTILS_VECTOR_H__ */




More information about the Bf-blender-cvs mailing list