[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

data types



I'm trying to compile a short listing of data types for converting
between F77, C, and IDL.

Below is a listing of what I have but note that I have not filled in all
of the IDL column.  Any and all comments/help is appreciated and my
appologies to those of you who don't use fixed fonts for reading mail.

F77 type            C type                    IDL type       Size
(bytes)
-----------------------------------------------------------------------
byte x              char x                    byte             1
character x         char x                    byte             1
character*n x       char x[n]                 bytearr(n)       n

complex x           struct {float r, i;} x    ?                8
complex*8 x         struct {float r, i;} x    ?                8
double complex x    struct {float dr, di;} x  ?                16
complex*16 x        struct {float dr, di;} x  ?                16
complex*32 x        struct {float dr, di;} x  ?                32

double precision x  double                    double           8
real x              float x                   float            4
real*4 x            float x                   float            4
real*8 x            double x                  double           8
real*16 x           long double x             ?                16

integer x           int x                     long             4
integer*2 x         short x                   fix              2
integer*4 x         int x                     long             4
integer*8 x         long long int x           ?                8

logical x           int x                     long             4
logical*1           char x                    byte             1
logical*2           short x                   fix              2
logical*4           int x                     long             4
logical*8           long long int x           ?                8


NB: I'm assuming that there are no fancy compiling options given to
change the alignment or the default sizes.

Such a list would be useful as an appendix in one of those IDL books we
keep hearing about (better still if it had the byte alignment for
sparc/intel/powerpc/dec/mips...)  :p


Sent via Deja.com
http://www.deja.com/