code cleanup: not all mathutils callback creation functions tool unsigned char for...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 17 Mar 2012 22:31:57 +0000 (22:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 17 Mar 2012 22:31:57 +0000 (22:31 +0000)
source/blender/python/mathutils/mathutils_Color.c
source/blender/python/mathutils/mathutils_Color.h
source/blender/python/mathutils/mathutils_Euler.c
source/blender/python/mathutils/mathutils_Euler.h
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/python/mathutils/mathutils_Matrix.h
source/blender/python/mathutils/mathutils_Quaternion.c
source/blender/python/mathutils/mathutils_Quaternion.h
source/blender/python/mathutils/mathutils_Vector.h

index 8cba75abd2f8de1b70c804718dd02e2f89e25508..99ac53fafcfe9388298df99cd1005b08835d6782 100644 (file)
@@ -885,14 +885,15 @@ PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type)
        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);
        }
 
index ebbcce5c663faf1e043fa45210f8f42525a078ff..2bf6ba2ef1f4988dc1567a6ee06e006846a169b0 100644 (file)
@@ -49,6 +49,7 @@ typedef struct {
 
 //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__ */
index 4a8b97e1d2e1713ab1034f88e77a5de5b2203db7..957649e636500849fc19a7083674e96572e0f1fe 100644 (file)
@@ -732,14 +732,15 @@ PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *
        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);
        }
 
index fc49c0a212a6396ed2a2140021b3b2f448bf0f63..56199f4a546e5c51bd33956a0f8be7a2c04a7810 100644 (file)
@@ -51,7 +51,8 @@ typedef struct {
 
 //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);
 
index 359f24e0d02e448cd1ed61653e9f5d1f91c99f90..b352726dc447d05d7c576932e86e7ebce3d952c5 100644 (file)
@@ -1739,8 +1739,7 @@ static PyObject *Matrix_slice(MatrixObject *self, int begin, int end)
        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(float *mat,
 
 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;
index 5e5a0dd10b5552be96d2599ff6498f4a887a9f86..fe9bf2ccb2a49338f3eeaf88487cf1942ac2dc96 100644 (file)
@@ -71,7 +71,7 @@ PyObject *Matrix_CreatePyObject(float *mat,
                                 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;
index 3a8411ef223e7c6affbcf9abf5ef36c4635c62a3..190c389388db2df512efdb63c9bdbef5d21d57ed 100644 (file)
@@ -1268,14 +1268,15 @@ PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_ty
        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);
        }
 
index 83bf053c16bb7d3ba11d6725fda6f942b6a4eb16..09faff192deab4b3bc7c009d8b30f95c1b71ca5b 100644 (file)
@@ -49,6 +49,7 @@ typedef struct {
 
 //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__ */
index 5567e2b757a98db52e1d0b39fed79aa55f8c7f8c..04fd0adcda50633d0322ef9bb68111350e68c9c1 100644 (file)
@@ -46,7 +46,8 @@ typedef struct {
 
 /*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__ */