From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6171b9ea6dd53ab X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Advice Please References: <1163141535.700889.83160@k70g2000cwa.googlegroups.com> In-Reply-To: <1163141535.700889.83160@k70g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1163190738 12.201.97.213 (Fri, 10 Nov 2006 20:32:18 GMT) NNTP-Posting-Date: Fri, 10 Nov 2006 20:32:18 GMT Date: Fri, 10 Nov 2006 20:32:18 GMT Xref: g2news2.google.com comp.lang.ada:7405 Date: 2006-11-10T20:32:18+00:00 List-Id: 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