|
|
|
|
91
|
//<
|
91
|
//<
|
92
|
//< If 'b' == 0 then return 'f' with the bits in 'm' cleared.
|
92
|
//< If 'b' == 0 then return 'f' with the bits in 'm' cleared.
|
93
|
//< otherwise return 'f' with the bits in 'm' set.
|
93
|
//< otherwise return 'f' with the bits in 'm' set.
|
|
|
94
|
+
|
|
|
95
|
+// In-place assignment version of the above bit operations
|
|
|
96
|
+#define cmSetBits(f,m) ((f) |= (m)) // Set 'f' with the bits in 'm' set.
|
|
|
97
|
+#define cmClrBits(f,m) ((f) &= (~(m))) // Set 'f' with the bits in 'm' cleared.
|
|
|
98
|
+#define cmTogBits(f,m) ((f)^=(m)) // Return 'f' with the bits in 'm' toggled.
|
|
|
99
|
+#define cmEnaBits(f,m,b) ((b) ? cmSetBits(f,m) : cmClrBits(f,m)) // Set or clear bits in 'f' based on bits in 'm' and the state of 'b'.
|
94
|
|
100
|
|
95
|
|
101
|
|
96
|
#define cmMin(v0,v1) ((v0)<(v1) ? (v0) : (v1)) //< Return the minimum arg.
|
102
|
#define cmMin(v0,v1) ((v0)<(v1) ? (v0) : (v1)) //< Return the minimum arg.
|