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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a6fe9ef21ba269dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: Ada Smileys in C++ lib Conversion Date: Mon, 16 Aug 2010 14:54:45 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <1a9b39b0-73f6-497c-a8f4-abf8129886ac@t20g2000yqa.googlegroups.com> <9b88e5a4-c588-4997-ad5c-2efa216fe4f4@a4g2000prm.googlegroups.com> <95tc66hjv3stdk0nhdv9o46e5l2ecdog5j@4ax.com> Injection-Date: Mon, 16 Aug 2010 14:54:45 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="24478"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18twAfYJG0Z7gF8J4Uk6+e+qOaYFnKlvYQ=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:RvBu/Z63P8G+M4QM/MMyofxB+Dg= Xref: g2news1.google.com comp.lang.ada:13413 Date: 2010-08-16T14:54:45+00:00 List-Id: Brian Drummond expounded in news:95tc66hjv3stdk0nhdv9o46e5l2ecdog5j@4ax.com: >>About the only thing you could do (in C/C++) is to code >>a macro check on the constants, but I don't think I've >>ever seen it done in practice. Only as a argument value >>assertion check in strategic places. > > Heh too. > > I thought I was being really really smart years ago in C, when I > decided to convert all those #defines to integer constants... > > const int MC_CTL_LOCAL_C = 0x80; > and so on. .. > - Brian Another approach is to declare them as enums. But this is unhelpful because they are all implemented as int's. Further, the switch statement doesn't tell you about the cases which are missing. Warren