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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9dec3ff1604723d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Bitmanipulation in Ada From: Bernd.Specht@gmx.com (Bernd Specht) References: <87k6vwrwym.fsf@insalien.org> Organization: No company Message-ID: User-Agent: Xnews/4.05.03 Date: 19 Aug 2004 17:44:05 GMT NNTP-Posting-Date: 19 Aug 2004 19:44:05 MEST NNTP-Posting-Host: b7302d4c.newsread4.arcor-online.net X-Trace: DXC=iP2@n[9MYHAbSWda:jMWf@:ejgIfPPldDjW\KbG]kaMHlSE5DYV?adA:<31E>kg_aLWEh14DWb8DH;LDWnW3KT4KWgCQFTm`h_F X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2863 Date: 2004-08-19T19:44:05+02:00 List-Id: Jeffrey Carter wrote in news:wSSUc.27249$9Y6.977 @newsread1.news.pas.earthlink.net: > Bernd Specht wrote: > That may be what you want. What a software engineer wants is the > clearest software that meets the requirements. Unchecked_Conversion will > almost always provide this. Sure. > In many cases, Unchecked_Conversion will generate no code, and need not > involve an assignment. In well designed software, the part(s) of the > software that deals with values as an integer and those that deal with > them as bit arrays will be kept separate. So you do something like: Always? What do you think about bitscrambling software which has to treat data alternating as bitvector and as integer value in a loop like this (not exeactly this for securitity reasons): ... loop declare x : boolean; begin x := b(k); b(k) := b(32 - k); b (32 - k) := x; I := I * prime1 mod prime2; end; end loop; Can you find an equivalent algorithm where you can separate the bit-ops and the integer-ops?