Skip to content

Commit

Permalink
FIX: wrong function types in ufunc_object.c
Browse files Browse the repository at this point in the history
assign_reduce_identity_{zero,one} were treated as
PyArray_AssignReduceIdentityFunc, but that type has
an extra void* argument. Added the argument.
  • Loading branch information
larsmans committed Aug 27, 2013
1 parent 266a1d1 commit 404a21a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions numpy/core/src/umath/ufunc_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ static int
_does_loop_use_arrays(void *data);

static int
assign_reduce_identity_zero(PyArrayObject *result);
assign_reduce_identity_zero(PyArrayObject *result, void *data);

static int
assign_reduce_identity_one(PyArrayObject *result);
assign_reduce_identity_one(PyArrayObject *result, void *data);

/*
* fpstatus is the ufunc_formatted hardware status
Expand Down Expand Up @@ -2180,10 +2180,10 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
if (PyArray_SIZE(op[i]) != 0) {
switch (ufunc->identity) {
case PyUFunc_Zero:
assign_reduce_identity_zero(op[i]);
assign_reduce_identity_zero(op[i], NULL);
break;
case PyUFunc_One:
assign_reduce_identity_one(op[i]);
assign_reduce_identity_one(op[i], NULL);
break;
case PyUFunc_None:
case PyUFunc_ReorderableNone:
Expand Down Expand Up @@ -2641,13 +2641,13 @@ reduce_type_resolver(PyUFuncObject *ufunc, PyArrayObject *arr,
}

static int
assign_reduce_identity_zero(PyArrayObject *result)
assign_reduce_identity_zero(PyArrayObject *result, void *NPY_UNUSED(data))
{
return PyArray_FillWithScalar(result, PyArrayScalar_False);
}

static int
assign_reduce_identity_one(PyArrayObject *result)
assign_reduce_identity_one(PyArrayObject *result, void *NPY_UNUSED(data))
{
return PyArray_FillWithScalar(result, PyArrayScalar_True);
}
Expand Down

0 comments on commit 404a21a

Please sign in to comment.