diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-08-19 12:59:09 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-08-22 06:33:14 +0000 |
commit | 881bda9e6ecdd8729edf7df68f94f72f5d7c9042 (patch) | |
tree | 727eea620e6893277fe592a75dbede2aae222eae /src | |
parent | 661b10649a56ca5c5b88164de85de29d45d8dda9 (diff) |
QTextHtmlParser: remove 317 unneeded relocations
Same change as in QColor (d38f86e50b01c6dd60f5a97355031e08d6a47d18).
relocs: -317
text: -6480B
data: -5088B
(optimized GCC 6.1 Linux AMD64 build)
Change-Id: I647cd327b421caad45a19a14955de9e3aefaefab
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 3 | ||||
-rw-r--r-- | src/gui/text/qtexthtmlparser_p.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 77da01be3f..9c758bee60 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE // see also tst_qtextdocumentfragment.cpp #define MAX_ENTITY 258 -static const struct QTextHtmlEntity { const char *name; quint16 code; } entities[MAX_ENTITY]= { +static const struct QTextHtmlEntity { const char name[9]; quint16 code; } entities[]= { { "AElig", 0x00c6 }, { "AMP", 38 }, { "Aacute", 0x00c1 }, @@ -314,6 +314,7 @@ static const struct QTextHtmlEntity { const char *name; quint16 code; } entities { "zwj", 0x200d }, { "zwnj", 0x200c } }; +Q_STATIC_ASSERT(MAX_ENTITY == sizeof entities / sizeof *entities); #if defined(Q_CC_MSVC) && _MSC_VER < 1600 bool operator<(const QTextHtmlEntity &entity1, const QTextHtmlEntity &entity2) diff --git a/src/gui/text/qtexthtmlparser_p.h b/src/gui/text/qtexthtmlparser_p.h index 460e32d5bb..85769c3779 100644 --- a/src/gui/text/qtexthtmlparser_p.h +++ b/src/gui/text/qtexthtmlparser_p.h @@ -138,7 +138,7 @@ enum QTextHTMLElements { struct QTextHtmlElement { - const char *name; + const char name[11]; QTextHTMLElements id; enum DisplayMode { DisplayBlock, DisplayInline, DisplayTable, DisplayNone } displayMode; }; |