[libxml2] Add const in five places to move 1 KiB to .rdata
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Add const in five places to move 1 KiB to .rdata
- Date: Mon, 28 Aug 2017 20:43:08 +0000 (UTC)
commit 8f57103793e1e1b1be478f1feb607d19d725d048
Author: Bruce Dawson <brucedawson chromium org>
Date: Mon Aug 28 21:27:03 2017 +0200
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 56e4e9b..4487eeb 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 ce6e9a4..6d0a96a 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]