1 #define DEFINE_CONV_8(name) \
2 static void Convert_##name##_8(const char *buf_in, char *buf_out, wxUint32 len) \
12 #define DEFINE_CONV_16(name) \
13 static void Convert_##name##_16_no(const char *buf_in, char *buf_out, wxUint32 len) \
18 val = *(wxUint16 *)(buf_in); \
24 #define DEFINE_CONV_16(name) \
25 static void Convert_##name##_16_yes(const char *buf_in, char *buf_out, wxUint32 len) \
30 val = *(wxUint16 *)(buf_in); \
31 val = wxUINT16_SWAP_ALWAYS(val); \
39 #define PUT16 *((wxUint16 *)buf_out) = val, buf_out += 2;
40 #define PUT16_SWAP *((wxUint16 *)buf_out) = wxUINT16_SWAP_ALWAYS(val), buf_out += 2;
41 #define PUT8 *buf_out++ = val;
42 #define CHANGE16_SIGN val ^= 0x8000;
43 #define CHANGE8_SIGN val ^= 0x80;
44 #define REDUCE16_TO_8 val /= 256;
45 #define AUGMENT8_TO_16 val *= 256;
52 DEFINE_CONV_16(16to8_U2S)
63 DEFINE_CONV_16(U2S_SWAP)
84 DEFINE_CONV_8(8to16_SWAP)
89 DEFINE_CONV_8(8to16_U2S)
95 DEFINE_CONV_8(8to16_U2S_SWAP)
103 #undef DEFINE_CONV_16