Commit 0614af18 authored by Sergei Golubchik's avatar Sergei Golubchik

macro do {} while(0) safety

parent bbbd7ced
...@@ -476,7 +476,7 @@ typedef unsigned int uint; ...@@ -476,7 +476,7 @@ typedef unsigned int uint;
typedef unsigned short ushort; typedef unsigned short ushort;
#endif #endif
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; } #define swap_variables(t, a, b) do { t dummy; dummy= a; a= b; b= dummy; } while(0)
#define test(a) ((a) ? 1 : 0) #define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) #define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment