We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Modules/_ctypes/cfield.c
do { ... } while (0)
1 parent 34de314 commit 7f1eb83Copy full SHA for 7f1eb83
Modules/_ctypes/cfield.c
@@ -425,11 +425,13 @@ Py_ssize_t BUILD_SIZE(Py_ssize_t bitsize, Py_ssize_t offset) {
425
/* This macro CHANGES the first parameter IN PLACE. For proper sign handling,
426
we must first shift left, then right.
427
*/
428
-#define GET_BITFIELD(v, size) \
429
- if (NUM_BITS(size)) { \
430
- v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \
431
- v >>= (sizeof(v)*8 - NUM_BITS(size)); \
432
- }
+#define GET_BITFIELD(v, size) \
+ do { \
+ if (NUM_BITS(size)) { \
+ v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \
+ v >>= (sizeof(v)*8 - NUM_BITS(size)); \
433
+ } \
434
+ } while (0)
435
436
/* This macro RETURNS the first parameter with the bit field CHANGED. */
437
#define SET(type, x, v, size) \
0 commit comments