|
Scott Klement wrote: > > On Mon, 15 Jul 2002 craigs@dekko.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.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.