mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Issue #25923: Added the const qualifier to static constant arrays.
This commit is contained in:
parent
ea8c43152f
commit
2d06e84455
44 changed files with 139 additions and 134 deletions
|
@ -17,7 +17,7 @@
|
|||
* smallmax[base] is the largest unsigned long i such that
|
||||
* i * base doesn't overflow unsigned long.
|
||||
*/
|
||||
static unsigned long smallmax[] = {
|
||||
static const unsigned long smallmax[] = {
|
||||
0, /* bases 0 and 1 are invalid */
|
||||
0,
|
||||
ULONG_MAX / 2,
|
||||
|
@ -62,14 +62,14 @@ static unsigned long smallmax[] = {
|
|||
* Note that this is pessimistic if sizeof(long) > 4.
|
||||
*/
|
||||
#if SIZEOF_LONG == 4
|
||||
static int digitlimit[] = {
|
||||
static const int digitlimit[] = {
|
||||
0, 0, 32, 20, 16, 13, 12, 11, 10, 10, /* 0 - 9 */
|
||||
9, 9, 8, 8, 8, 8, 8, 7, 7, 7, /* 10 - 19 */
|
||||
7, 7, 7, 7, 6, 6, 6, 6, 6, 6, /* 20 - 29 */
|
||||
6, 6, 6, 6, 6, 6, 6}; /* 30 - 36 */
|
||||
#elif SIZEOF_LONG == 8
|
||||
/* [int(math.floor(math.log(2**64, i))) for i in range(2, 37)] */
|
||||
static int digitlimit[] = {
|
||||
static const int digitlimit[] = {
|
||||
0, 0, 64, 40, 32, 27, 24, 22, 21, 20, /* 0 - 9 */
|
||||
19, 18, 17, 17, 16, 16, 16, 15, 15, 15, /* 10 - 19 */
|
||||
14, 14, 14, 14, 13, 13, 13, 13, 13, 13, /* 20 - 29 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue