From: Andrew R. <and...@us...> - 2012-01-25 09:45:39
|
On Wed, Jan 25, 2012 at 09:35:23AM +0100, Arjen Markus wrote: > Hi Alan, > > On 2012-01-24 20:06, Alan W. Irwin wrote: > > > > Actually, trailing blanks in character strings do have a significant > > effect in Fortran. In particular, if a Fortran > > user wants to put a trailing blank into one of the character > > string arguments of PLplot, she should be allowed to do so. > > > > In fact our Fortran bindings did preserve Fortran trailing blanks up > > to when a regression was introduced by the recent changes in > > bindings/f95/strutil.f90. I have now fixed that regression with a > > one-line change (revision 12152). The result is example 28 (and > > presumably example 20 which I didn't have time to test) implemented > > with C and Fortran now give consistent results again. > > > > Arjen, please review revision 12152 to make sure it is consistent with > > the spirit of your recent changes. > > > > I misread the intention of the original code, I guess. I will have a > look and see if the new code is indeed equivalent. > > Regards, > > Arjen Alan's changes also don't work. The len instrinsic returns the length of the fortran character array, not the actual length of the string. This means that, for example, passing a character array of len 8 which you have set to 'test ' will actually pass 'test ' to the C interface. This causes example 14 to fail when setting the driver since the padding spaces makes the name invalid. It also causes postscript regression on a large number of other examples. Andrew |