comp.lang.ada
 help / color / mirror / Atom feed
From: Daniel <danielnorberto@gmail.com>
Subject: Re: Simple Data Endianness
Date: Thu, 13 Feb 2020 07:44:04 -0800 (PST)
Date: 2020-02-13T07:44:04-08:00	[thread overview]
Message-ID: <21f3f3e5-b462-4359-adf9-700c5647f573@googlegroups.com> (raw)
In-Reply-To: <2a19cdb1-6f01-4b1d-8597-b6ee21ed60ed@googlegroups.com>

i guess you want to serialize this data between 2 diferents CPUs families.

I think ADA only thought an automatic solution for mapped records.

You have two solutions.

First is really ugly: Put that type into a field of a single field mapped record.

Sencod is also ugly: Swap by your self the 4 bytes of this 32 bits type. Gnat have for example gnat.Byte_Swapping.Swap4 library to do it.

Regards.


  parent reply	other threads:[~2020-02-13 15:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  9:42 Simple Data Endianness guijarrockguijarro
2020-02-13 11:10 ` Dmitry A. Kazakov
2020-02-13 15:12   ` Optikos
2020-02-13 15:28     ` Dmitry A. Kazakov
2020-02-13 16:47       ` Optikos
2020-02-13 17:29         ` Dmitry A. Kazakov
2020-02-13 20:36           ` Optikos
2020-02-14  8:20             ` Dmitry A. Kazakov
2020-02-14 17:25               ` Optikos
2020-02-14 20:22                 ` Dmitry A. Kazakov
2020-02-15 14:56                   ` Optikos
2020-02-13 15:44 ` Daniel [this message]
2020-02-13 15:57   ` Dmitry A. Kazakov
2020-02-14 16:52 ` Shark8
replies disabled

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