From 6df2ac2173331ed91e79e69bb5caea07c12f410d Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Sat, 7 May 2011 00:21:30 +0300 Subject: BUG: Fix the order of declaring variables in f2py generated code. The bug was noticable with ifort but not with gfortran. --- numpy/f2py/func2subr.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'numpy/f2py/func2subr.py') diff --git a/numpy/f2py/func2subr.py b/numpy/f2py/func2subr.py index 0f76920ac..f746108ad 100644 --- a/numpy/f2py/func2subr.py +++ b/numpy/f2py/func2subr.py @@ -90,7 +90,6 @@ def createfuncwrapper(rout,signature=0): v['dimension'][i] = dn rout['args'].extend(extra_args) need_interface = bool(extra_args) - ret = [''] def add(line,ret=ret): @@ -141,10 +140,15 @@ def createfuncwrapper(rout,signature=0): if isscalar(vars[a]): add(var2fixfortran(vars,a,f90mode=f90mode)) dumped_args.append(a) + for a in args: + if a in dumped_args: continue + if isintent_in(vars[a]): + add(var2fixfortran(vars,a,f90mode=f90mode)) + dumped_args.append(a) for a in args: if a in dumped_args: continue add(var2fixfortran(vars,a,f90mode=f90mode)) - + add(l) if need_interface: -- cgit v1.2.1