From 8f57103793e1e1b1be478f1feb607d19d725d048 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Mon, 28 Aug 2017 21:27:03 +0200 Subject: [PATCH] Add const in five places to move 1 KiB to .rdata xmlUnicodeBlocks is logically const but was not marked as such. This fixes that, thus moving it to the read-only data segment. --- genUnicode.py | 4 ++-- xmlunicode.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/genUnicode.py b/genUnicode.py index 56e4e9ba..4487eeb5 100755 --- a/genUnicode.py +++ b/genUnicode.py @@ -267,14 +267,14 @@ typedef struct { } xmlUnicodeRange; typedef struct { - xmlUnicodeRange *table; + const xmlUnicodeRange *table; int numentries; } xmlUnicodeNameTable; static xmlIntFunc *xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname); -static xmlUnicodeRange xmlUnicodeBlocks[] = { +static const xmlUnicodeRange xmlUnicodeBlocks[] = { """ % (webpage, date, sources)); flag = 0 diff --git a/xmlunicode.c b/xmlunicode.c index ce6e9a4f..6d0a96a0 100644 --- a/xmlunicode.c +++ b/xmlunicode.c @@ -29,14 +29,14 @@ typedef struct { } xmlUnicodeRange; typedef struct { - xmlUnicodeRange *table; + const xmlUnicodeRange *table; int numentries; } xmlUnicodeNameTable; static xmlIntFunc *xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname); -static xmlUnicodeRange xmlUnicodeBlocks[] = { +static const xmlUnicodeRange xmlUnicodeBlocks[] = { {"AegeanNumbers", xmlUCSIsAegeanNumbers}, {"AlphabeticPresentationForms", xmlUCSIsAlphabeticPresentationForms}, {"Arabic", xmlUCSIsArabic}, @@ -945,7 +945,7 @@ static xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, 36}; static xmlIntFunc *xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname) { int low, high, mid, cmp; - xmlUnicodeRange *sptr; + const xmlUnicodeRange *sptr; if ((tptr == NULL) || (tname == NULL)) return(NULL);