Detroit_Aristo
Well-known member
I am trying to use a define macro to handle the millions of conversions I have to do a second and I am getting tons of warnings. Will someone with more compiled switching and __attribute__ knowledge take a stab at educating me?
Warning:
I am just not sure how to make the compiler happy in this instance.
Thanks Ladies and Gents!
Code:
#define BYTE_TO_BINARY(byte) ((byte & 0x80 ? '1' : '0'), \
(byte & 0x40 ? '1' : '0'), \
(byte & 0x20 ? '1' : '0'), \
(byte & 0x10 ? '1' : '0'), \
(byte & 0x08 ? '1' : '0'), \
(byte & 0x04 ? '1' : '0'), \
(byte & 0x02 ? '1' : '0'), \
(byte & 0x01 ? '1' : '0') )
Code:
decode.cpp:156: note in expansion of macro BYTE_TO_BINARY
CompleteSwappedBytes = BYTE_TO_BINARY(CompleteSwappedBytes >> 8), BYTE_TO_BINARY(CompleteSwappedBytes)
warning: second operand of conditional expression has no effect [-Wunused-value]
I am just not sure how to make the compiler happy in this instance.
Thanks Ladies and Gents!