1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

Make some globals const

This commit is contained in:
Nick Wellnhofer
2024-04-28 17:32:35 +02:00
parent 577fb0e380
commit 63ce5f9aed
3 changed files with 26 additions and 26 deletions

View File

@@ -2940,7 +2940,7 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
* Lookup tables for ISO-8859-2..ISO-8859-16 transcoding * * Lookup tables for ISO-8859-2..ISO-8859-16 transcoding *
************************************************************************/ ************************************************************************/
static unsigned short const xmlunicodetable_ISO8859_2 [128] = { static const unsigned short xmlunicodetable_ISO8859_2 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -2989,7 +2989,7 @@ static const unsigned char xmltranscodetable_ISO8859_2 [48 + 6 * 64] = {
"\x00\x00\x00\xf3\xf4\x00\xf6\xf7\x00\x00\xfa\x00\xfc\xfd\x00\x00" "\x00\x00\x00\xf3\xf4\x00\xf6\xf7\x00\x00\xfa\x00\xfc\xfd\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_3 [128] = { static const unsigned short xmlunicodetable_ISO8859_3 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3042,7 +3042,7 @@ static const unsigned char xmltranscodetable_ISO8859_3 [48 + 7 * 64] = {
"\x00\xf1\xf2\xf3\xf4\x00\xf6\xf7\x00\xf9\xfa\xfb\xfc\x00\x00\x00" "\x00\xf1\xf2\xf3\xf4\x00\xf6\xf7\x00\xf9\xfa\xfb\xfc\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_4 [128] = { static const unsigned short xmlunicodetable_ISO8859_4 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3091,7 +3091,7 @@ static const unsigned char xmltranscodetable_ISO8859_4 [48 + 6 * 64] = {
"\x00\x00\x00\x00\xf4\xf5\xf6\xf7\xf8\x00\xfa\xfb\xfc\x00\x00\x00" "\x00\x00\x00\x00\xf4\xf5\xf6\xf7\xf8\x00\xfa\xfb\xfc\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_5 [128] = { static const unsigned short xmlunicodetable_ISO8859_5 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3140,7 +3140,7 @@ static const unsigned char xmltranscodetable_ISO8859_5 [48 + 6 * 64] = {
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_6 [128] = { static const unsigned short xmlunicodetable_ISO8859_6 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3185,7 +3185,7 @@ static const unsigned char xmltranscodetable_ISO8859_6 [48 + 5 * 64] = {
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_7 [128] = { static const unsigned short xmlunicodetable_ISO8859_7 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3238,7 +3238,7 @@ static const unsigned char xmltranscodetable_ISO8859_7 [48 + 7 * 64] = {
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_8 [128] = { static const unsigned short xmlunicodetable_ISO8859_8 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3291,7 +3291,7 @@ static const unsigned char xmltranscodetable_ISO8859_8 [48 + 7 * 64] = {
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_9 [128] = { static const unsigned short xmlunicodetable_ISO8859_9 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3336,7 +3336,7 @@ static const unsigned char xmltranscodetable_ISO8859_9 [48 + 5 * 64] = {
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_10 [128] = { static const unsigned short xmlunicodetable_ISO8859_10 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3389,7 +3389,7 @@ static const unsigned char xmltranscodetable_ISO8859_10 [48 + 7 * 64] = {
"\xf0\x00\x00\xf3\xf4\xf5\xf6\x00\xf8\x00\xfa\xfb\xfc\xfd\xfe\x00" "\xf0\x00\x00\xf3\xf4\xf5\xf6\x00\xf8\x00\xfa\xfb\xfc\xfd\xfe\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_11 [128] = { static const unsigned short xmlunicodetable_ISO8859_11 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3438,7 +3438,7 @@ static const unsigned char xmltranscodetable_ISO8859_11 [48 + 6 * 64] = {
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_13 [128] = { static const unsigned short xmlunicodetable_ISO8859_13 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3491,7 +3491,7 @@ static const unsigned char xmltranscodetable_ISO8859_13 [48 + 7 * 64] = {
"\x00\x00\x00\x00\x00\x00\xcd\xed\x00\x00\x00\xcf\xef\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xcd\xed\x00\x00\x00\xcf\xef\x00\x00\x00"
}; };
static unsigned short const xmlunicodetable_ISO8859_14 [128] = { static const unsigned short xmlunicodetable_ISO8859_14 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3556,7 +3556,7 @@ static const unsigned char xmltranscodetable_ISO8859_14 [48 + 10 * 64] = {
"\x00\xf1\xf2\xf3\xf4\xf5\xf6\x00\xf8\xf9\xfa\xfb\xfc\xfd\x00\xff" "\x00\xf1\xf2\xf3\xf4\xf5\xf6\x00\xf8\xf9\xfa\xfb\xfc\xfd\x00\xff"
}; };
static unsigned short const xmlunicodetable_ISO8859_15 [128] = { static const unsigned short xmlunicodetable_ISO8859_15 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
@@ -3605,7 +3605,7 @@ static const unsigned char xmltranscodetable_ISO8859_15 [48 + 6 * 64] = {
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
}; };
static unsigned short const xmlunicodetable_ISO8859_16 [128] = { static const unsigned short xmlunicodetable_ISO8859_16 [128] = {
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,

View File

@@ -33,35 +33,35 @@
* The XML predefined entities. * The XML predefined entities.
*/ */
static xmlEntity xmlEntityLt = { static const xmlEntity xmlEntityLt = {
NULL, XML_ENTITY_DECL, BAD_CAST "lt", NULL, XML_ENTITY_DECL, BAD_CAST "lt",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
BAD_CAST "<", BAD_CAST "<", 1, BAD_CAST "<", BAD_CAST "<", 1,
XML_INTERNAL_PREDEFINED_ENTITY, XML_INTERNAL_PREDEFINED_ENTITY,
NULL, NULL, NULL, NULL, 0, 0, 0 NULL, NULL, NULL, NULL, 0, 0, 0
}; };
static xmlEntity xmlEntityGt = { static const xmlEntity xmlEntityGt = {
NULL, XML_ENTITY_DECL, BAD_CAST "gt", NULL, XML_ENTITY_DECL, BAD_CAST "gt",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
BAD_CAST ">", BAD_CAST ">", 1, BAD_CAST ">", BAD_CAST ">", 1,
XML_INTERNAL_PREDEFINED_ENTITY, XML_INTERNAL_PREDEFINED_ENTITY,
NULL, NULL, NULL, NULL, 0, 0, 0 NULL, NULL, NULL, NULL, 0, 0, 0
}; };
static xmlEntity xmlEntityAmp = { static const xmlEntity xmlEntityAmp = {
NULL, XML_ENTITY_DECL, BAD_CAST "amp", NULL, XML_ENTITY_DECL, BAD_CAST "amp",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
BAD_CAST "&", BAD_CAST "&", 1, BAD_CAST "&", BAD_CAST "&", 1,
XML_INTERNAL_PREDEFINED_ENTITY, XML_INTERNAL_PREDEFINED_ENTITY,
NULL, NULL, NULL, NULL, 0, 0, 0 NULL, NULL, NULL, NULL, 0, 0, 0
}; };
static xmlEntity xmlEntityQuot = { static const xmlEntity xmlEntityQuot = {
NULL, XML_ENTITY_DECL, BAD_CAST "quot", NULL, XML_ENTITY_DECL, BAD_CAST "quot",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
BAD_CAST "\"", BAD_CAST "\"", 1, BAD_CAST "\"", BAD_CAST "\"", 1,
XML_INTERNAL_PREDEFINED_ENTITY, XML_INTERNAL_PREDEFINED_ENTITY,
NULL, NULL, NULL, NULL, 0, 0, 0 NULL, NULL, NULL, NULL, 0, 0, 0
}; };
static xmlEntity xmlEntityApos = { static const xmlEntity xmlEntityApos = {
NULL, XML_ENTITY_DECL, BAD_CAST "apos", NULL, XML_ENTITY_DECL, BAD_CAST "apos",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
BAD_CAST "'", BAD_CAST "'", 1, BAD_CAST "'", BAD_CAST "'", 1,
@@ -303,21 +303,21 @@ xmlGetPredefinedEntity(const xmlChar *name) {
switch (name[0]) { switch (name[0]) {
case 'l': case 'l':
if (xmlStrEqual(name, BAD_CAST "lt")) if (xmlStrEqual(name, BAD_CAST "lt"))
return(&xmlEntityLt); return((xmlEntityPtr) &xmlEntityLt);
break; break;
case 'g': case 'g':
if (xmlStrEqual(name, BAD_CAST "gt")) if (xmlStrEqual(name, BAD_CAST "gt"))
return(&xmlEntityGt); return((xmlEntityPtr) &xmlEntityGt);
break; break;
case 'a': case 'a':
if (xmlStrEqual(name, BAD_CAST "amp")) if (xmlStrEqual(name, BAD_CAST "amp"))
return(&xmlEntityAmp); return((xmlEntityPtr) &xmlEntityAmp);
if (xmlStrEqual(name, BAD_CAST "apos")) if (xmlStrEqual(name, BAD_CAST "apos"))
return(&xmlEntityApos); return((xmlEntityPtr) &xmlEntityApos);
break; break;
case 'q': case 'q':
if (xmlStrEqual(name, BAD_CAST "quot")) if (xmlStrEqual(name, BAD_CAST "quot"))
return(&xmlEntityQuot); return((xmlEntityPtr) &xmlEntityQuot);
break; break;
default: default:
break; break;

View File

@@ -224,7 +224,7 @@ xmlXPathIsInf(double val) {
* the test should just be name[0] = ' ' * the test should just be name[0] = ' '
*/ */
static xmlNs xmlXPathXMLNamespaceStruct = { static const xmlNs xmlXPathXMLNamespaceStruct = {
NULL, NULL,
XML_NAMESPACE_DECL, XML_NAMESPACE_DECL,
XML_XML_NAMESPACE, XML_XML_NAMESPACE,
@@ -232,7 +232,7 @@ static xmlNs xmlXPathXMLNamespaceStruct = {
NULL, NULL,
NULL NULL
}; };
static xmlNsPtr xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct; static const xmlNs *const xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct;
#ifndef LIBXML_THREAD_ENABLED #ifndef LIBXML_THREAD_ENABLED
/* /*
* Optimizer is disabled only when threaded apps are detected while * Optimizer is disabled only when threaded apps are detected while