From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.lisp.guile.user Subject: Re: Parsing a struct within a struct Date: Wed, 9 Mar 2011 21:24:19 +1300 Message-ID: <20110309082419.GA6429@neko> References: <20110308072028.GA11631@neko> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" X-Trace: dough.gmane.org 1299659387 16195 80.91.229.12 (9 Mar 2011 08:29:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 08:29:47 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 09 09:29:43 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxEm5-0006wa-JC for guile-user@m.gmane.org; Wed, 09 Mar 2011 09:29:41 +0100 Original-Received: from localhost ([127.0.0.1]:45624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxEji-000615-FY for guile-user@m.gmane.org; Wed, 09 Mar 2011 03:27:14 -0500 Original-Received: from [140.186.70.92] (port=48823 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxEga-0004ky-Mr for guile-user@gnu.org; Wed, 09 Mar 2011 03:24:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxEgL-0004QP-PH for guile-user@gnu.org; Wed, 09 Mar 2011 03:23:46 -0500 Original-Received: from jersey.rurallink.co.nz ([114.134.15.197]:34380 helo=smtp.rurallink.co.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxEgL-0004Pi-BZ for guile-user@gnu.org; Wed, 09 Mar 2011 03:23:45 -0500 Original-Received: from 114-134-6-192.rurallink.co.nz ([114.134.6.192] helo=localhost) by smtp.rurallink.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1PxEgC-0007Nh-Iq for guile-user@gnu.org; Wed, 09 Mar 2011 21:23:36 +1300 Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline In-Reply-To: <20110308072028.GA11631@neko> User-Agent: Mutt/1.5.20 (2009-06-14) X-Rurallink-Authenticated-User: aidalgol@no8wireless.co.nz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 114.134.15.197 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8499 Archived-At: --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk13OTMACgkQjyzTRvYJmaUeXwCeLS3pvQ78e6gh8HN5ZvlEALls Q/EAn0LUMOuNCVN3CzIwT7AMlVBlskXJ =UP0T -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--