From 6aeff1b5429ca97af052a7a172369585382096e8 Mon Sep 17 00:00:00 2001 From: Matthew Vogt Date: Thu, 9 Aug 2012 13:26:32 +1000 Subject: Reduce memory consumption of source coordinates Reduce memory consumption by storing source location coordinates as 16-bit variables (in run-time structures). Also modify qmlmin to restrict line lengths so that the column bound is not normally exceeded. Change-Id: I08605626ffbdf081b6da2aea1116bdfe24998572 Reviewed-by: Yann Bodson --- src/qml/qml/qqmlglobal_p.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/qml/qml/qqmlglobal_p.h') diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index ff337634ee..e79a91f035 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -165,6 +165,16 @@ T qmlobject_cast(QObject *object) return 0; } +inline quint16 qmlSourceCoordinate(int n) +{ + return (n > 0 && n <= USHRT_MAX) ? static_cast(n) : 0; +} + +inline int qmlSourceCoordinate(quint16 n) +{ + return (n == 0) ? -1 : static_cast(n); +} + #define IS_SIGNAL_CONNECTED(Sender, SenderType, Name, Arguments) \ do { \ QObject *sender = (Sender); \ -- cgit v1.2.3