| 784 | |
| 785 | |
| 786 | static PyObject * |
| 787 | _GenericBinaryOutFunction(PyArrayObject *m1, PyObject *m2, PyArrayObject *out, |
| 788 | PyObject *op) |
| 789 | { |
| 790 | if (out == NULL) { |
| 791 | return PyObject_CallFunction(op, "OO", m1, m2); |
| 792 | } |
| 793 | else { |
| 794 | PyObject *args, *ret; |
| 795 | static PyObject *kw = NULL; |
| 796 | |
| 797 | if (kw == NULL) { |
| 798 | kw = Py_BuildValue("{s:s}", "casting", "unsafe"); |
| 799 | if (kw == NULL) { |
| 800 | return NULL; |
| 801 | } |
| 802 | } |
| 803 | |
| 804 | args = Py_BuildValue("OOO", m1, m2, out); |
| 805 | if (args == NULL) { |
| 806 | return NULL; |
| 807 | } |
| 808 | |
| 809 | ret = PyObject_Call(op, args, kw); |
| 810 | |
| 811 | Py_DECREF(args); |
| 812 | |
| 813 | return ret; |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | static PyObject * |
| 818 | _slow_array_clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *out) |