diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-18 02:31:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-18 02:31:57 +0400 |
commit | 05612c041964dd2950136af5486db9369969e2ae (patch) | |
tree | 62e1864cb80c81fa7b0337784ee053f3e834d123 /source/blender | |
parent | 6075a24fc4c24dd69a49db68fc76039e86199a15 (diff) |
code cleanup: not all mathutils callback creation functions tool unsigned char for type & subtype args.
Diffstat (limited to 'source/blender')
9 files changed, 29 insertions, 23 deletions
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 8cba75abd2f..99ac53fafcf 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -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); } diff --git a/source/blender/python/mathutils/mathutils_Color.h b/source/blender/python/mathutils/mathutils_Color.h index ebbcce5c663..2bf6ba2ef1f 100644 --- a/source/blender/python/mathutils/mathutils_Color.h +++ b/source/blender/python/mathutils/mathutils_Color.h @@ -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__ */ diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 4a8b97e1d2e..957649e6365 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -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); } diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h index fc49c0a212a..56199f4a546 100644 --- a/source/blender/python/mathutils/mathutils_Euler.h +++ b/source/blender/python/mathutils/mathutils_Euler.h @@ -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); diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 359f24e0d02..b352726dc44 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -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; diff --git a/source/blender/python/mathutils/mathutils_Matrix.h b/source/blender/python/mathutils/mathutils_Matrix.h index 5e5a0dd10b5..fe9bf2ccb2a 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.h +++ b/source/blender/python/mathutils/mathutils_Matrix.h @@ -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; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index 3a8411ef223..190c389388d 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -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); } diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h index 83bf053c16b..09faff192de 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.h +++ b/source/blender/python/mathutils/mathutils_Quaternion.h @@ -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__ */ diff --git a/source/blender/python/mathutils/mathutils_Vector.h b/source/blender/python/mathutils/mathutils_Vector.h index 5567e2b757a..04fd0adcda5 100644 --- a/source/blender/python/mathutils/mathutils_Vector.h +++ b/source/blender/python/mathutils/mathutils_Vector.h @@ -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__ */ |