[Numpy-svn] r4032 - trunk/numpy/doc/swig

numpy-svn@scip... numpy-svn@scip...
Thu Sep 13 12:41:04 CDT 2007


Author: wfspotz@sandia.gov
Date: 2007-09-13 12:41:01 -0500 (Thu, 13 Sep 2007)
New Revision: 4032

Modified:
   trunk/numpy/doc/swig/numpy.i
Log:
Fixed C++ code to be C-compliant

Modified: trunk/numpy/doc/swig/numpy.i
===================================================================
--- trunk/numpy/doc/swig/numpy.i	2007-09-13 17:08:01 UTC (rev 4031)
+++ trunk/numpy/doc/swig/numpy.i	2007-09-13 17:41:01 UTC (rev 4032)
@@ -683,14 +683,14 @@
 }
 %typemap(in)
   (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
-  (PyArrayObject* array=NULL)
+  (PyArrayObject* array=NULL, int i=1)
 {
   array = obj_to_array_no_conversion($input, DATA_TYPECODE);
   if (!array || !require_dimensions(array,1) || !require_contiguous(array)
       || !require_native(array)) SWIG_fail;
   $1 = (DATA_TYPE*) array_data(array);
   $2 = 1;
-  for (int i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i);
+  for (i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i);
 }
 
 /* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
@@ -702,13 +702,13 @@
 }
 %typemap(in)
   (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
-  (PyArrayObject* array=NULL)
+  (PyArrayObject* array=NULL, int i=0)
 {
   array = obj_to_array_no_conversion($input, DATA_TYPECODE);
   if (!array || !require_dimensions(array,1) || !require_contiguous(array)
       || !require_native(array)) SWIG_fail;
   $1 = 1;
-  for (int i=0; i < array_numdims(array); ++i) $1 *= array_size(array,i);
+  for (i=0; i < array_numdims(array); ++i) $1 *= array_size(array,i);
   $2 = (DATA_TYPE*) array_data(array);
 }
 



More information about the Numpy-svn mailing list