summaryrefslogtreecommitdiff
path: root/numpy/doc/swig/numpy.i
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-04-25 23:13:10 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-04-25 23:13:10 +0000
commitc1bfdfda3dbd4e2349f5313a2f5846f60d7ea7ed (patch)
treea17d587d45d8d9e574222c96ead9393515c40c51 /numpy/doc/swig/numpy.i
parent7e7f3837ab12568036c79ea9d05087fa147f1bbe (diff)
downloadnumpy-c1bfdfda3dbd4e2349f5313a2f5846f60d7ea7ed.tar.gz
Fix issue #77
Diffstat (limited to 'numpy/doc/swig/numpy.i')
-rw-r--r--numpy/doc/swig/numpy.i3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/doc/swig/numpy.i b/numpy/doc/swig/numpy.i
index 6f200d222..9e061a9a1 100644
--- a/numpy/doc/swig/numpy.i
+++ b/numpy/doc/swig/numpy.i
@@ -371,11 +371,12 @@ TYPEMAP_IN2(PyObject, PyArray_OBJECT)
/* One dimensional input/output arrays */
%define TYPEMAP_INPLACE1(type,typecode)
%typemap(in) (type* INPLACE_ARRAY1, int DIM1) (PyArrayObject* temp=NULL) {
+ int i;
temp = obj_to_array_no_conversion($input,typecode);
if (!temp || !require_contiguous(temp)) SWIG_fail;
$1 = (type*) temp->data;
$2 = 1;
- for (int i=0; i<temp->nd; ++i) $2 *= temp->dimensions[i];
+ for (i=0; i<temp->nd; ++i) $2 *= temp->dimensions[i];
}
%enddef