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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1233ddaa2bb38b2 X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: Re: Or Date: 2000/01/31 Message-ID: #1/1 X-Deja-AN: 580029169 References: Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 2000-01-31T00:00:00+00:00 List-Id: Jan Kroken wrote in message ... > >I need bitwise or on Interfaces.C.Int. I couldn't find any >direct or operator in Ada, so I wrote the following: Ada modular types provide bitwise operations. So if you need bitwise operations on Integers or C.Int you should change their view to modular type and then do bitwise operations. Something like this: CIM is new Ada.Unchecked_Conversion ( Interfaces.C.Int, Interfaces.C.Unsigned); CMI is new Ada.Unchecked_Conversion ( Interfaces.C.Unsigned, Interfaces.C.Int); ... a : Interfaces.C.Int; b : Interfaces.C.Int; c : Interfaces.C.Int; c := CMI ( CIM(a) or CIM (b) ); That's all you need. Regards, Vladimir Olensky