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,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!130.161.131.117.MISMATCH!tudelft.nl!newsfeed.multikabel.nl!surfnet.nl!news.tue.nl!not-for-mail From: Willem Newsgroups: comp.lang.ada,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Sat, 12 Mar 2005 12:52:22 +0000 (UTC) Organization: Eindhoven University of Technology, The Netherlands Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <112rs0bdr2aftdf@corp.supernews.com> <1inxxr988rxgg$.1w9dedak41k89.dlg@40tude.net> <112s1r0rf0o8nca@corp.supernews.com> <112sonip5v4dca6@corp.supernews.com> <112t3de6fu04f38@corp.supernews.com> <1110396477.596174.285520@o13g2000cwo.googlegroups.com> <112vb2t8eonuhed@corp.supernews.com> <1110422108.925127.54110@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: toad.stack.nl X-Trace: news.tue.nl 1110631942 23463 131.155.140.135 (12 Mar 2005 12:52:22 GMT) X-Complaints-To: abuse@tue.nl NNTP-Posting-Date: Sat, 12 Mar 2005 12:52:22 +0000 (UTC) User-Agent: slrn/0.9.8.0 (FreeBSD) Xref: g2news1.google.com comp.lang.ada:9225 comp.realtime:1357 comp.software-eng:4920 Date: 2005-03-12T12:52:22+00:00 List-Id: jimmaureenrogers@worldnet.att.net wrote: ) -- Highest bit set ) with Ada.Text_Io; ) with Ada.Calendar; use Ada.Calendar; ) ) procedure Highest_Bit_Set is ) Num : Integer; ) type Index_Type is mod 32; ) type Bit_Array is array(Index_Type) of Boolean; ) pragma Pack(Bit_Array); ) Overlay : Bit_Array; ) for Overlay'Address use Num'Address; ) Start, Stop : Time; ) begin ) Start := Clock; ) Num := 0; Are you sure the compiler doesn't recognise that 'Num' is constant and precalculate the endresult, by the way ? I think a test that loops over different values of 'Num' would be better. Maybe a print of the assembly that the compiler spits out from this code would be nice to have a look at as well. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT