Re: Question about GTK+ and timers
- From: Chris Vine <chris cvine freeserve co uk>
- To: Igor Korot <ikorot01 gmail com>
- Cc: gtk-list gnome org
- Subject: Re: Question about GTK+ and timers
- Date: Sat, 9 Apr 2011 01:08:44 +0100
On Fri, 8 Apr 2011 16:45:03 -0700
Igor Korot <ikorot01 gmail com> wrote:
> Mikhail,
>
> On Fri, Apr 8, 2011 at 4:36 PM, Mikhail Titov <mlt gmx us> wrote:
> > Just use something like __attribute__ ((__packed__)) for your
> > structure and you can always cast back and forth from the pointer
> > to your structure to an array of bytes (char*). Just make sure that
> > both systems have same ending (little or big) and that members'
> > order is correct. Otherwise you'll have to swap data within let's
> > say m_voltageMask .
>
> My intention is to run the program on the ARM architecture (armv4t) -
> S3C2440 mini2440 device from FriendlyARM. So I don't think the
> endianess will be the same here.
> I am building everything from the OpenEmbedded tree with the
> arm-angstrom-gnueabi
> gcc compiler.
>
> What would be the syntax with it?
>
> [code]
> __attribute__((__packed__))
> struct Data
> {
> .............
> } m_data;
>
> and what do you mean by swapping the order of the data?
> I am just relying on the cross-compiler to do the right thing for me
> in terms of endianess.
>
> Should I care about that?
If the machine sending data over the wire has or might have a different
idea of endianness than your ARM architecture receiving it (which
actually is switchable bi-endian I think, but little endian by default),
then you need to care about it.
This might help:
http://en.wikipedia.org/wiki/Endianness
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]