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: a07f3367d7,5edee74b13d8e50a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: The "black magic" of ioctl Date: Sat, 23 Oct 2010 17:25:49 +0100 Organization: A noiseless patient Spider Message-ID: References: <74b46743-fb81-48cc-a478-ffd069db2fc6@k22g2000yqh.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="30953"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LddaIdwwRuJBXx6UVOdgHYDUiUeHydf4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:VzVLZUfbuLu5JJGG5CpeCQHbXgY= sha1:kEBixbjFW8Z14dN6n1rHeOeQWMs= Xref: g2news1.google.com comp.lang.ada:14697 Date: 2010-10-23T17:25:49+01:00 List-Id: michael bode writes: > Am 23.10.2010 14:13, schrieb Simon Wright: >> michael bode writes: >> >>> if 0 = Ioctl (Device.Fd, VIDIOC_QUERYCAP, C_Cap'access) then >> >> I recognise the point of this to-me totally counter-intuitive convention >> in C, really not needed in Ada! (or Python ..) > > You mean functions returning error codes? Or putting 0 on the left side > of the equality operator? Calling C functions from Ada is writing C in > Ada syntax. Therefore you hide it in a package that looks like Ada to > the outside. Putting 0 on the left side of the equality operator to make sure you don't accidentally make an assignment.