From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: [Different Topic] Endianess?
Date: Sun, 16 Sep 2001 06:22:54 GMT
Date: 2001-09-16T06:22:54+00:00 [thread overview]
Message-ID: <3BA44537.59C9F118@acm.org> (raw)
In-Reply-To: UHRo7.12938$mj6.2026261@news6-win.server.ntlworld.com
"chris.danx" wrote:
>
> How could one detect Endianess with Ada 95?
>
> I've seen some C snippets which exploit C arrays, but can see no obvious
> mapping to Ada 95. The C snippet says that for a union of a number and an
> array of 4 bytes, setting the number to one will have a one in the zeroth
> byte of the array for little endian, and zero for a big endian. How do I
> map this to Ada? Use an unchecked conversion perhaps?
>
> Is there another portable (simpler) way?
One way is to use System.Default_Bit_Order. Although technically not the
same as endianness, in practice the two are related.
--
Jeff Carter
"We call your door-opening request a silly thing."
Monty Python & the Holy Grail
next prev parent reply other threads:[~2001-09-16 6:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-15 19:36 Access types and classwide programming chris.danx
2001-09-15 20:28 ` chris.danx
2001-09-15 23:42 ` [Different Topic] Endianess? chris.danx
2001-09-16 6:22 ` Jeffrey Carter [this message]
2001-09-17 7:37 ` Juanma Barranquero
2001-09-17 7:53 ` Assigning the value of a deferred constant? Juanma Barranquero
2001-09-17 14:04 ` Ted Dennison
2001-09-17 14:36 ` Juanma Barranquero
2001-09-17 17:36 ` tmoran
2001-09-18 8:16 ` Juanma Barranquero
2001-09-18 18:40 ` Richard Riehle
2001-09-19 2:07 ` Vincent Marciante
2001-09-19 7:39 ` Juanma Barranquero
2001-09-16 6:19 ` Access types and classwide programming Jeffrey Carter
2001-09-16 13:37 ` chris.danx
2001-09-16 16:49 ` Jeffrey Carter
2001-09-16 18:24 ` David C. Hoos, Sr.
2001-09-17 6:15 ` Jeffrey Carter
2001-09-17 4:57 ` tmoran
2001-09-17 14:16 ` Ted Dennison
2001-09-16 9:32 ` tmoran
2001-09-17 9:41 ` John McCabe
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox