1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| typedef union {
// assume little-endian (e.g., Intel) for now
struct {
unsigned short clubs;
unsigned short diamonds;
unsigned short hearts;
unsigned short spades;
} bySuit;
#if HAVE_INT64
uint64 as64Bits;
#else
struct {
uint32 cd;
uint32 hs;
} as2x32Bits;
#endif
} Hand_T;
#define CombineHands(dest, source1, source2) \
do { \
(dest).as2x32Bits.cd = (source1).as2x32Bits.cd | (source2).as2x32Bits.cd; \
(dest).as2x32Bits.hs = (source1).as2x32Bits.hs | (source2).as2x32Bits.hs; \
while (0) |
Partager