diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-17 17:48:34 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-03-04 10:29:08 +0000 |
commit | 600529e07a46d8e20f4302dc988125f3fee36ec4 (patch) | |
tree | d1ef58c493d6f9dd2521c63ce1f07e04a7aa5658 /src/gui/text/qfontsubset.cpp | |
parent | b6b3803b213787a04dfc7542caeb541a5535d90f (diff) |
QtGui: use printf-style qWarning/qDebug where possible (I)
The printf-style version of QDebug expands to a lot less code than the
std::ostream-style version. Of course, you pay in type safety (but
compilers warn about it these days), you cannot stream complex Qt
types and streaming QStrings is awkward, but in many cases you
actually improve on readability.
But the main reason is that something that's not supposed to be
executed under normal operation has no business bloating executable
code size.
This is not an attempt at converting all qWarnings() to printf-style,
only the low-hanging fruit.
In this first part, replace
qWarning() << "...";
with
qWarning("...");
In QTransform shared warning strings.
Saves 3KiB in text size on optimized GCC 5.3 AMD64 builds.
Change-Id: I142a8020eaab043d78465178192f2c8c6d1cc4f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qfontsubset.cpp')
-rw-r--r-- | src/gui/text/qfontsubset.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp index a9387e5aa0..f591b4333c 100644 --- a/src/gui/text/qfontsubset.cpp +++ b/src/gui/text/qfontsubset.cpp @@ -798,7 +798,7 @@ static void convertPath(const QPainterPath &path, QVector<TTF_POINT> *points, QV base -= 3; } else { // need to split -// qDebug() << " -> splitting"; +// qDebug(" -> splitting"); qint16 a, b, c, d; base[6].x = base[3].x; c = base[1].x; @@ -859,7 +859,7 @@ static void getBounds(const QVector<TTF_POINT> &points, qint16 *xmin, qint16 *xm static int convertToRelative(QVector<TTF_POINT> *points) { // convert points to relative and setup flags -// qDebug() << "relative points:"; +// qDebug("relative points:"); qint16 prev_x = 0; qint16 prev_y = 0; int point_array_size = 0; @@ -980,7 +980,7 @@ static QTtfGlyph generateGlyph(int index, const QPainterPath &path, qreal advanc // qDebug() << "number of contours=" << endPoints.size(); // for (int i = 0; i < points.size(); ++i) // qDebug() << " point[" << i << "] = " << QPoint(points.at(i).x, points.at(i).y) << " flags=" << points.at(i).flags; -// qDebug() << "endPoints:"; +// qDebug("endPoints:"); // for (int i = 0; i < endPoints.size(); ++i) // qDebug() << endPoints.at(i); |