Scott Klement wrote: > > On Mon, 15 Jul 2002 email@example.com wrote: > > > > Why the extra blanks in the stat() data structure for the stat() IFS API's? > > > > Because of the way variables are aligned in C structures. To make > things more efficient, 16-bit integers are aligned on 2-byte boundaries. > 32-bit integers are aligned on 4 byte boundaries, 64-bit integers are > aligned on 8 byte boundaries, pointers are aligned on 16-byte boundaries, > etc, etc. > > In RPG however, this type of alignment does not occur unless you use > the ALIGN keyword in your D-spec. When working with C structs, there should be either a _Packed keyword on the C struct or an ALIGN keyword on the RPG DS. Exactly one or the other. Aside: Just to let people know - there's a new version of my "Converting from C prototypes to RPG" (http://www.opensource400.org/callc.html) on the opensource.org site. It's been cleaned up and expanded, and it's also been updated with V5R1 information (it's easier to call C from RPG now). The opensource.org site was down for a while but it has a new owner.
This mailing list archive is Copyright 1997-2013 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact