Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-07 14:52:53 +0300
committerCampbell Barton <campbell@blender.org>2022-10-07 14:55:03 +0300
commit331f8500569df9b3b2aa776c5bcaad7b99c57295 (patch)
tree93547846177ff3415f9564ca54cb8f13433755cf /source/blender/python
parent11abeae99fdbfc8f047c4a3c1d2b9b8c47883516 (diff)
Cleanup: redundant parenthesis
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops_call.c4
-rw-r--r--source/blender/python/generic/imbuf_py_api.c8
-rw-r--r--source/blender/python/generic/py_capi_utils.c6
-rw-r--r--source/blender/python/intern/bpy_interface_run.c2
-rw-r--r--source/blender/python/intern/bpy_msgbus.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c14
-rw-r--r--source/blender/python/mathutils/mathutils_Color.c5
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c2
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c2
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c2
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c2
11 files changed, 24 insertions, 25 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c
index 35d5cb6a994..72473fce64d 100644
--- a/source/blender/python/bmesh/bmesh_py_ops_call.c
+++ b/source/blender/python/bmesh/bmesh_py_ops_call.c
@@ -234,7 +234,7 @@ static int bpy_slot_from_py(BMesh *bm,
return -1;
}
const ushort size = pymat->col_num;
- if ((size != pymat->row_num) || (!ELEM(size, 3, 4))) {
+ if ((size != pymat->row_num) || !ELEM(size, 3, 4)) {
PyErr_Format(PyExc_TypeError,
"%.200s: keyword \"%.200s\" expected a 3x3 or 4x4 matrix",
opname,
@@ -738,7 +738,7 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw)
BMOperator bmop;
if ((PyTuple_GET_SIZE(args) == 1) && (py_bm = (BPy_BMesh *)PyTuple_GET_ITEM(args, 0)) &&
- (BPy_BMesh_Check(py_bm))) {
+ BPy_BMesh_Check(py_bm)) {
BPY_BM_CHECK_OBJ(py_bm);
bm = py_bm->bm;
diff --git a/source/blender/python/generic/imbuf_py_api.c b/source/blender/python/generic/imbuf_py_api.c
index 056af83cc49..14f1958b71d 100644
--- a/source/blender/python/generic/imbuf_py_api.c
+++ b/source/blender/python/generic/imbuf_py_api.c
@@ -150,13 +150,13 @@ static PyObject *py_imbuf_crop(Py_ImBuf *self, PyObject *args, PyObject *kw)
}
if (/* X range. */
- (!(crop.xmin >= 0 && crop.xmax < self->ibuf->x)) ||
+ !(crop.xmin >= 0 && crop.xmax < self->ibuf->x) ||
/* Y range. */
- (!(crop.ymin >= 0 && crop.ymax < self->ibuf->y)) ||
+ !(crop.ymin >= 0 && crop.ymax < self->ibuf->y) ||
/* X order. */
- (!(crop.xmin <= crop.xmax)) ||
+ !(crop.xmin <= crop.xmax) ||
/* Y order. */
- (!(crop.ymin <= crop.ymax))) {
+ !(crop.ymin <= crop.ymax)) {
PyErr_SetString(PyExc_ValueError, "ImBuf crop min/max not in range");
return NULL;
}
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 681c5404ed9..9e140bbe7bd 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -1475,7 +1475,7 @@ bool PyC_RunString_AsNumber(const char *imports[],
PyErr_Clear();
}
- if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ if (imports && !PyC_NameSpace_ImportArray(py_dict, imports)) {
ok = false;
}
else if ((retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict)) == NULL) {
@@ -1533,7 +1533,7 @@ bool PyC_RunString_AsIntPtr(const char *imports[],
py_dict = PyC_DefaultNameSpace(filename);
- if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ if (imports && !PyC_NameSpace_ImportArray(py_dict, imports)) {
ok = false;
}
else if ((retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict)) == NULL) {
@@ -1572,7 +1572,7 @@ bool PyC_RunString_AsStringAndSize(const char *imports[],
py_dict = PyC_DefaultNameSpace(filename);
- if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ if (imports && !PyC_NameSpace_ImportArray(py_dict, imports)) {
ok = false;
}
else if ((retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict)) == NULL) {
diff --git a/source/blender/python/intern/bpy_interface_run.c b/source/blender/python/intern/bpy_interface_run.c
index 886f5ee278d..49f5261ba19 100644
--- a/source/blender/python/intern/bpy_interface_run.c
+++ b/source/blender/python/intern/bpy_interface_run.c
@@ -259,7 +259,7 @@ static bool bpy_run_string_impl(bContext *C,
py_dict = PyC_DefaultNameSpace("<blender string>");
- if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ if (imports && !PyC_NameSpace_ImportArray(py_dict, imports)) {
Py_DECREF(py_dict);
retval = NULL;
}
diff --git a/source/blender/python/intern/bpy_msgbus.c b/source/blender/python/intern/bpy_msgbus.c
index 32519e5e373..4e41c44cab4 100644
--- a/source/blender/python/intern/bpy_msgbus.c
+++ b/source/blender/python/intern/bpy_msgbus.c
@@ -265,7 +265,7 @@ static PyObject *bpy_msgbus_subscribe_rna(PyObject *UNUSED(self), PyObject *args
}
if (py_options &&
- (pyrna_enum_bitfield_from_set(py_options_enum, py_options, &options, error_prefix)) == -1) {
+ (pyrna_enum_bitfield_from_set(py_options_enum, py_options, &options, error_prefix) == -1)) {
return NULL;
}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 56ad05d5501..0eaa5d6b6c7 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1811,7 +1811,7 @@ static int pyrna_py_to_prop(
* 'self.properties -> self'
* class mixing. If this causes problems in the future it should be removed.
*/
- if ((ptr_type == &RNA_AnyType) && (BPy_StructRNA_Check(value))) {
+ if ((ptr_type == &RNA_AnyType) && BPy_StructRNA_Check(value)) {
const StructRNA *base_type = RNA_struct_base_child_of(
((const BPy_StructRNA *)value)->ptr.type, NULL);
if (ELEM(base_type, &RNA_Operator, &RNA_Gizmo)) {
@@ -1957,7 +1957,7 @@ static int pyrna_py_to_prop(
BKE_reports_init(&reports, RPT_STORE);
RNA_property_pointer_set(
ptr, prop, (param == NULL) ? PointerRNA_NULL : param->ptr, &reports);
- const int err = (BPy_reports_to_error(&reports, PyExc_RuntimeError, true));
+ const int err = BPy_reports_to_error(&reports, PyExc_RuntimeError, true);
if (err == -1) {
Py_XDECREF(value_new);
return -1;
@@ -2479,7 +2479,7 @@ static int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *sel
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
ID *id = itemptr.data; /* Always an ID. */
- if (id->lib == lib && (STREQLEN(keyname, id->name + 2, sizeof(id->name) - 2))) {
+ if (id->lib == lib && STREQLEN(keyname, id->name + 2, sizeof(id->name) - 2)) {
found = true;
if (r_ptr) {
*r_ptr = itemptr;
@@ -5574,7 +5574,7 @@ static PyObject *pyprop_array_foreach_getset(BPy_PropertyArrayRNA *self,
}
else {
const char f = buf.format ? buf.format[0] : 0;
- if ((prop_type == PROP_INT && (buf.itemsize != sizeof(int) || (!ELEM(f, 'l', 'i')))) ||
+ if ((prop_type == PROP_INT && (buf.itemsize != sizeof(int) || !ELEM(f, 'l', 'i'))) ||
(prop_type == PROP_FLOAT && (buf.itemsize != sizeof(float) || f != 'f'))) {
PyBuffer_Release(&buf);
PyErr_Format(PyExc_TypeError, "incorrect sequence item type: %s", buf.format);
@@ -6404,7 +6404,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
BKE_reports_init(&reports, RPT_STORE);
RNA_function_call(C, &reports, self_ptr, self_func, &parms);
- err = (BPy_reports_to_error(&reports, PyExc_RuntimeError, true));
+ err = BPy_reports_to_error(&reports, PyExc_RuntimeError, true);
/* Return value. */
if (err != -1) {
@@ -7668,7 +7668,7 @@ bool pyrna_id_FromPyObject(PyObject *obj, ID **id)
bool pyrna_id_CheckPyObject(PyObject *obj)
{
- return BPy_StructRNA_Check(obj) && (RNA_struct_is_ID(((BPy_StructRNA *)obj)->ptr.type));
+ return BPy_StructRNA_Check(obj) && RNA_struct_is_ID(((BPy_StructRNA *)obj)->ptr.type);
}
void BPY_rna_init(void)
@@ -8796,7 +8796,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
ReportList *reports;
/* Alert the user, else they won't know unless they see the console. */
if ((!is_staticmethod) && (!is_classmethod) && (ptr->data) &&
- (RNA_struct_is_a(ptr->type, &RNA_Operator)) &&
+ RNA_struct_is_a(ptr->type, &RNA_Operator) &&
(is_valid_wm == (CTX_wm_manager(C) != NULL))) {
wmOperator *op = ptr->data;
reports = op->reports;
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index 432b1709d82..5218ea68f7b 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -73,9 +73,8 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
case 0:
break;
case 1:
- if ((mathutils_array_parse(
- col, COLOR_SIZE, COLOR_SIZE, PyTuple_GET_ITEM(args, 0), "mathutils.Color()")) ==
- -1) {
+ if (mathutils_array_parse(
+ col, COLOR_SIZE, COLOR_SIZE, PyTuple_GET_ITEM(args, 0), "mathutils.Color()") == -1) {
return NULL;
}
break;
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 8da2b20d9a5..ddc0f115742 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -215,7 +215,7 @@ static PyObject *Euler_rotate_axis(EulerObject *self, PyObject *args)
return NULL;
}
- if (!(ELEM(axis, 'X', 'Y', 'Z'))) {
+ if (!ELEM(axis, 'X', 'Y', 'Z')) {
PyErr_SetString(PyExc_ValueError,
"Euler.rotate_axis(): "
"expected axis to be 'X', 'Y' or 'Z'");
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 51362ec595f..a44f42bc337 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -725,7 +725,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
"cannot create a 2x2 rotation matrix around arbitrary axis");
return NULL;
}
- if ((ELEM(matSize, 3, 4)) && (axis == NULL) && (vec == NULL)) {
+ if (ELEM(matSize, 3, 4) && (axis == NULL) && (vec == NULL)) {
PyErr_SetString(PyExc_ValueError,
"Matrix.Rotation(): "
"axis of rotation for 3d and 4d matrices is required");
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index d5519676081..976c1da1916 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -830,7 +830,7 @@ static PyObject *Quaternion_richcmpr(PyObject *a, PyObject *b, int op)
return NULL;
}
- ok = (EXPP_VectorsAreEqual(quatA->quat, quatB->quat, QUAT_SIZE, 1)) ? 0 : -1;
+ ok = EXPP_VectorsAreEqual(quatA->quat, quatB->quat, QUAT_SIZE, 1) ? 0 : -1;
}
switch (op) {
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 654ddcb1237..290be771c90 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -2680,7 +2680,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
size_from = axis_from;
}
- else if (((void)PyErr_Clear()), /* run but ignore the result */
+ else if ((void)PyErr_Clear(), /* run but ignore the result */
(size_from = mathutils_array_parse(
vec_assign, 2, 4, value, "mathutils.Vector.**** = swizzle assignment")) == -1) {
return -1;