guile-user
[Top][All Lists]
Advanced

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

Re: Parsing a struct within a struct


From: Aidan Gauland
Subject: Re: Parsing a struct within a struct
Date: Wed, 9 Mar 2011 21:24:19 +1300
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Mar 08, 2011 at 08:20:29PM +1300, Aidan Gauland wrote:
> (parse-c-struct event-pointer
>                 (list uint8 uint8 uint8
>                       (list uint8 int int uint16 )))
>

It seemed to be an off-by-one(-byte) error.  There was padding to
align (to 32-bits, I think) the sub-struct.

This works on my 32-bit machine, but I suspect it is not portable.

(parse-c-struct event-pointer
                (list uint8 uint8 uint8 uint8 ; Padding
                      (list uint8 int int uint16 )))

What would be a better, portable solution?  I suspect the `alignof'
procedure is my friend here, but I don't understand how to use it.

--Aidan

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]