diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-09-29 11:50:08 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-27 18:57:38 +0200 |
commit | 6476ac738ca029af95932f53b53f0705808eb80e (patch) | |
tree | d1884397040eb65d23a48a0e1a56dad3f476cf34 /src/gui/image | |
parent | 434824aede28e8c36d6991aa218f89daf2cc22fa (diff) |
Replace implicit QAtomic* casts with explicit load()/store()
Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage.cpp | 8 | ||||
-rw-r--r-- | src/gui/image/qpicture.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 10 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index c74b715f8d..a19b608216 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1075,10 +1075,10 @@ QImage::operator QVariant() const void QImage::detach() { if (d) { - if (d->is_cached && d->ref == 1) + if (d->is_cached && d->ref.load() == 1) QImagePixmapCleanupHooks::executeImageHooks(cacheKey()); - if (d->ref != 1 || d->ro_data) + if (d->ref.load() != 1 || d->ro_data) *this = copy(); if (d) @@ -5289,7 +5289,7 @@ qint64 QImage::cacheKey() const bool QImage::isDetached() const { - return d && d->ref == 1; + return d && d->ref.load() == 1; } @@ -5849,7 +5849,7 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla return true; // No in-place conversion if we have to detach - if (ref > 1) + if (ref.load() > 1) return false; const InPlace_Image_Converter *const converterPtr = &inplace_converter_map[format][newFormat]; diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 5d79f3fe22..dfc84c56d8 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -226,7 +226,7 @@ void QPicture::detach() bool QPicture::isDetached() const { - return d_func()->ref == 1; + return d_func()->ref.load() == 1; } /*! diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index c025aa9283..2a2bd5d6fa 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -272,7 +272,7 @@ QPixmap::QPixmap(const char * const xpm[]) QPixmap::~QPixmap() { - Q_ASSERT(!data || data->ref >= 1); // Catch if ref-counting changes again + Q_ASSERT(!data || data->ref.load() >= 1); // Catch if ref-counting changes again } /*! @@ -871,7 +871,7 @@ void QPixmap::fill(const QColor &color) return; } - if (data->ref == 1) { + if (data->ref.load() == 1) { // detach() will also remove this pixmap from caches, so // it has to be called even when ref == 1. detach(); @@ -1000,7 +1000,7 @@ QDataStream &operator>>(QDataStream &stream, QPixmap &pixmap) bool QPixmap::isDetached() const { - return data && data->ref == 1; + return data && data->ref.load() == 1; } /*! \internal @@ -1529,10 +1529,10 @@ void QPixmap::detach() rasterData->image.detach(); } - if (data->is_cached && data->ref == 1) + if (data->is_cached && data->ref.load() == 1) QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(data.data()); - if (data->ref != 1) { + if (data->ref.load() != 1) { *this = copy(); } ++data->detach_no; |