unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Aidan Gauland <aidalgol@no8wireless.co.nz>
To: guile-user@gnu.org
Subject: Re: Parsing a struct within a struct
Date: Wed, 9 Mar 2011 21:24:19 +1300	[thread overview]
Message-ID: <20110309082419.GA6429@neko> (raw)
In-Reply-To: <20110308072028.GA11631@neko>

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-03-09  8:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08  7:20 Parsing a struct within a struct Aidan Gauland
2011-03-09  8:24 ` Aidan Gauland [this message]
2011-03-10 21:36   ` Ludovic Courtès
2011-03-11  2:33     ` Aidan Gauland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110309082419.GA6429@neko \
    --to=aidalgol@no8wireless.co.nz \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).