Fix most warnings about assignments of QAtomicInt.
Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
parent
5761d8546f
commit
e277575987
@ -400,7 +400,7 @@ void QFutureWatcherBase::disconnectOutputInterface(bool pendingAssignment)
|
||||
{
|
||||
if (pendingAssignment) {
|
||||
Q_D(QFutureWatcherBase);
|
||||
d->pendingResultsReady = 0;
|
||||
d->pendingResultsReady.store(0);
|
||||
qDeleteAll(d->pendingCallOutEvents);
|
||||
d->pendingCallOutEvents.clear();
|
||||
d->finished = false;
|
||||
@ -439,7 +439,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
|
||||
emit q->finished();
|
||||
break;
|
||||
case QFutureCallOutEvent::Canceled:
|
||||
pendingResultsReady = 0;
|
||||
pendingResultsReady.store(0);
|
||||
emit q->canceled();
|
||||
break;
|
||||
case QFutureCallOutEvent::Paused:
|
||||
|
@ -3407,23 +3407,15 @@ static QString qt_ACE_do(const QString &domain, AceOperation op)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
QUrlPrivate::QUrlPrivate()
|
||||
QUrlPrivate::QUrlPrivate() : ref(1), port(-1), parsingMode(QUrl::TolerantMode),
|
||||
hasQuery(false), hasFragment(false), isValid(false), isHostValid(true),
|
||||
valueDelimiter('='), pairDelimiter('&'),
|
||||
stateFlags(0)
|
||||
{
|
||||
ref = 1;
|
||||
port = -1;
|
||||
isValid = false;
|
||||
isHostValid = true;
|
||||
parsingMode = QUrl::TolerantMode;
|
||||
valueDelimiter = '=';
|
||||
pairDelimiter = '&';
|
||||
stateFlags = 0;
|
||||
hasFragment = false;
|
||||
hasQuery = false;
|
||||
}
|
||||
|
||||
QUrlPrivate::QUrlPrivate(const QUrlPrivate ©)
|
||||
: scheme(copy.scheme),
|
||||
: ref(1), scheme(copy.scheme),
|
||||
userName(copy.userName),
|
||||
password(copy.password),
|
||||
host(copy.host),
|
||||
@ -3445,7 +3437,8 @@ QUrlPrivate::QUrlPrivate(const QUrlPrivate ©)
|
||||
pairDelimiter(copy.pairDelimiter),
|
||||
stateFlags(copy.stateFlags),
|
||||
encodedNormalized(copy.encodedNormalized)
|
||||
{ ref = 1; }
|
||||
{
|
||||
}
|
||||
|
||||
QString QUrlPrivate::canonicalHost() const
|
||||
{
|
||||
|
@ -264,7 +264,7 @@ static gboolean postEventSourcePrepare(GSource *s, gint *timeout)
|
||||
|
||||
GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
|
||||
return (!data->canWait
|
||||
|| (source->serialNumber != source->lastSerialNumber));
|
||||
|| (source->serialNumber.load() != source->lastSerialNumber));
|
||||
}
|
||||
|
||||
static gboolean postEventSourceCheck(GSource *source)
|
||||
@ -275,7 +275,7 @@ static gboolean postEventSourceCheck(GSource *source)
|
||||
static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer)
|
||||
{
|
||||
GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
|
||||
source->lastSerialNumber = source->serialNumber;
|
||||
source->lastSerialNumber = source->serialNumber.load();
|
||||
QCoreApplication::sendPostedEvents();
|
||||
source->d->runTimersOnceWithNormalPriority();
|
||||
return true; // i dunno, george...
|
||||
@ -320,7 +320,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
|
||||
// setup post event source
|
||||
postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs,
|
||||
sizeof(GPostEventSource)));
|
||||
postEventSource->serialNumber = 1;
|
||||
postEventSource->serialNumber.store(1);
|
||||
postEventSource->d = this;
|
||||
g_source_set_can_recurse(&postEventSource->source, true);
|
||||
g_source_attach(&postEventSource->source, mainContext);
|
||||
|
@ -3011,7 +3011,7 @@ bool QMetaObjectPrivate::connect(const QObject *sender, int signal_index,
|
||||
c->method_relative = method_index;
|
||||
c->method_offset = method_offset;
|
||||
c->connectionType = type;
|
||||
c->argumentTypes = types;
|
||||
c->argumentTypes.store(types);
|
||||
c->nextConnectionList = 0;
|
||||
c->callFunction = callFunction;
|
||||
|
||||
|
@ -113,7 +113,7 @@ bool QDBusArgumentPrivate::checkWrite(QDBusArgumentPrivate *&d)
|
||||
if (!d->marshaller()->ok)
|
||||
return false;
|
||||
|
||||
if (d->message && d->ref != 1) {
|
||||
if (d->message && d->ref.load() != 1) {
|
||||
QDBusMarshaller *dd = new QDBusMarshaller(d->capabilities);
|
||||
dd->message = q_dbus_message_copy(d->message);
|
||||
q_dbus_message_iter_init_append(dd->message, &dd->iterator);
|
||||
@ -154,7 +154,7 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d)
|
||||
if (!checkRead(d))
|
||||
return false; // don't bother
|
||||
|
||||
if (d->ref == 1)
|
||||
if (d->ref.load() == 1)
|
||||
return true; // no need to detach
|
||||
|
||||
QDBusDemarshaller *dd = new QDBusDemarshaller(d->capabilities);
|
||||
|
@ -557,7 +557,7 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
|
||||
(*(*list)[i])(amsg);
|
||||
}
|
||||
|
||||
if (!ref)
|
||||
if (!ref.load())
|
||||
return false;
|
||||
|
||||
switch (amsg.type()) {
|
||||
@ -1981,7 +1981,7 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
|
||||
|
||||
checkThread();
|
||||
QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
|
||||
pcall->ref = 0;
|
||||
pcall->ref.store(0);
|
||||
|
||||
QDBusError error;
|
||||
DBusMessage *msg = QDBusMessagePrivate::toDBusMessage(message, capabilities, &error);
|
||||
|
@ -194,7 +194,7 @@ QDBusUnixFileDescriptor::~QDBusUnixFileDescriptor()
|
||||
*/
|
||||
bool QDBusUnixFileDescriptor::isValid() const
|
||||
{
|
||||
return d ? d->fd != -1 : false;
|
||||
return d ? d->fd.load() != -1 : false;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -212,7 +212,7 @@ bool QDBusUnixFileDescriptor::isValid() const
|
||||
*/
|
||||
int QDBusUnixFileDescriptor::fileDescriptor() const
|
||||
{
|
||||
return d ? d->fd.operator int() : -1;
|
||||
return d ? d->fd.load() : -1;
|
||||
}
|
||||
|
||||
// actual implementation
|
||||
@ -269,11 +269,12 @@ void QDBusUnixFileDescriptor::giveFileDescriptor(int fileDescriptor)
|
||||
else
|
||||
d = new QDBusUnixFileDescriptorPrivate;
|
||||
|
||||
if (d->fd != -1)
|
||||
qt_safe_close(d->fd);
|
||||
const int fdl = d->fd.load();
|
||||
if (fdl != -1)
|
||||
qt_safe_close(fdl);
|
||||
|
||||
if (fileDescriptor != -1)
|
||||
d->fd = fileDescriptor;
|
||||
d->fd.store(fileDescriptor);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -294,8 +295,9 @@ int QDBusUnixFileDescriptor::takeFileDescriptor()
|
||||
|
||||
QDBusUnixFileDescriptorPrivate::~QDBusUnixFileDescriptorPrivate()
|
||||
{
|
||||
if (fd != -1)
|
||||
qt_safe_close(fd);
|
||||
const int fdl = fd.load();
|
||||
if (fdl != -1)
|
||||
qt_safe_close(fdl);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -58,9 +58,8 @@ static int nextCursorId = Qt::BitmapCursor;
|
||||
*****************************************************************************/
|
||||
|
||||
QCursorData::QCursorData(Qt::CursorShape s)
|
||||
: cshape(s), bm(0), bmm(0), hx(0), hy(0), id(s)
|
||||
: ref(1), cshape(s), bm(0), bmm(0), hx(0), hy(0), id(s)
|
||||
{
|
||||
ref = 1;
|
||||
}
|
||||
|
||||
QCursorData::~QCursorData()
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
inline QTouchEventTouchPointPrivate *detach()
|
||||
{
|
||||
QTouchEventTouchPointPrivate *d = new QTouchEventTouchPointPrivate(*this);
|
||||
d->ref = 1;
|
||||
d->ref.store(1);
|
||||
if (!this->ref.deref())
|
||||
delete this;
|
||||
return d;
|
||||
|
@ -69,14 +69,12 @@ struct Q_AUTOTEST_EXPORT QKeyBinding
|
||||
class Q_AUTOTEST_EXPORT QKeySequencePrivate
|
||||
{
|
||||
public:
|
||||
inline QKeySequencePrivate()
|
||||
inline QKeySequencePrivate() : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
key[0] = key[1] = key[2] = key[3] = 0;
|
||||
}
|
||||
inline QKeySequencePrivate(const QKeySequencePrivate ©)
|
||||
inline QKeySequencePrivate(const QKeySequencePrivate ©) : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
key[0] = copy.key[0];
|
||||
key[1] = copy.key[1];
|
||||
key[2] = copy.key[2];
|
||||
|
@ -249,6 +249,9 @@ public:
|
||||
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &);
|
||||
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &);
|
||||
#endif
|
||||
|
||||
QPainterPathPrivate() : ref(1) {}
|
||||
|
||||
private:
|
||||
QAtomicInt ref;
|
||||
QVector<QPainterPath::Element> elements;
|
||||
|
@ -148,13 +148,12 @@ public:
|
||||
dirtyControlBounds(false),
|
||||
pathConverter(0)
|
||||
{
|
||||
ref = 1;
|
||||
require_moveTo = false;
|
||||
convex = false;
|
||||
}
|
||||
|
||||
QPainterPathData(const QPainterPathData &other) :
|
||||
QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule),
|
||||
cStart(other.cStart), fillRule(other.fillRule),
|
||||
bounds(other.bounds),
|
||||
controlBounds(other.controlBounds),
|
||||
dirtyBounds(other.dirtyBounds),
|
||||
@ -162,7 +161,6 @@ public:
|
||||
convex(other.convex),
|
||||
pathConverter(0)
|
||||
{
|
||||
ref = 1;
|
||||
require_moveTo = false;
|
||||
elements = other.elements;
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ void QPen::detach()
|
||||
QPenData *x = new QPenData(*static_cast<QPenData *>(d));
|
||||
if (!d->ref.deref())
|
||||
delete d;
|
||||
x->ref = 1;
|
||||
x->ref.store(1);
|
||||
d = x;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id,
|
||||
|
||||
newFreetype->hbFace = qHBNewFace(face, hb_getSFntTable);
|
||||
Q_CHECK_PTR(newFreetype->hbFace);
|
||||
newFreetype->ref = 1;
|
||||
newFreetype->ref.store(1);
|
||||
newFreetype->xsize = 0;
|
||||
newFreetype->ysize = 0;
|
||||
newFreetype->matrix.xx = 0x10000;
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
OpenGLUserData
|
||||
};
|
||||
|
||||
QStaticTextUserData(Type t) : type(t) { ref = 0; }
|
||||
QStaticTextUserData(Type t) : ref(0), type(t) {}
|
||||
virtual ~QStaticTextUserData() {}
|
||||
|
||||
QAtomicInt ref;
|
||||
|
@ -264,7 +264,7 @@ void QAuthenticator::detach()
|
||||
{
|
||||
if (!d) {
|
||||
d = new QAuthenticatorPrivate;
|
||||
d->ref = 1;
|
||||
d->ref.store(1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -870,7 +870,7 @@ QSslConfiguration QSslSocket::sslConfiguration() const
|
||||
|
||||
// create a deep copy of our configuration
|
||||
QSslConfigurationPrivate *copy = new QSslConfigurationPrivate(d->configuration);
|
||||
copy->ref = 0; // the QSslConfiguration constructor refs up
|
||||
copy->ref.store(0); // the QSslConfiguration constructor refs up
|
||||
copy->sessionCipher = d->sessionCipher();
|
||||
|
||||
return QSslConfiguration(copy);
|
||||
@ -2039,7 +2039,7 @@ void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPri
|
||||
return;
|
||||
}
|
||||
|
||||
ptr->ref = 1;
|
||||
ptr->ref.store(1);
|
||||
ptr->peerCertificate = global->peerCertificate;
|
||||
ptr->peerCertificateChain = global->peerCertificateChain;
|
||||
ptr->localCertificate = global->localCertificate;
|
||||
|
@ -133,11 +133,11 @@ class QSqlDatabasePrivate
|
||||
{
|
||||
public:
|
||||
QSqlDatabasePrivate(QSqlDatabase *d, QSqlDriver *dr = 0):
|
||||
ref(1),
|
||||
q(d),
|
||||
driver(dr),
|
||||
port(-1)
|
||||
{
|
||||
ref = 1;
|
||||
if(driver)
|
||||
precisionPolicy = driver->numericalPrecisionPolicy();
|
||||
else
|
||||
@ -171,9 +171,8 @@ public:
|
||||
static void cleanConnections();
|
||||
};
|
||||
|
||||
QSqlDatabasePrivate::QSqlDatabasePrivate(const QSqlDatabasePrivate &other)
|
||||
QSqlDatabasePrivate::QSqlDatabasePrivate(const QSqlDatabasePrivate &other) : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
q = other.q;
|
||||
dbname = other.dbname;
|
||||
uname = other.uname;
|
||||
|
@ -63,14 +63,12 @@ public:
|
||||
QAtomicInt ref;
|
||||
};
|
||||
|
||||
QSqlRecordPrivate::QSqlRecordPrivate()
|
||||
QSqlRecordPrivate::QSqlRecordPrivate() : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
}
|
||||
|
||||
QSqlRecordPrivate::QSqlRecordPrivate(const QSqlRecordPrivate &other): fields(other.fields)
|
||||
QSqlRecordPrivate::QSqlRecordPrivate(const QSqlRecordPrivate &other): fields(other.fields), ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
|
@ -1153,18 +1153,17 @@ void QDomImplementation::setInvalidDataPolicy(InvalidDataPolicy policy)
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl)
|
||||
QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl) : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
node_impl = n_impl;
|
||||
if (node_impl)
|
||||
node_impl->ref.ref();
|
||||
timestamp = 0;
|
||||
}
|
||||
|
||||
QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString &name)
|
||||
QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString &name) :
|
||||
ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
node_impl = n_impl;
|
||||
if (node_impl)
|
||||
node_impl->ref.ref();
|
||||
@ -1172,9 +1171,9 @@ QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString
|
||||
timestamp = 0;
|
||||
}
|
||||
|
||||
QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString &_nsURI, const QString &localName)
|
||||
QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString &_nsURI, const QString &localName) :
|
||||
ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
node_impl = n_impl;
|
||||
if (node_impl)
|
||||
node_impl->ref.ref();
|
||||
@ -1449,9 +1448,8 @@ inline void QDomNodePrivate::setOwnerDocument(QDomDocumentPrivate *doc)
|
||||
hasParent = false;
|
||||
}
|
||||
|
||||
QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par)
|
||||
QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par) : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
if (par)
|
||||
setParent(par);
|
||||
else
|
||||
@ -1465,9 +1463,8 @@ QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par)
|
||||
columnNumber = -1;
|
||||
}
|
||||
|
||||
QDomNodePrivate::QDomNodePrivate(QDomNodePrivate *n, bool deep)
|
||||
QDomNodePrivate::QDomNodePrivate(QDomNodePrivate *n, bool deep) : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
setOwnerDocument(n->ownerDocument());
|
||||
prev = 0;
|
||||
next = 0;
|
||||
@ -3052,9 +3049,8 @@ int QDomNode::columnNumber() const
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
QDomNamedNodeMapPrivate::QDomNamedNodeMapPrivate(QDomNodePrivate* n)
|
||||
QDomNamedNodeMapPrivate::QDomNamedNodeMapPrivate(QDomNodePrivate* n) : ref(1)
|
||||
{
|
||||
ref = 1;
|
||||
readonly = false;
|
||||
parent = n;
|
||||
appendToParent = false;
|
||||
|
Loading…
Reference in New Issue
Block a user