comp.lang.ada
 help / color / mirror / Atom feed
From: awdorrin <awdorrin@gmail.com>
Subject: Record Elements and Endian Conversion
Date: Thu, 10 Jan 2013 09:31:25 -0800 (PST)
Date: 2013-01-10T09:31:25-08:00	[thread overview]
Message-ID: <fbb1f71f-67c0-4452-896a-35ceca29365e@googlegroups.com> (raw)

I am migrating legacy code written for the PowerPC platform to X86, and have been running into Endian issues throughout the code.

In the latest issue I've discovered, a section of code in which a record has been defined that has 111 components of various data types.

Is there any mechanism within Ada that would provide a way to iterate across all components of a record, perhaps providing their data types?

Problem I have is that this record is used (via a MEMCPY call) to populate a buffer used to transmit an message via Ethernet. While I have adjusted the record's representation clause to put the data fields of the record into the correct bit location, those fields larger than a byte are of the wrong Endianness within the buffer.

Thanks,
-Al



             reply	other threads:[~2013-01-10 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 17:31 awdorrin [this message]
2013-01-10 18:32 ` Record Elements and Endian Conversion Dmitry A. Kazakov
2013-01-10 18:47 ` Niklas Holsti
2013-01-10 19:40 ` awdorrin
2013-01-11 14:44 ` Marc C
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox