various cleanups

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2016-11-12 19:58:01 +00:00
parent 591203c750
commit db644d1018
4 changed files with 14 additions and 17 deletions

View file

@ -770,8 +770,7 @@ QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *context)
return rv;
}
QObject *
QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context)
QObject * QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context)
{
Q_Q(QDeclarativeComponent);
if (!context) {

View file

@ -70,7 +70,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject
public:
QDeclarativeComponent(QObject *parent = Q_NULLPTR);
QDeclarativeComponent(QDeclarativeEngine *, QObject *parent=0);
QDeclarativeComponent(QDeclarativeEngine *, QObject *parent = Q_NULLPTR);
QDeclarativeComponent(QDeclarativeEngine *, const QString &fileName, QObject *parent = Q_NULLPTR);
QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = Q_NULLPTR);
virtual ~QDeclarativeComponent();

View file

@ -44,7 +44,7 @@
#include "qapplication.h"
#include "qdebug.h"
#include "qdesktopwidget.h"
#include "qvarlengtharray.h"
#include "qvector.h"
#include "qx11info_x11.h"
#include <qt_x11_p.h>
@ -58,7 +58,7 @@ public:
QColormapPrivate()
: ref(1), mode(QColormap::Direct), depth(0),
colormap(0), defaultColormap(true),
visual(0), defaultVisual(true),
visual(Q_NULLPTR), defaultVisual(true),
r_max(0), g_max(0), b_max(0),
r_shift(0), g_shift(0), b_shift(0)
{}
@ -301,14 +301,12 @@ static void init_indexed(QColormapPrivate *d, int screen)
query_colormap(d, screen);
}
static void init_direct(QColormapPrivate *d, bool ownColormap)
static void init_direct(QColormapPrivate *d)
{
if (d->visual->c_class != DirectColor || !ownColormap)
if (d->visual->c_class != DirectColor)
return;
// preallocate 768 on the stack, so that we don't have to malloc
// for the common case (<= 24 bpp)
QVarLengthArray<XColor, 768> colorTable(d->r_max + d->g_max + d->b_max);
QVector<XColor> colorTable(d->r_max + d->g_max + d->b_max);
int i = 0;
for (int r = 0; r < d->r_max; ++r) {
@ -335,7 +333,7 @@ static void init_direct(QColormapPrivate *d, bool ownColormap)
XStoreColors(X11->display, d->colormap, colorTable.data(), colorTable.count());
}
static QColormap **cmaps = 0;
static QColormap **cmaps = Q_NULLPTR;
void QColormap::initialize()
{
@ -358,7 +356,7 @@ void QColormap::initialize()
d->visual = DefaultVisual(display, i);
d->defaultVisual = true;
Visual *argbVisual = 0;
Visual *argbVisual = Q_NULLPTR;
if (X11->visual && i == DefaultScreen(display)) {
// only use the outside colormap on the default screen
@ -371,7 +369,7 @@ void QColormap::initialize()
d->visual = find_visual(display, i, X11->visual_class, X11->visual_id,
&d->depth, &d->defaultVisual);
} else if (!X11->custom_cmap) {
XStandardColormap *stdcmap = 0;
XStandardColormap *stdcmap = Q_NULLPTR;
int ncmaps = 0;
#ifndef QT_NO_XRENDER
@ -541,7 +539,8 @@ void QColormap::initialize()
init_indexed(d, i);
break;
case Direct:
init_direct(d, ownColormap);
if (ownColormap)
init_direct(d);
break;
}
@ -577,7 +576,7 @@ void QColormap::cleanup()
delete cmaps[i];
delete [] cmaps;
cmaps = 0;
cmaps = Q_NULLPTR;
}

View file

@ -43,14 +43,13 @@
#define QDRAWUTIL_H
#include <QtCore/qnamespace.h>
#include <QtCore/qstring.h> // char*->QString conversion
#include <QtCore/qmargins.h>
#include <QtGui/qpixmap.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QPainter;
class QPalette;
class QPoint;