Feature or enhancement
Proposal:
Use do-while(0) construction to protect the expansion of ADJUST_INDICES in:
|
#define ADJUST_INDICES(start, end, len) \ |
|
if (end > len) \ |
|
end = len; \ |
|
else if (end < 0) { \ |
|
end += len; \ |
|
if (end < 0) \ |
|
end = 0; \ |
|
} \ |
|
if (start < 0) { \ |
|
start += len; \ |
|
if (start < 0) \ |
|
start = 0; \ |
|
} |
|
#define ADJUST_INDICES(start, end, len) \ |
|
if (end > len) \ |
|
end = len; \ |
|
else if (end < 0) { \ |
|
end += len; \ |
|
if (end < 0) \ |
|
end = 0; \ |
|
} \ |
|
if (start < 0) { \ |
|
start += len; \ |
|
if (start < 0) \ |
|
start = 0; \ |
|
} |
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Feature or enhancement
Proposal:
Use
do-while(0)construction to protect the expansion ofADJUST_INDICESin:cpython/Objects/unicodeobject.c
Lines 9318 to 9330 in d6d8707
cpython/Objects/bytes_methods.c
Lines 435 to 447 in 2cb84b1
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
ADJUST_INDICES#121166