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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-22 14:57:49 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mail From: Dale Stanbrough Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: Subtle Bugs, kudos Ada (was How Ada ...Red Code ...) Organization: RMIT References: <3B6555ED.9B0B0420@sneakemail.com> <87n15lxzzv.fsf@deneb.enyo.de> <3B672322.B5EA1B66@home.com> <4a885870.0108112341.7ce02ac0@posting.google.com> <3B834E5D.B0D26AB1@adaworks.com> <9lvsic$bet9s$1@ID-9852.news.dfncis.de> <9m0193$grs$1@bird.wu-wien.ac.at> <3B83F042.4CFB073D@home.com> User-Agent: MT-NewsWatcher/3.1 (PPC) Message-ID: Date: Wed, 22 Aug 2001 21:57:48 GMT NNTP-Posting-Host: 144.132.94.47 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 998517468 144.132.94.47 (Thu, 23 Aug 2001 07:57:48 EST) NNTP-Posting-Date: Thu, 23 Aug 2001 07:57:48 EST Xref: archiver1.google.com comp.lang.ada:12294 comp.lang.c:76255 comp.lang.c++:84965 Date: 2001-08-22T21:57:48+00:00 List-Id: Kaz Kylheku wrote: > Even before seeing the body of the function, I wonder why it's using > old-style C. Even if there is a good reason for using old-style C, > why is it using a promotable type for a parameter? The use of a promotable > type means that if a correct function prototype is written for the > function, it will have to use the promoted type, that is to say: > > unsigned char st_linear_to_Alaw (int sample); > > Lastly, why is the type short being used at all? The advantage of short > is that it may provide a compact representation for a large array of > integers, provided that a range no wider than -32767 to 32767 is required > (the minimum range required by ANSI/ISO C for the type short). > [...] So we can say in summary that Ada helps when people make mistakes? Dale