QApplication::QApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE colormap)
: QCoreApplication(*new QApplicationPrivate(aargc, aargv, QApplication::Gui))
{
- if (! dpy)
+ if (Q_UNLIKELY(!dpy))
qWarning("QApplication: Invalid Display* argument");
Q_D(QApplication);
d->construct(dpy, visual, colormap);
Qt::HANDLE visual, Qt::HANDLE colormap)
: QCoreApplication(*new QApplicationPrivate(argc, argv, QApplication::Gui))
{
- if (! dpy)
+ if (Q_UNLIKELY(!dpy))
qWarning("QApplication: Invalid Display* argument");
Q_D(QApplication);
d->construct(dpy, visual, colormap);;
void QApplication::setGraphicsSystem(const QString &system)
{
- if (system == QLatin1String("native")) {
+ if (Q_UNLIKELY(system == QLatin1String("native"))) {
qWarning() << "Attempt to set native graphicssystem";
QApplicationPrivate::graphics_system_name = QLatin1String("raster");
} else {
QClipboard *QApplication::clipboard()
{
if (qt_clipboard == 0) {
- if (!qApp) {
+ if (Q_UNLIKELY(!qApp)) {
qWarning("QApplication: Must construct a QApplication before accessing a QClipboard");
return 0;
}
if (QApplicationPrivate::is_app_closing)
return true;
- if (receiver == 0) { // serious error
+ if (Q_UNLIKELY(receiver == 0)) { // serious error
qWarning("QApplication::notify: Unexpected null receiver");
return true;
}
QObject *obj = d->eventFilters.at(i);
if (!obj)
continue;
- if (obj->d_func()->threadData != w->d_func()->threadData) {
+ if (Q_UNLIKELY(obj->d_func()->threadData != w->d_func()->threadData)) {
qWarning("QApplication: Object event filter cannot be in a different thread.");
continue;
}
printf("QPainterPath::moveTo() (%.2f,%.2f)\n", p.x(), p.y());
#endif
- if (!qIsFinite(p.x()) || !qIsFinite(p.y())) {
+ if (Q_UNLIKELY(!qIsFinite(p.x()) || !qIsFinite(p.y()))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::moveTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
printf("QPainterPath::lineTo() (%.2f,%.2f)\n", p.x(), p.y());
#endif
- if (!qIsFinite(p.x()) || !qIsFinite(p.y())) {
+ if (Q_UNLIKELY(!qIsFinite(p.x()) || !qIsFinite(p.y()))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::lineTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y());
#endif
- if (!qIsFinite(c1.x()) || !qIsFinite(c1.y()) || !qIsFinite(c2.x()) || !qIsFinite(c2.y())
- || !qIsFinite(e.x()) || !qIsFinite(e.y())) {
+ if (Q_UNLIKELY(!qIsFinite(c1.x()) || !qIsFinite(c1.y()) || !qIsFinite(c2.x()) || !qIsFinite(c2.y())
+ || !qIsFinite(e.x()) || !qIsFinite(e.y()))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::cubicTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
c.x(), c.y(), e.x(), e.y());
#endif
- if (!qIsFinite(c.x()) || !qIsFinite(c.y()) || !qIsFinite(e.x()) || !qIsFinite(e.y())) {
+ if (Q_UNLIKELY(!qIsFinite(c.x()) || !qIsFinite(c.y()) || !qIsFinite(e.x()) || !qIsFinite(e.y()))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::quadTo: Adding point where x or y is NaN or Inf, ignoring call");
#endif
rect.x(), rect.y(), rect.width(), rect.height(), startAngle, sweepLength);
#endif
- if ((!qIsFinite(rect.x()) && !qIsFinite(rect.y())) || !qIsFinite(rect.width()) || !qIsFinite(rect.height())
- || !qIsFinite(startAngle) || !qIsFinite(sweepLength)) {
+ if (Q_UNLIKELY((!qIsFinite(rect.x()) && !qIsFinite(rect.y())) || !qIsFinite(rect.width()) || !qIsFinite(rect.height())
+ || !qIsFinite(startAngle) || !qIsFinite(sweepLength))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::arcTo: Adding arc where a parameter is NaN or Inf, ignoring call");
#endif
*/
void QPainterPath::addRect(const QRectF &r)
{
- if (!qIsFinite(r.x()) || !qIsFinite(r.y()) || !qIsFinite(r.width()) || !qIsFinite(r.height())) {
+ if (Q_UNLIKELY(!qIsFinite(r.x()) || !qIsFinite(r.y()) || !qIsFinite(r.width()) || !qIsFinite(r.height()))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::addRect: Adding rect where a parameter is NaN or Inf, ignoring call");
#endif
*/
void QPainterPath::addEllipse(const QRectF &boundingRect)
{
- if (!qIsFinite(boundingRect.x()) || !qIsFinite(boundingRect.y())
- || !qIsFinite(boundingRect.width()) || !qIsFinite(boundingRect.height())) {
+ if (Q_UNLIKELY(!qIsFinite(boundingRect.x()) || !qIsFinite(boundingRect.y())
+ || !qIsFinite(boundingRect.width()) || !qIsFinite(boundingRect.height()))) {
#ifndef QT_NO_DEBUG
qWarning("QPainterPath::addEllipse: Adding ellipse where a parameter is NaN or Inf, ignoring call");
#endif
s >> x;
s >> y;
Q_ASSERT(type >= 0 && type <= 3);
- if (!qIsFinite(x) || !qIsFinite(y)) {
+ if (Q_UNLIKELY(!qIsFinite(x) || !qIsFinite(y))) {
#ifndef QT_NO_DEBUG
qWarning("QDataStream::operator>>: NaN or Inf element found in path, skipping it");
#endif
*/
QPointF QPainterPath::pointAtPercent(qreal t) const
{
- if (t < 0 || t > 1) {
+ if (Q_UNLIKELY(t < 0 || t > 1)) {
qWarning("QPainterPath::pointAtPercent accepts only values between 0 and 1");
return QPointF();
}
*/
qreal QPainterPath::angleAtPercent(qreal t) const
{
- if (t < 0 || t > 1) {
+ if (Q_UNLIKELY(t < 0 || t > 1)) {
qWarning("QPainterPath::angleAtPercent accepts only values between 0 and 1");
return 0;
}
*/
qreal QPainterPath::slopeAtPercent(qreal t) const
{
- if (t < 0 || t > 1) {
+ if (Q_UNLIKELY(t < 0 || t > 1)) {
qWarning("QPainterPath::slopeAtPercent accepts only values between 0 and 1");
return 0;
}