Issue #25923: Added the const qualifier to static constant arrays.

This commit is contained in:
Serhiy Storchaka 2015-12-25 19:53:18 +02:00
parent ea8c43152f
commit 2d06e84455
44 changed files with 139 additions and 134 deletions

View file

@ -881,12 +881,12 @@ PyAPI_FUNC(char *) PyOS_double_to_string(double val,
#define OFS_E 2
/* The lengths of these are known to the code below, so don't change them */
static char *lc_float_strings[] = {
static const char * const lc_float_strings[] = {
"inf",
"nan",
"e",
};
static char *uc_float_strings[] = {
static const char * const uc_float_strings[] = {
"INF",
"NAN",
"E",
@ -925,7 +925,8 @@ static char *
format_float_short(double d, char format_code,
int mode, int precision,
int always_add_sign, int add_dot_0_if_integer,
int use_alt_formatting, char **float_strings, int *type)
int use_alt_formatting, const char * const *float_strings,
int *type)
{
char *buf = NULL;
char *p = NULL;
@ -1176,7 +1177,7 @@ PyAPI_FUNC(char *) PyOS_double_to_string(double val,
int flags,
int *type)
{
char **float_strings = lc_float_strings;
const char * const *float_strings = lc_float_strings;
int mode;
/* Validate format_code, and map upper and lower case. Compute the