Path: utzoo!attcan!uunet!samsung!gem.mps.ohio-state.edu!usc!bbn!diamond.bbn.com!mlandau From: mlandau@bbn.com (Matt Landau) Newsgroups: comp.lang.c Subject: Re: binary constants (??) Keywords: macro, constant, binary Message-ID: <13261@granite.BBN.COM> Date: 21 Nov 89 16:03:15 GMT References: <305@frf.omron.co.jp> <602@chem.ucsd.EDU> <7065@ficc.uu.net> <2765@munnari.oz.au> Sender: news@bbn.com Lines: 49 On the subject of binary constants for creating cursor or image data, here's a reposting of one of the more clever things I've seen come across comp.lang.c. It's trivial to adapt this to use a syntax more suited to traditional sets of flags, etc. -- Matt Landau Oblivion gallops closer, mlandau@bbn.com favoring the spur, sparing the rein. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Article 5640 of comp.lang.c: >From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Binary integer literals Date: 12 Dec 87 01:15:32 GMT #include #define __ ((((((((((((((((0 #define _ <<1|0) #define X <<1|1) static unsigned short CursorPattern[16] = { __ X X X X X X X X _ _ _ _ _ _ _ _ , __ X _ _ _ _ _ X _ _ _ _ _ _ _ _ _ , __ X _ _ _ _ X _ _ _ _ _ _ _ _ _ _ , __ X _ _ _ _ _ X _ _ _ _ _ _ _ _ _ , __ X _ _ _ _ _ _ X _ _ _ _ _ _ _ _ , __ X _ X _ _ _ _ _ X _ _ _ _ _ _ _ , __ X X _ X _ _ _ _ _ X _ _ _ _ _ _ , __ X _ _ _ X _ _ _ X _ _ _ _ _ _ _ , __ _ _ _ _ _ X _ X _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ X _ _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ , __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ }; main() { int i; for (i = 0; i < sizeof CursorPattern / sizeof CursorPattern[0]; ++i) (void) printf("%04x\n", CursorPattern[i]); return 0; }