Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qtessellator.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555#define QDEBUG qDebug
    5656#else
    57 #define QDEBUG if (1); else qDebug
     57#define QDEBUG if (1){} else qDebug
    5858#endif
    5959
     
    407407        max_edges = maxActiveEdges;
    408408        int s = qMax(maxActiveEdges + 1, default_alloc + 1);
    409         edges = (Edge **)realloc(edges, s*sizeof(Edge *));
    410         edge_table = (Edge *)realloc(edge_table, s*sizeof(Edge));
    411         old = (Edge **)realloc(old, s*sizeof(Edge *));
     409        edges = q_check_ptr((Edge **)realloc(edges, s*sizeof(Edge *)));
     410        edge_table = q_check_ptr((Edge *)realloc(edge_table, s*sizeof(Edge)));
     411        old = q_check_ptr((Edge **)realloc(old, s*sizeof(Edge *)));
    412412    }
    413413    size = 0;
     
    567567    if (!storage || maxVertices > allocated) {
    568568        int size = qMax((int)default_alloc, maxVertices);
    569         storage = (Vertex *)realloc(storage, size*sizeof(Vertex));
    570         sorted = (Vertex **)realloc(sorted, size*sizeof(Vertex *));
     569        storage = q_check_ptr((Vertex *)realloc(storage, size*sizeof(Vertex)));
     570        sorted = q_check_ptr((Vertex **)realloc(sorted, size*sizeof(Vertex *)));
    571571        allocated = maxVertices;
    572572    }
     
    704704};
    705705
    706 
    707706static void cancelEdges(QCoincidingEdge &e1, QCoincidingEdge &e2)
    708707{
     
    741740            if (testListSize > tlSize - 2) {
    742741                tlSize = qMax(tlSize*2, 16);
    743                 tl = (QCoincidingEdge *)realloc(tl, tlSize*sizeof(QCoincidingEdge));
     742                tl = q_check_ptr((QCoincidingEdge *)realloc(tl, tlSize*sizeof(QCoincidingEdge)));
    744743            }
    745744            if (n->flags & (LineBeforeStarts|LineBeforeHorizontal)) {
     
    10821081    }
    10831082    QDEBUG() << "   between edges " << e1->edge << "and" << e2->edge << "at point ("
    1084              << Q27Dot5ToDouble(yi) << ")";
     1083             << Q27Dot5ToDouble(yi) << ')';
    10851084
    10861085    Intersection i1;
     
    11751174            Edge *e = scanline.edges[i];
    11761175            QDEBUG() << "    " << i << e->edge << "isect=(" << e->intersect_left << e->intersect_right
    1177                      << ")";
     1176                     << ')';
    11781177        }
    11791178#endif
     
    12411240                 << "point=" << d->vertices.position(d->vertices.sorted[i])
    12421241                 << "flags=" << d->vertices.sorted[i]->flags
    1243                  << "pos=(" << Q27Dot5ToDouble(d->vertices.sorted[i]->x) << "/"
    1244                  << Q27Dot5ToDouble(d->vertices.sorted[i]->y) << ")";
     1242                 << "pos=(" << Q27Dot5ToDouble(d->vertices.sorted[i]->x) << '/'
     1243                 << Q27Dot5ToDouble(d->vertices.sorted[i]->y) << ')';
    12451244    }
    12461245#endif
     
    12721271            QDEBUG() << "   " << d->scanline.edges[i]->edge
    12731272                     << "p0= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v0->x)
    1274                      << "/" << Q27Dot5ToDouble(d->scanline.edges[i]->v0->y)
     1273                     << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v0->y)
    12751274                     << ") p1= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v1->x)
    1276                      << "/" << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ")"
     1275                     << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ')'
    12771276                     << "x=" << Q27Dot5ToDouble(d->scanline.edges[i]->positionAt(d->y))
    12781277                     << "isLeftOfNext="
     
    14371436        qreal length = qSqrt(perp.x() * perp.x() + perp.y() * perp.y());
    14381437
    1439         if (qFuzzyCompare(length + 1, static_cast<qreal>(1)))
     1438        if (qFuzzyIsNull(length))
    14401439            return;
    14411440
Note: See TracChangeset for help on using the changeset viewer.