From: <ai...@us...> - 2009-02-13 18:59:59
|
Revision: 9523 http://plplot.svn.sourceforge.net/plplot/?rev=9523&view=rev Author: airwin Date: 2009-02-13 18:59:53 +0000 (Fri, 13 Feb 2009) Log Message: ----------- As an experiment, try mapping PLUNICODE to 32-bit Fortran integers for the f77 versions of plsfci, plgfci. This approach works for gfortran. If it also works for a variety of other fortran compilers, then we should extend this approach to f95 as well. Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/examples/f77/x23f.fm4 Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2009-02-13 09:45:41 UTC (rev 9522) +++ trunk/bindings/f77/scstubs.c 2009-02-13 18:59:53 UTC (rev 9523) @@ -299,15 +299,13 @@ c_plgfam(fam, num, bmax); } -/* Note: Fortran does not have unsigned integers so we need to use a - * 64 bit signed integer which corresponds to a fortran integer*8 - * in order to contain the number. */ +/* Note: Fortran does not distinguish between unsigned and signed integers + so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside + this routine. */ void -PLGFCI(PLINT64 *pfci) +PLGFCI(PLUNICODE *pfci) { - PLUNICODE fci; - c_plgfci(&fci); - *pfci = (PLINT64) fci; + c_plgfci(pfci); } void @@ -775,15 +773,13 @@ c_plsfam(*fam, *num, *bmax); } -/* Note: Fortran does not have unsigned integers so we need to use a - * 64 bit signed integer which corresponds to a fortran integer*8 - * in order to contain the number. */ +/* Note: Fortran does not distinguish between unsigned and signed integers + so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside + this routine. */ void -PLSFCI(PLINT64 *fci) +PLSFCI(PLUNICODE *fci) { - PLUNICODE f; - f = (PLUNICODE) (*fci & 0xffffffff); - c_plsfci(f); + c_plsfci(*fci); } void Modified: trunk/examples/f77/x23f.fm4 =================================================================== --- trunk/examples/f77/x23f.fm4 2009-02-13 09:45:41 UTC (rev 9522) +++ trunk/examples/f77/x23f.fm4 2009-02-13 18:59:53 UTC (rev 9523) @@ -31,7 +31,7 @@ real*8 chardef, charht, deltax, deltay, x, y integer i, j, page, length, slice character*20 cmdString - integer*8 fci_old + integer*4 fci_old integer ifamily, istyle, iweight real*8 dy integer family_index, style_index, weight_index @@ -45,7 +45,7 @@ c c Displays Greek letters and mathematically interesting Unicode ranges c - integer fci_combinations + integer fci_combinations parameter(fci_combinations = 30) character*5 greek(48) @@ -56,7 +56,7 @@ integer nxcells(11) integer nycells(11) integer offset(11) - integer*8 fci(fci_combinations) + integer*4 fci(fci_combinations) character*11 family(5) character*8 style(3) character*7 weight(2) @@ -194,37 +194,40 @@ &0, &0 / +c drop the leading '8' marker for FCI because some compilers (gfortran) +c have an implementation error (integer overflow error) for that case, and +c the marker is not needed, in any case, for calls to plsfci. data (fci(i), i=1,fci_combinations) / - & z'80000000', - & z'80000001', - & z'80000002', - & z'80000003', - & z'80000004', - & z'80000010', - & z'80000011', - & z'80000012', - & z'80000013', - & z'80000014', - & z'80000020', - & z'80000021', - & z'80000022', - & z'80000023', - & z'80000024', - & z'80000100', - & z'80000101', - & z'80000102', - & z'80000103', - & z'80000104', - & z'80000110', - & z'80000111', - & z'80000112', - & z'80000113', - & z'80000114', - & z'80000120', - & z'80000121', - & z'80000122', - & z'80000123', - & z'80000124' / + & z'00000000', + & z'00000001', + & z'00000002', + & z'00000003', + & z'00000004', + & z'00000010', + & z'00000011', + & z'00000012', + & z'00000013', + & z'00000014', + & z'00000020', + & z'00000021', + & z'00000022', + & z'00000023', + & z'00000024', + & z'00000100', + & z'00000101', + & z'00000102', + & z'00000103', + & z'00000104', + & z'00000110', + & z'00000111', + & z'00000112', + & z'00000113', + & z'00000114', + & z'00000120', + & z'00000121', + & z'00000122', + & z'00000123', + & z'00000124' / data (family(i), i=1,5) / & "sans-serif", @@ -367,7 +370,8 @@ & trim(weight(weight_index+1))//': '// & 'The quick brown fox jumps over the lazy dog' elseif(page == 13) then - write(string,'(a,"#<0x",z8,">",a)') +C Note, must put in missing FCI marker for this particular case. + write(string,'(a,"#<0x8",z7.7,">",a)') & 'Page 14, '//trim(family(family_index+1))//', '// & trim(style(style_index+1))//', '// & trim(weight(weight_index+1))//': ', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |