From 78e16f5d46ce77fc871de0323de4cceb0e4a3bee Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 3 Oct 2011 11:40:13 +0200 Subject: Use QBasicAtomic*::load() and store() instead of implicit casting These casts will be unavailable in the near future Change-Id: I683ae7bf72741f79902945083bf9602ff3655b15 Reviewed-on: http://codereview.qt-project.org/6232 Sanity-Review: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/3rdparty/phonon/phonon/globalstatic_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/phonon/phonon/globalstatic_p.h b/src/3rdparty/phonon/phonon/globalstatic_p.h index cf80512..d615910 100644 --- a/src/3rdparty/phonon/phonon/globalstatic_p.h +++ b/src/3rdparty/phonon/phonon/globalstatic_p.h @@ -260,7 +260,7 @@ static struct PHONON_GLOBAL_STATIC_STRUCT_NAME(NAME) } \ inline TYPE *operator->() \ { \ - TYPE *p = _k_static_##NAME; \ + TYPE *p = _k_static_##NAME.load(); \ if (!p) { \ if (isDestroyed()) { \ qFatal("Fatal Error: Accessed global static '%s *%s()' after destruction. " \ @@ -269,7 +269,7 @@ static struct PHONON_GLOBAL_STATIC_STRUCT_NAME(NAME) p = new TYPE ARGS; \ if (!_k_static_##NAME.testAndSetOrdered(0, p)) { \ delete p; \ - p = _k_static_##NAME; \ + p = _k_static_##NAME.load(); \ } else { \ static Phonon::CleanUpGlobalStatic cleanUpObject = { destroy }; \ } \ @@ -283,8 +283,8 @@ static struct PHONON_GLOBAL_STATIC_STRUCT_NAME(NAME) static void destroy() \ { \ _k_static_##NAME##_destroyed = true; \ - TYPE *x = _k_static_##NAME; \ - _k_static_##NAME = 0; \ + TYPE *x = _k_static_##NAME.load(); \ + _k_static_##NAME.store(0); \ delete x; \ } \ } NAME; -- cgit v1.2.3