From 881bda9e6ecdd8729edf7df68f94f72f5d7c9042 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 19 Aug 2016 12:59:09 +0200 Subject: 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) --- src/gui/text/qtexthtmlparser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui/text/qtexthtmlparser.cpp') 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) -- cgit v1.2.3