Cleanup: style

This commit is contained in:
2018-08-22 10:10:12 +10:00
parent e8e89c135f
commit 7eaf00bfb0
25 changed files with 143 additions and 137 deletions

View File

@@ -2353,8 +2353,8 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
if ((mat1->num_row != mat2->num_row) || (mat1->num_col != mat2->num_col)) {
PyErr_SetString(PyExc_ValueError,
"matrix1 * matrix2: matrix1 number of rows/columns "
"and the matrix2 number of rows/columns must be the same");
"matrix1 * matrix2: matrix1 number of rows/columns "
"and the matrix2 number of rows/columns must be the same");
return NULL;
}
@@ -2377,9 +2377,9 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
}
PyErr_Format(PyExc_TypeError,
"Element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
"Element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
}
/*------------------------obj *= obj------------------------------
@@ -2406,17 +2406,17 @@ static PyObject *Matrix_imul(PyObject *m1, PyObject *m2)
/* MATRIX *= MATRIX */
if ((mat1->num_row != mat2->num_row) || (mat1->num_col != mat2->num_col)) {
PyErr_SetString(PyExc_ValueError,
"matrix1 *= matrix2: matrix1 number of rows/columns "
"and the matrix2 number of rows/columns must be the same");
"matrix1 *= matrix2: matrix1 number of rows/columns "
"and the matrix2 number of rows/columns must be the same");
return NULL;
}
mul_vn_vn(mat1->matrix, mat2->matrix, mat1->num_col * mat1->num_row);
#else
PyErr_Format(PyExc_TypeError,
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
#endif
}
@@ -2426,9 +2426,9 @@ static PyObject *Matrix_imul(PyObject *m1, PyObject *m2)
}
else {
PyErr_Format(PyExc_TypeError,
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
}
@@ -2463,8 +2463,8 @@ static PyObject *Matrix_matmul(PyObject *m1, PyObject *m2)
if (mat1->num_col != mat2->num_row) {
PyErr_SetString(PyExc_ValueError,
"matrix1 * matrix2: matrix1 number of columns "
"and the matrix2 number of rows must be the same");
"matrix1 * matrix2: matrix1 number of columns "
"and the matrix2 number of rows must be the same");
return NULL;
}
@@ -2503,9 +2503,9 @@ static PyObject *Matrix_matmul(PyObject *m1, PyObject *m2)
}
PyErr_Format(PyExc_TypeError,
"Matrix multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
"Matrix multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
}
/*------------------------obj @= obj------------------------------
@@ -2532,8 +2532,8 @@ static PyObject *Matrix_imatmul(PyObject *m1, PyObject *m2)
if (mat1->num_col != mat2->num_row) {
PyErr_SetString(PyExc_ValueError,
"matrix1 * matrix2: matrix1 number of columns "
"and the matrix2 number of rows must be the same");
"matrix1 * matrix2: matrix1 number of columns "
"and the matrix2 number of rows must be the same");
return NULL;
}
@@ -2554,9 +2554,9 @@ static PyObject *Matrix_imatmul(PyObject *m1, PyObject *m2)
}
else {
PyErr_Format(PyExc_TypeError,
"Inplace matrix multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
"Inplace matrix multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
return NULL;
}

View File

@@ -868,7 +868,7 @@ static PyObject *Quaternion_mul(PyObject *q1, PyObject *q2)
}
PyErr_Format(PyExc_TypeError,
"Element-wise multiplication: "
"Element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
@@ -896,9 +896,9 @@ static PyObject *Quaternion_imul(PyObject *q1, PyObject *q2)
mul_vn_vn(quat1->quat, quat2->quat, QUAT_SIZE);
#else
PyErr_Format(PyExc_TypeError,
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
#endif
}
@@ -908,9 +908,9 @@ static PyObject *Quaternion_imul(PyObject *q1, PyObject *q2)
}
else {
PyErr_Format(PyExc_TypeError,
"Element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
"Element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
}
@@ -948,9 +948,9 @@ static PyObject *Quaternion_matmul(PyObject *q1, PyObject *q2)
if (vec2->size != 3) {
PyErr_SetString(PyExc_ValueError,
"Vector multiplication: "
"only 3D vector rotations (with quats) "
"currently supported");
"Vector multiplication: "
"only 3D vector rotations (with quats) "
"currently supported");
return NULL;
}
if (BaseMath_ReadCallback(vec2) == -1) {
@@ -965,9 +965,9 @@ static PyObject *Quaternion_matmul(PyObject *q1, PyObject *q2)
}
PyErr_Format(PyExc_TypeError,
"Quaternion multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
"Quaternion multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
}
/*------------------------obj @= obj------------------------------
@@ -994,9 +994,9 @@ static PyObject *Quaternion_imatmul(PyObject *q1, PyObject *q2)
}
else {
PyErr_Format(PyExc_TypeError,
"Inplace quaternion multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
"Inplace quaternion multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
return NULL;
}

View File

@@ -1712,8 +1712,8 @@ static PyObject *vector_mul_vec(VectorObject *vec1, VectorObject *vec2)
float *tvec = PyMem_Malloc(vec1->size * sizeof(float));
if (tvec == NULL) {
PyErr_SetString(PyExc_MemoryError,
"vec * vec: "
"problem allocating pointer space");
"vec * vec: "
"problem allocating pointer space");
return NULL;
}
@@ -1766,7 +1766,7 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
}
PyErr_Format(PyExc_TypeError,
"Element-wise multiplication: "
"Element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
@@ -1798,8 +1798,8 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
#ifdef USE_MATHUTILS_ELEM_MUL
if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_ValueError,
"Vector multiplication: "
"vectors must have the same dimensions for this operation");
"Vector multiplication: "
"vectors must have the same dimensions for this operation");
return NULL;
}
@@ -1807,9 +1807,9 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
mul_vn_vn(vec1->vec, vec2->vec, vec1->size);
#else
PyErr_Format(PyExc_TypeError,
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
#endif
}
@@ -1818,9 +1818,9 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
}
else {
PyErr_Format(PyExc_TypeError,
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
"Inplace element-wise multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
@@ -1852,8 +1852,8 @@ static PyObject *Vector_matmul(PyObject *v1, PyObject *v2)
if (vec1 && vec2) {
if (vec1->size != vec2->size) {
PyErr_SetString(PyExc_ValueError,
"Vector multiplication: "
"vectors must have the same dimensions for this operation");
"Vector multiplication: "
"vectors must have the same dimensions for this operation");
return NULL;
}
@@ -1883,18 +1883,18 @@ static PyObject *Vector_matmul(PyObject *v1, PyObject *v2)
}
PyErr_Format(PyExc_TypeError,
"Vector multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
"Vector multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}
static PyObject *Vector_imatmul(PyObject *v1, PyObject *v2)
{
PyErr_Format(PyExc_TypeError,
"Inplace vector multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
"Inplace vector multiplication: "
"not supported between '%.200s' and '%.200s' types",
Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
return NULL;
}