From 0d0812db550834b8935d26cc55f6a155ce6ba65c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 20 Jan 2015 21:21:13 +0100 Subject: QDateTime: avoid relocations The short month names all have length 3, so store them in a multi- dimensional const char array instead of as a pointer table. Effects on Linux GCC 4.9 stripped release builds: text -196B data -64B relocs -12 (est., somehow relinfo.pl reports nonsense on QtCore) Change-Id: If5f83e4f1eb5ba0b0f54b4144abec8b88fb8529f Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qdatetime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 419826055c..32014320ba 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -155,7 +155,7 @@ static void getDateFromJulianDay(qint64 julianDay, int *yearp, int *monthp, int static const char monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; #ifndef QT_NO_TEXTDATE -static const char * const qt_shortMonthNames[] = { +static const char qt_shortMonthNames[][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -- cgit v1.2.3