Eee image: fix macros to be surrounded with do while().
authorTom Hacohen <tom@stosb.com>
Wed, 14 Jan 2015 08:54:58 +0000 (08:54 +0000)
committerTom Hacohen <tom@stosb.com>
Wed, 14 Jan 2015 08:55:30 +0000 (08:55 +0000)
Macros should be surrounded with do {} while() statements,
otherwise there can be issues, like the macro not requiring a semicolon
after the statement or etc.

@fix

src/lib/eet/eet_image.c

index bfaff2e..cd92ca0 100644 (file)
@@ -332,9 +332,9 @@ eet_data_image_jpeg_alpha_convert(int         *size,
 #endif /* ifdef CONV64 */
 
 #define CONV8(x)
-#define CONV16(x) {if (_eet_image_words_bigendian) {SWAP16(x); }}
-#define CONV32(x) {if (_eet_image_words_bigendian) {SWAP32(x); }}
-#define CONV64(x) {if (_eet_image_words_bigendian) {SWAP64(x); }}
+#define CONV16(x) do {if (_eet_image_words_bigendian) {SWAP16(x); }} while(0)
+#define CONV32(x) do {if (_eet_image_words_bigendian) {SWAP32(x); }} while(0)
+#define CONV64(x) do {if (_eet_image_words_bigendian) {SWAP64(x); }} while(0)
 
 /*---*/