comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Big-endian vs little-endian
Date: 1999/02/02
Date: 1999-02-02T00:00:00+00:00	[thread overview]
Message-ID: <7982p9$nll$3@plug.news.pipex.net> (raw)
In-Reply-To: 36B155D2.2E8573BB@wvu.edu

I can think of two possible solutions:

(a) declare a type derived from Interfaces.Integer_8/16/32 etc. (RM95 B.2),
and then apply a Bit_Order representation clause (RM95 13.5.3) to this type;

(b) use Text_IO instead of Sequential_IO, and input and output the data in
the form of text.

The advantage of (b) is that text is the most universal data format: non-Ada
programs will (almost always) be able to use the data (if that's what you
might ever require). The disadvantage is that the text uses up more storage
than its equivalent binary form. How much data do you have?

The problem with (a) is that it isn't applicable to real types. Nor will it
work if your compiler is an Ada 83 (rather than 95) compiler.

Power to your ulna.

-------------------------------------------
Nick Roberts
-------------------------------------------







  reply	other threads:[~1999-02-02  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-29  0:00 Big-endian vs little-endian Mike Werner
1999-02-02  0:00 ` Nick Roberts [this message]
1999-02-03  0:00   ` Mark A Biggar
1999-02-06  0:00     ` Samuel T. Harris
1999-02-08  0:00       ` dennison
1999-02-08  0:00         ` Samuel T. Harris
1999-02-04  0:00   ` Richard D Riehle
1999-02-06  0:00   ` Mike Werner
1999-02-07  0:00     ` Matthew Heaney
1999-02-09  0:00     ` Stephen Leake
1999-02-10  0:00     ` Mike Werner
replies disabled

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