WinCE support in LD
Thu Feb 24 13:16:00 GMT 2000
> Date: Wed, 23 Feb 2000 20:59:04 -0500
> From: DJ Delorie <email@example.com>
> CC: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org
> > Still, wouldn't something like
> > case THIS | THAT:
> > be clearer?
> Not when both THIS and THAT are the same value.
I'd recommend using a macro (or similar):
#define JOIN (a, b) ((a) * 32 + (b))
switch (JOIN (v1, v2))
case JOIN (v1, v2):
This may allow the compiler to generate better code (using a table
instead of a branch tree) for the switch if you can make it more
compact, and it makes the source clearer.
I'm not sure if I would really put a space after the macro in the
cases; it looks _very_ weird.
case (3, 4):
is apparently legal C.
- Geoffrey Keating <email@example.com>
More information about the Binutils