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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f71c159449d6e114 X-Google-Attributes: gid103376,public From: bgaffney42@aol.com (BGaffney42) Subject: Re: Ada 83 - avoiding unchecked conversions. Date: 1996/12/14 Message-ID: <19961214022200.VAA03584@ladder01.news.aol.com>#1/1 X-Deja-AN: 204016127 references: organization: AOL http://www.aol.com newsgroups: comp.lang.ada x-admin: news@aol.com Date: 1996-12-14T00:00:00+00:00 List-Id: I'm sorry, I must be missing something. Why would you want to use Unchecked_Conversion or some form of overlay for this problem? Why can't the following function be used (assuming Integer_16 and Integer_32 are defined with appropriate ranges and 'Sizes? function Convert (Hi, Lo : Integer_16) return Integer_32 is Shift_16 : constant Integer_32 := 2**16; begin if Lo < 0 then return Integer_32(Hi) * Shift_16 + (Shift_16 + Integer_32(Lo)); else return Integer_32(Hi) * Shift_16 + Integer_32(Lo); end if; end Convert; -- _really_ psycho engineer -- using Ada as a toy and _not_ working for an Ada vendor! --Brian Gaffney