summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-07-06 10:52:57 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-07-06 10:52:57 +0000
commit42477d7f8380d4c39caea70eb35d371b985e3465 (patch)
tree9b8ff64277d988380560753f060132b7c8d76de3 /numpy
parenta6d06e1fd07f0d358461661254581e8fe60733d1 (diff)
downloadnumpy-42477d7f8380d4c39caea70eb35d371b985e3465.tar.gz
Fix missing ) in numpy.i
Diffstat (limited to 'numpy')
-rw-r--r--numpy/doc/swig/numpy.i12
1 files changed, 3 insertions, 9 deletions
diff --git a/numpy/doc/swig/numpy.i b/numpy/doc/swig/numpy.i
index 9c9e94878..e7dcbb947 100644
--- a/numpy/doc/swig/numpy.i
+++ b/numpy/doc/swig/numpy.i
@@ -52,14 +52,7 @@ char* typecode_string(int typecode) {
* to match. Also allow int and long to match.
*/
int type_match(int actual_type, int desired_type) {
- int match = 1;
- if ( actual_type != desired_type &&
- !(desired_type == PyArray_CHAR && actual_type == PyArray_SBYTE) &&
- !(desired_type == PyArray_SBYTE && actual_type == PyArray_CHAR) &&
- !(desired_type == PyArray_INT && actual_type == PyArray_LONG) &&
- !(desired_type == PyArray_LONG && actual_type == PyArray_INT))
- match = 0;
- return match;
+ return PyArray_EquivTypenums(actual_type, desired_type);
}
/* Given a PyObject pointer, cast it to a PyArrayObject pointer if
@@ -69,7 +62,8 @@ int type_match(int actual_type, int desired_type) {
PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode) {
PyArrayObject* ary = NULL;
if (is_array(input) && (typecode == PyArray_NOTYPE ||
- PyArray_EquivTypenums(array_type(input), typecode)) {
+ PyArray_EquivTypenums(array_type(input),
+ typecode))) {
ary = (PyArrayObject*) input;
}
else if is_array(input) {