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.4 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY,PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f7c597cb40b4adf8 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Help! (How to do this (C) in Ada? Date: 1999/05/14 Message-ID: <7hhh5g$avj$1@nnrp1.deja.com>#1/1 X-Deja-AN: 477833977 References: <7heg6m$43a$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x34.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Fri May 14 15:57:38 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-05-14T00:00:00+00:00 List-Id: In article , Hyman Rosen wrote: > byhoe@my-dejanews.com writes: > > I am puzzle with the following C code: > > #define InheritLayout ((Boolean (*)())_Inherit) > > How can I implement the above in Ada? > > In C, this is a typecast of the value of _Inherit (whatever that is) > into a pointer to a function which takes no arguments and returns a > Boolean (whatever that is). I don't know Ada myself, but my guess > would be that in Ada you declare a type which is access to the correct > type of function, then use unchecked_conversion to convert _Inherit to > that type. You probably wouldn't need unchecked conversion, since the types would be the same. But then again, if you are somewhat carful about how you define your types, you might not need this conversion routine at all. -- T.E.D. --== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.---