diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-12 06:19:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-12 06:19:37 +0400 |
commit | b6db417ee466c6aec5d412a259a6dc7c0b4c1750 (patch) | |
tree | ca86ca90c7868f92d3c795c8d1f6a968dade6760 /source/blender/python/mathutils | |
parent | 744f691af42ffeadd306180048c51edad65a5f06 (diff) |
code cleanup: use const's for vector args.
Diffstat (limited to 'source/blender/python/mathutils')
6 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 6bb3031f0a3..2a874f51fd4 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -707,7 +707,7 @@ PyTypeObject euler_Type = { * (i.e. it was allocated elsewhere by MEM_mallocN()) * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON * (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *Euler_CreatePyObject(float *eul, const short order, int type, PyTypeObject *base_type) +PyObject *Euler_CreatePyObject(float eul[3], const short order, int type, PyTypeObject *base_type) { EulerObject *self; diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h index 355d0ed1810..62fb83ef234 100644 --- a/source/blender/python/mathutils/mathutils_Euler.h +++ b/source/blender/python/mathutils/mathutils_Euler.h @@ -43,7 +43,7 @@ typedef struct { * blender (stored in blend_data). This is an either/or struct not both */ /* prototypes */ -PyObject *Euler_CreatePyObject(float *eul, const short order, int type, PyTypeObject *base_type); +PyObject *Euler_CreatePyObject(float eul[3], const short order, int type, PyTypeObject *base_type); PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, const short order, unsigned char cb_type, unsigned char cb_subtype); diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index b0b818faaa0..e13136057c8 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -1246,7 +1246,7 @@ PyTypeObject quaternion_Type = { * (i.e. it was allocated elsewhere by MEM_mallocN()) * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON * (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type) +PyObject *Quaternion_CreatePyObject(float quat[4], int type, PyTypeObject *base_type) { QuaternionObject *self; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h index be3566934a4..36036c6d3fa 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.h +++ b/source/blender/python/mathutils/mathutils_Quaternion.h @@ -40,7 +40,7 @@ typedef struct { * blender (stored in blend_data). This is an either/or struct not both */ /* prototypes */ -PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type); +PyObject *Quaternion_CreatePyObject(float quat[4], int type, PyTypeObject *base_type); PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user, unsigned char cb_type, unsigned char cb_subtype); diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 8a5a8446ac6..6b2da9ca593 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -1853,7 +1853,7 @@ static PyObject *Vector_neg(VectorObject *self) } /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */ -static double vec_magnitude_nosqrt(float *data, int size) +static double vec_magnitude_nosqrt(const float *data, int size) { /* return (double)sqrt(dot);*/ /* warning, line above removed because we are not using the length, @@ -2940,10 +2940,10 @@ PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, unsigned char cb return (PyObject *)self; } -PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type) +PyObject *Vector_CreatePyObject_alloc(const float *vec, const int size, PyTypeObject *base_type) { VectorObject *vect_ob; - vect_ob = (VectorObject *)Vector_CreatePyObject(vec, size, Py_WRAP, base_type); + vect_ob = (VectorObject *)Vector_CreatePyObject((float *)vec, size, Py_WRAP, base_type); vect_ob->wrapped = Py_NEW; return (PyObject *)vect_ob; diff --git a/source/blender/python/mathutils/mathutils_Vector.h b/source/blender/python/mathutils/mathutils_Vector.h index 18d89e73734..2074270670a 100644 --- a/source/blender/python/mathutils/mathutils_Vector.h +++ b/source/blender/python/mathutils/mathutils_Vector.h @@ -41,6 +41,6 @@ typedef struct { PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type); 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); +PyObject *Vector_CreatePyObject_alloc(const float *vec, const int size, PyTypeObject *base_type); -#endif /* __MATHUTILS_VECTOR_H__ */ +#endif /* __MATHUTILS_VECTOR_H__ */ |