8000 numbers: Make static variables const · GNOME/libxslt@c7d159b · GitHub
[go: up one dir, main page]

Skip to content

Commit c7d159b

Browse files
committed
numbers: Make static variables const
1 parent c6e2259 commit c7d159b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

libxslt/numbers.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ struct _xsltFormat {
5858
xmlChar *end;
5959
};
6060

61-
static char alpha_upper_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
62-
static char alpha_lower_list[] = "abcdefghijklmnopqrstuvwxyz";
63-
static xsltFormatToken default_token;
61+
static const char alpha_upper_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
62+
static const char alpha_lower_list[] = "abcdefghijklmnopqrstuvwxyz";
63+
static const xsltFormatToken default_token = {
64+
BAD_CAST(DEFAULT_SEPARATOR),
65+
DEFAULT_TOKEN,
66+
1
67+
};
6468

6569
/*
6670
* Helper functions copied from libxml2
@@ -242,7 +246,7 @@ xsltNumberFormatAlpha(xsltNumberDataPtr data,
242246
char temp_string[sizeof(double) * CHAR_BIT * sizeof(xmlChar) + 1];
243247
char *pointer;
244248
int i;
245-
char *alpha_list;
249+
const char *alpha_list;
246250
double alpha_size = (double)(sizeof(alpha_upper_list) - 1);
247251

248252
/*
@@ -364,11 +368,6 @@ xsltNumberFormatTokenize(const xmlChar *format,
364368
int val;
365369
int len;
366370

367-
default_token.token = DEFAULT_TOKEN;
368-
default_token.width = 1;
369-
default_token.separator = BAD_CAST(DEFAULT_SEPARATOR);
370-
371-
372371
tokens->start = NULL;
373372
tokens->tokens[0].separator = NULL;
374373
tokens->end = NULL;
@@ -472,7 +471,7 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data,
472471
{
473472
int i = 0;
474473
double number;
475-
xsltFormatTokenPtr token;
474+
const xsltFormatToken *token;
476475

477476
/*
478477
* Handle initial non-alphanumeric token

0 commit comments

Comments
 (0)
0