File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -425,11 +425,13 @@ Py_ssize_t BUILD_SIZE(Py_ssize_t bitsize, Py_ssize_t offset) {
425
425
/* This macro CHANGES the first parameter IN PLACE. For proper sign handling,
426
426
we must first shift left, then right.
427
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
- }
428
+ #define GET_BITFIELD (v , size ) \
429
+ do { \
430
+ if (NUM_BITS(size)) { \
431
+ v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \
432
+ v >>= (sizeof(v)*8 - NUM_BITS(size)); \
433
+ } \
434
+ } while (0)
433
435
434
436
/* This macro RETURNS the first parameter with the bit field CHANGED. */
435
437
#define SET (type , x , v , size ) \
You can’t perform that action at this time.
0 commit comments