diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-20 02:42:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-20 02:42:57 +0300 |
commit | 9a9f39e4661163391bb8e3eb782438e425abe684 (patch) | |
tree | e67dc76e18b408a2708dc5b5f7a7b3e89bd552cf /source/blender/python/mathutils | |
parent | 6ccef2aa7e010c1e5b6986a696dc27ef8826c6c2 (diff) |
Cleanup: remove redundant 'char *' casts
Diffstat (limited to 'source/blender/python/mathutils')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Color.c | 46 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Euler.c | 24 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 32 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Quaternion.c | 28 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_bvhtree.c | 12 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_kdtree.c | 10 |
6 files changed, 51 insertions, 101 deletions
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index b587738c8d7..739ffb87dbb 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -841,59 +841,39 @@ static int Color_hsv_set(ColorObject *self, PyObject *value, void *UNUSED(closur /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Color_getseters[] = { - {(char *)"r", - (getter)Color_channel_get, - (setter)Color_channel_set, - Color_channel_r_doc, - (void *)0}, - {(char *)"g", - (getter)Color_channel_get, - (setter)Color_channel_set, - Color_channel_g_doc, - (void *)1}, - {(char *)"b", - (getter)Color_channel_get, - (setter)Color_channel_set, - Color_channel_b_doc, - (void *)2}, + {"r", (getter)Color_channel_get, (setter)Color_channel_set, Color_channel_r_doc, (void *)0}, + {"g", (getter)Color_channel_get, (setter)Color_channel_set, Color_channel_g_doc, (void *)1}, + {"b", (getter)Color_channel_get, (setter)Color_channel_set, Color_channel_b_doc, (void *)2}, - {(char *)"h", + {"h", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, - (char *)Color_channel_hsv_h_doc, + Color_channel_hsv_h_doc, (void *)0}, - {(char *)"s", + {"s", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, - (char *)Color_channel_hsv_s_doc, + Color_channel_hsv_s_doc, (void *)1}, - {(char *)"v", + {"v", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, - (char *)Color_channel_hsv_v_doc, + Color_channel_hsv_v_doc, (void *)2}, - {(char *)"hsv", - (getter)Color_hsv_get, - (setter)Color_hsv_set, - (char *)Color_hsv_doc, - (void *)0}, + {"hsv", (getter)Color_hsv_get, (setter)Color_hsv_set, Color_hsv_doc, (void *)0}, - {(char *)"is_wrapped", + {"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL}, - {(char *)"is_frozen", + {"is_frozen", (getter)BaseMathObject_is_frozen_get, (setter)NULL, BaseMathObject_is_frozen_doc, NULL}, - {(char *)"owner", - (getter)BaseMathObject_owner_get, - (setter)NULL, - BaseMathObject_owner_doc, - NULL}, + {"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 3fd9bf666e2..65ca932d118 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -688,30 +688,22 @@ static int Euler_order_set(EulerObject *self, PyObject *value, void *UNUSED(clos /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Euler_getseters[] = { - {(char *)"x", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)0}, - {(char *)"y", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)1}, - {(char *)"z", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)2}, - {(char *)"order", - (getter)Euler_order_get, - (setter)Euler_order_set, - Euler_order_doc, - (void *)NULL}, - - {(char *)"is_wrapped", + {"x", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)0}, + {"y", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)1}, + {"z", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)2}, + {"order", (getter)Euler_order_get, (setter)Euler_order_set, Euler_order_doc, (void *)NULL}, + + {"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL}, - {(char *)"is_frozen", + {"is_frozen", (getter)BaseMathObject_is_frozen_get, (setter)NULL, BaseMathObject_is_frozen_doc, NULL}, - {(char *)"owner", - (getter)BaseMathObject_owner_get, - (setter)NULL, - BaseMathObject_owner_doc, - NULL}, + {"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index c6e6d395b6b..32921ae0ca9 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -3021,48 +3021,36 @@ static PyObject *Matrix_is_orthogonal_axis_vectors_get(MatrixObject *self, void /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Matrix_getseters[] = { - {(char *)"median_scale", - (getter)Matrix_median_scale_get, - (setter)NULL, - Matrix_median_scale_doc, - NULL}, - {(char *)"translation", + {"median_scale", (getter)Matrix_median_scale_get, (setter)NULL, Matrix_median_scale_doc, NULL}, + {"translation", (getter)Matrix_translation_get, (setter)Matrix_translation_set, Matrix_translation_doc, NULL}, - {(char *)"row", (getter)Matrix_row_get, (setter)NULL, Matrix_row_doc, NULL}, - {(char *)"col", (getter)Matrix_col_get, (setter)NULL, Matrix_col_doc, NULL}, - {(char *)"is_negative", - (getter)Matrix_is_negative_get, - (setter)NULL, - Matrix_is_negative_doc, - NULL}, - {(char *)"is_orthogonal", + {"row", (getter)Matrix_row_get, (setter)NULL, Matrix_row_doc, NULL}, + {"col", (getter)Matrix_col_get, (setter)NULL, Matrix_col_doc, NULL}, + {"is_negative", (getter)Matrix_is_negative_get, (setter)NULL, Matrix_is_negative_doc, NULL}, + {"is_orthogonal", (getter)Matrix_is_orthogonal_get, (setter)NULL, Matrix_is_orthogonal_doc, NULL}, - {(char *)"is_orthogonal_axis_vectors", + {"is_orthogonal_axis_vectors", (getter)Matrix_is_orthogonal_axis_vectors_get, (setter)NULL, Matrix_is_orthogonal_axis_vectors_doc, NULL}, - {(char *)"is_wrapped", + {"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL}, - {(char *)"is_frozen", + {"is_frozen", (getter)BaseMathObject_is_frozen_get, (setter)NULL, BaseMathObject_is_frozen_doc, NULL}, - {(char *)"owner", - (getter)BaseMathObject_owner_get, - (setter)NULL, - BaseMathObject_owner_doc, - NULL}, + {"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index d7cccd5c352..ac7dd8590f2 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -1480,56 +1480,48 @@ static struct PyMethodDef Quaternion_methods[] = { /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Quaternion_getseters[] = { - {(char *)"w", + {"w", (getter)Quaternion_axis_get, (setter)Quaternion_axis_set, Quaternion_axis_doc, (void *)0}, - {(char *)"x", + {"x", (getter)Quaternion_axis_get, (setter)Quaternion_axis_set, Quaternion_axis_doc, (void *)1}, - {(char *)"y", + {"y", (getter)Quaternion_axis_get, (setter)Quaternion_axis_set, Quaternion_axis_doc, (void *)2}, - {(char *)"z", + {"z", (getter)Quaternion_axis_get, (setter)Quaternion_axis_set, Quaternion_axis_doc, (void *)3}, - {(char *)"magnitude", - (getter)Quaternion_magnitude_get, - (setter)NULL, - Quaternion_magnitude_doc, - NULL}, - {(char *)"angle", + {"magnitude", (getter)Quaternion_magnitude_get, (setter)NULL, Quaternion_magnitude_doc, NULL}, + {"angle", (getter)Quaternion_angle_get, (setter)Quaternion_angle_set, Quaternion_angle_doc, NULL}, - {(char *)"axis", + {"axis", (getter)Quaternion_axis_vector_get, (setter)Quaternion_axis_vector_set, Quaternion_axis_vector_doc, NULL}, - {(char *)"is_wrapped", + {"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL}, - {(char *)"is_frozen", + {"is_frozen", (getter)BaseMathObject_is_frozen_get, (setter)NULL, BaseMathObject_is_frozen_doc, NULL}, - {(char *)"owner", - (getter)BaseMathObject_owner_get, - (setter)NULL, - BaseMathObject_owner_doc, - NULL}, + {"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index d28b9a0de8f..82f1d17fe52 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -349,7 +349,7 @@ static PyObject *py_bvhtree_ray_cast(PyBVHTree *self, PyObject *args) { PyObject *py_co, *py_direction; - if (!PyArg_ParseTuple(args, (char *)"OO|f:ray_cast", &py_co, &py_direction, &max_dist)) { + if (!PyArg_ParseTuple(args, "OO|f:ray_cast", &py_co, &py_direction, &max_dist)) { return NULL; } @@ -397,7 +397,7 @@ static PyObject *py_bvhtree_find_nearest(PyBVHTree *self, PyObject *args) { PyObject *py_co; - if (!PyArg_ParseTuple(args, (char *)"O|f:find_nearest", &py_co, &max_dist)) { + if (!PyArg_ParseTuple(args, "O|f:find_nearest", &py_co, &max_dist)) { return NULL; } @@ -478,7 +478,7 @@ static PyObject *py_bvhtree_find_nearest_range(PyBVHTree *self, PyObject *args) { PyObject *py_co; - if (!PyArg_ParseTuple(args, (char *)"O|f:find_nearest_range", &py_co, &max_dist)) { + if (!PyArg_ParseTuple(args, "O|f:find_nearest_range", &py_co, &max_dist)) { return NULL; } @@ -678,7 +678,7 @@ static PyObject *C_BVHTree_FromPolygons(PyObject *UNUSED(cls), PyObject *args, P if (!PyArg_ParseTupleAndKeywords(args, kwargs, - (char *)"OO|$O&f:BVHTree.FromPolygons", + "OO|$O&f:BVHTree.FromPolygons", (char **)keywords, &py_coords, &py_tris, @@ -951,7 +951,7 @@ static PyObject *C_BVHTree_FromBMesh(PyObject *UNUSED(cls), PyObject *args, PyOb if (!PyArg_ParseTupleAndKeywords(args, kwargs, - (char *)"O!|$f:BVHTree.FromBMesh", + "O!|$f:BVHTree.FromBMesh", (char **)keywords, &BPy_BMesh_Type, &py_bm, @@ -1142,7 +1142,7 @@ static PyObject *C_BVHTree_FromObject(PyObject *UNUSED(cls), PyObject *args, PyO if (!PyArg_ParseTupleAndKeywords(args, kwargs, - (char *)"OO|$O&O&f:BVHTree.FromObject", + "OO|$O&O&f:BVHTree.FromObject", (char **)keywords, &py_ob, &py_depsgraph, diff --git a/source/blender/python/mathutils/mathutils_kdtree.c b/source/blender/python/mathutils/mathutils_kdtree.c index e3f2cd9bd14..c6383f23d60 100644 --- a/source/blender/python/mathutils/mathutils_kdtree.c +++ b/source/blender/python/mathutils/mathutils_kdtree.c @@ -134,8 +134,7 @@ static PyObject *py_kdtree_insert(PyKDTree *self, PyObject *args, PyObject *kwar int index; const char *keywords[] = {"co", "index", NULL}; - if (!PyArg_ParseTupleAndKeywords( - args, kwargs, (char *)"Oi:insert", (char **)keywords, &py_co, &index)) { + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi:insert", (char **)keywords, &py_co, &index)) { return NULL; } @@ -223,7 +222,7 @@ static PyObject *py_kdtree_find(PyKDTree *self, PyObject *args, PyObject *kwargs const char *keywords[] = {"co", "filter", NULL}; if (!PyArg_ParseTupleAndKeywords( - args, kwargs, (char *)"O|O:find", (char **)keywords, &py_co, &py_filter)) { + args, kwargs, "O|O:find", (char **)keywords, &py_co, &py_filter)) { return NULL; } @@ -278,8 +277,7 @@ static PyObject *py_kdtree_find_n(PyKDTree *self, PyObject *args, PyObject *kwar int i, found; const char *keywords[] = {"co", "n", NULL}; - if (!PyArg_ParseTupleAndKeywords( - args, kwargs, (char *)"OI:find_n", (char **)keywords, &py_co, &n)) { + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OI:find_n", (char **)keywords, &py_co, &n)) { return NULL; } @@ -335,7 +333,7 @@ static PyObject *py_kdtree_find_range(PyKDTree *self, PyObject *args, PyObject * const char *keywords[] = {"co", "radius", NULL}; if (!PyArg_ParseTupleAndKeywords( - args, kwargs, (char *)"Of:find_range", (char **)keywords, &py_co, &radius)) { + args, kwargs, "Of:find_range", (char **)keywords, &py_co, &radius)) { return NULL; } |