From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: Advice Please
Date: Fri, 10 Nov 2006 20:32:18 GMT
Date: 2006-11-10T20:32:18+00:00 [thread overview]
Message-ID: <ml55h.275125$1i1.164439@attbi_s72> (raw)
In-Reply-To: <1163141535.700889.83160@k70g2000cwa.googlegroups.com>
laehyung wrote:
>
> ---------------------------------------
> function Conv_U8_To_Char is
> new Ada.Unchecked_Conversion(Source => Unsigned_8,
> Target => Character);
Character'Val does the same thing.
> function Conv_Char_To_U8 is
> new Ada.Unchecked_Conversion(Source => Character,
> Target => Unsigned_8);
Character'Pos does the same thing.
> C(Idx):=
> Unsigned_8(Character'Pos(Item(Idx))-Character'Pos('0'));
No conversion should be necessary. Character'Pos returns a universal
integer, which is implicitly converted.
> Strtemp1 := Shift_Left(Unsigned_8(C(2*I-1)),4) and
> Unsigned_8(16#FF#);
No conversions are necessary. C (...) is already of type Unsigned_8, and
16#FF#, an integer literal, may be used with any integer type without
conversion.
--
Jeff Carter
"Go and boil your bottoms."
Monty Python & the Holy Grail
01
prev parent reply other threads:[~2006-11-10 20:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-10 6:52 Advice Please laehyung
2006-11-10 9:27 ` Dmitry A. Kazakov
2006-11-10 20:32 ` Jeffrey R. Carter [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