mark constants in qt_debug_path() and QPainterPath debug operator as static

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-07-13 17:16:55 +03:00
parent 729bad61c8
commit 0cfd2e900c

View file

@ -114,7 +114,7 @@ void qt_find_ellipse_coords(const QRectF &r, qreal angle, qreal length,
#ifdef QPP_DEBUG #ifdef QPP_DEBUG
static void qt_debug_path(const QPainterPath &path) static void qt_debug_path(const QPainterPath &path)
{ {
const char *names[] = { static const char *names[] = {
"MoveTo ", "MoveTo ",
"LineTo ", "LineTo ",
"CurveTo ", "CurveTo ",
@ -3356,7 +3356,12 @@ void QPainterPath::computeControlPointRect() const
QDebug operator<<(QDebug s, const QPainterPath &p) QDebug operator<<(QDebug s, const QPainterPath &p)
{ {
s.nospace() << "QPainterPath: Element count=" << p.elementCount() << endl; s.nospace() << "QPainterPath: Element count=" << p.elementCount() << endl;
const char *types[] = {"MoveTo", "LineTo", "CurveTo", "CurveToData"}; static const char *types[] = {
"MoveTo",
"LineTo",
"CurveTo",
"CurveToData"
};
for (int i=0; i<p.elementCount(); ++i) { for (int i=0; i<p.elementCount(); ++i) {
s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl; s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl;