From: northern snowfall <dbailey27@ameritech.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] struct problems
Date: Wed, 7 May 2003 02:32:45 -0500 [thread overview]
Message-ID: <3EB8B69D.5040107@ameritech.net> (raw)
In-Reply-To: <20030507043633.GX36080@cassie.foobarbaz.net>
Structures are aligned to the underlying platform's
specifications which may cause problems if you
expect raw data to align to your C structure bit-
for-bit: it won't happen. IIRC, this is the reason
why plan9 code uses the convX2Y() functions,
making sure data represented in a struct is
represented properly by the underlying architecture.
Some people go the B route and use uchar[] for
every structure member, which causes more CPU
cycles later when analyzing data. In my experience
it's just better to parse the raw data into the specific
structure using a conversion routine, possibly
inlined. Bitfields will only augment this issue in
your code and decrease portability.
Don
next prev parent reply other threads:[~2003-05-07 7:32 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-07 4:36 Christopher Nielsen
2003-05-07 5:34 ` Christopher Nielsen
2003-05-07 5:36 ` Nigel Roles
2003-05-07 5:41 ` Christopher Nielsen
2003-05-08 7:30 ` boyd, rounin
2003-05-09 20:22 ` ron minnich
2003-05-09 21:09 ` Geoff Collyer
2003-05-09 23:29 ` Scott Schwartz
2003-05-10 2:54 ` boyd, rounin
2003-05-10 5:04 ` northern snowfall
2003-05-10 4:11 ` boyd, rounin
2003-05-12 8:56 ` Douglas A. Gwyn
2003-05-12 9:29 ` boyd, rounin
2003-05-07 7:32 ` northern snowfall [this message]
2003-05-07 11:05 ` Bruce Ellis
2003-05-07 13:06 ` northern snowfall
2003-05-07 12:47 ` Bruce Ellis
2003-05-07 13:50 ` northern snowfall
2003-05-07 17:01 ` [9fans] snapshots -> archives rog
2003-05-07 17:02 ` Russ Cox
2003-05-07 15:47 ` [9fans] acme/sam problem ron minnich
2003-05-07 15:59 ` Russ Cox
2003-05-07 16:32 ` ron minnich
2003-05-07 16:00 ` andrey mirtchovski
[not found] <presotto@closedmind.org>
2003-05-10 0:13 ` [9fans] struct problems David Presotto
2003-05-10 0:22 ` Scott Schwartz
2003-05-10 4:49 ` Skip Tavakkolian
2003-05-10 4:52 ` boyd, rounin
2003-05-10 5:20 ` Skip Tavakkolian
2003-05-10 5:19 ` boyd, rounin
2003-05-10 7:11 ` Dennis Ritchie
2003-05-10 16:53 ` matt
2003-05-10 16:58 ` boyd, rounin
2003-05-10 16:58 ` boyd, rounin
2003-05-10 18:08 ` northern snowfall
2003-05-10 17:12 ` boyd, rounin
2003-05-10 22:34 ` boyd, rounin
2003-05-10 23:09 ` jmk
2003-05-10 23:16 ` boyd, rounin
2003-05-11 2:07 ` rob pike, esq.
2003-05-11 2:26 ` boyd, rounin
2003-05-11 3:48 ` Dennis Ritchie
2003-05-11 3:54 ` boyd, rounin
2003-05-10 23:26 ` boyd, rounin
2003-05-11 2:06 ` rob pike, esq.
2003-05-10 23:54 ` Skip Tavakkolian
2003-05-11 2:08 ` rob pike, esq.
2003-05-11 2:31 ` boyd, rounin
2003-05-11 6:04 ` rob pike, esq.
2003-05-11 7:03 ` boyd, rounin
2003-05-12 8:56 ` Anthony Mandic
2003-05-12 9:27 ` boyd, rounin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EB8B69D.5040107@ameritech.net \
--to=dbailey27@ameritech.net \
--cc=9fans@cse.psu.edu \
/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 NNTP newsgroup(s).