summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-10-31 10:36:57 +0100
committerQt by Nokia <qt-info@nokia.com>2011-10-31 11:29:08 +0100
commite277575987657aa07444eea9bee99769f039d3b0 (patch)
tree549c419596e340c8ad123df44fc75662ed47b2a7 /src/dbus
parent5761d8546f3ff3802cae85ed5224c2bdd9524452 (diff)
Fix most warnings about assignments of QAtomicInt.
Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusargument.cpp4
-rw-r--r--src/dbus/qdbusintegrator.cpp4
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp16
3 files changed, 13 insertions, 11 deletions
diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp
index 251859d9e3..af800d765d 100644
--- a/src/dbus/qdbusargument.cpp
+++ b/src/dbus/qdbusargument.cpp
@@ -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);
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 8bb7487c9e..f6b433e1ba 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -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);
diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp
index 86d2b3c92e..0ee29fc20f 100644
--- a/src/dbus/qdbusunixfiledescriptor.cpp
+++ b/src/dbus/qdbusunixfiledescriptor.cpp
@@ -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