comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nick.roberts@acm.org>
Subject: Re: Unchecked conversion of arrays?
Date: Sun, 16 May 2004 20:44:37 +0100
Date: 2004-05-16T20:44:37+01:00	[thread overview]
Message-ID: <2gpul4F5bmduU1@uni-berlin.de> (raw)
In-Reply-To: 7_Soc.92431$dP1.290953@newsc.telia.net

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

"Bj�rn Persson" <spam-away@nowhere.nil> wrote in message
news:7_Soc.92431$dP1.290953@newsc.telia.net...

Let's say I have a Wide_String that I need to convert to an array of
bytes. Each byte will of course contain half a Wide_Character, with the
other half in the next byte. Will I have to copy one character at a time
or is there a faster way to do this with representation clauses or
something? I'm thinking Unchecked_Conversion won't be reliable, because
if for example the byte array is packed and Wide_String is not, then (on
a 32-bit machine) I'll get two bytes of garbage between every two bytes
of character data.

Have you considered using streams and Wide_String'Write?

-- 
Nick Roberts





      parent reply	other threads:[~2004-05-16 19:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-13 22:51 Unchecked conversion of arrays? Björn Persson
2004-05-14 10:39 ` Wojtek Narczynski
2004-05-14 17:34   ` Georg Bauhaus
2004-05-15  1:11   ` Jeffrey Carter
2004-05-15 10:20     ` Björn Persson
2004-05-16 19:44 ` Nick Roberts [this message]
replies disabled

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