summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/umath/ufunc_object.c13
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c12
2 files changed, 15 insertions, 10 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 0dd868600..6a0619547 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -724,6 +724,7 @@ static int get_ufunc_arguments(PyUFuncObject *ufunc,
PyObject *obj, *context;
PyObject *str_key_obj = NULL;
char *ufunc_name;
+ int type_num;
int any_flexible = 0, any_object = 0, any_flexible_userloops = 0;
@@ -765,7 +766,7 @@ static int get_ufunc_arguments(PyUFuncObject *ufunc,
return -1;
}
- int type_num = PyArray_DESCR(out_op[i])->type_num;
+ type_num = PyArray_DESCR(out_op[i])->type_num;
if (!any_flexible &&
PyTypeNum_ISFLEXIBLE(type_num)) {
any_flexible = 1;
@@ -781,11 +782,11 @@ static int get_ufunc_arguments(PyUFuncObject *ufunc,
* for a struct dtype if ufunc's arg_dtypes array is not NULL.
*/
if (PyTypeNum_ISFLEXIBLE(type_num) &&
- !any_flexible_userloops &&
- ufunc->userloops != NULL) {
- PyUFunc_Loop1d *funcdata;
- PyObject *key, *obj;
- key = PyInt_FromLong(type_num);
+ !any_flexible_userloops &&
+ ufunc->userloops != NULL) {
+ PyUFunc_Loop1d *funcdata;
+ PyObject *key, *obj;
+ key = PyInt_FromLong(type_num);
if (key == NULL) {
continue;
}
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index a75991c2a..4943eb023 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -1188,7 +1188,8 @@ find_userloop(PyUFuncObject *ufunc,
}
type_num = dtypes[i]->type_num;
- if (type_num != last_userdef && (PyTypeNum_ISUSERDEF(type_num) || type_num == NPY_VOID)) {
+ if (type_num != last_userdef &&
+ (PyTypeNum_ISUSERDEF(type_num) || type_num == NPY_VOID)) {
PyObject *key, *obj;
last_userdef = type_num;
@@ -1554,7 +1555,8 @@ set_ufunc_loop_data_types(PyUFuncObject *self, PyArrayObject **op,
* Copy the dtype from 'op' if the type_num matches,
* to preserve metadata.
*/
- } else if (op[i] != NULL && PyArray_DESCR(op[i])->type_num == type_nums[i]) {
+ } else if (op[i] != NULL &&
+ PyArray_DESCR(op[i])->type_num == type_nums[i]) {
out_dtypes[i] = ensure_dtype_nbo(PyArray_DESCR(op[i]));
Py_XINCREF(out_dtypes[i]);
}
@@ -1617,7 +1619,8 @@ linear_search_userloop_type_resolver(PyUFuncObject *self,
}
type_num = PyArray_DESCR(op[i])->type_num;
- if (type_num != last_userdef && (PyTypeNum_ISUSERDEF(type_num) || type_num == NPY_VOID)) {
+ if (type_num != last_userdef &&
+ (PyTypeNum_ISUSERDEF(type_num) || type_num == NPY_VOID)) {
PyObject *key, *obj;
last_userdef = type_num;
@@ -1726,7 +1729,8 @@ type_tuple_userloop_type_resolver(PyUFuncObject *self,
&err_dst_typecode)) {
/* It works */
case 1:
- set_ufunc_loop_data_types(self, op, out_dtype, types, NULL);
+ set_ufunc_loop_data_types(self, op,
+ out_dtype, types, NULL);
return 1;
/* Didn't match */
case 0: