Re: [AD] [ alleg-Bugs-2333410 ] think of a way to allocate user event type numbers.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 11 Dec 2008, at 15:49, Milan Mimica wrote:
How about this:
#define ALLEGRO_EVENT_ID(a,b,c,d,e,f)     ((((a)-0x41)<<25) \
                                          | (((b)-0x41)<<20) \
                                          | (((c)-0x41)<<15) \
                                          | (((d)-0x41)<<10) \
                                          | (((e)-0x41)<<5)  \
                                          |  ((f)-0x41))

It uniquely codes any of the upper case letters and [\]^_`. Leaves 2 bits for
something...

Leaves out numbers though (based on your description), which isn't particularly nice. I do like the idea of leaving some extra free bits though... we could "reserve" those for our own use if we wanted to. May not be necessary though.

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/