diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-08-10 11:51:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-10 16:21:59 +0200 |
commit | 276f7ee4ad66fdd9cdf493f25966496b2acc10a7 (patch) | |
tree | e20d8e6fd1b4a182bdb9aa29aaafcc4ce959c813 /src/corelib/tools | |
parent | 478c21239a97b521e1f515ddbb0b73b0b493a738 (diff) |
Use Q_LIKELY instead of doing an #ifdef for GCC
This code predated the Q_LIKELY macro. Now that we have it, use the
official macro.
Change-Id: I0e43609f8d6827f8fef7b928655a965cba579b8d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qelapsedtimer_unix.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp index f2e43c282b..b4e72b066d 100644 --- a/src/corelib/tools/qelapsedtimer_unix.cpp +++ b/src/corelib/tools/qelapsedtimer_unix.cpp @@ -62,18 +62,13 @@ static int monotonicClockChecked = false; static int monotonicClockAvailable = false; #endif -#ifdef Q_CC_GNU -# define is_likely(x) __builtin_expect((x), 1) -#else -# define is_likely(x) (x) -#endif #define load_acquire(x) ((volatile const int&)(x)) #define store_release(x,v) ((volatile int&)(x) = (v)) static void unixCheckClockType() { #if (_POSIX_MONOTONIC_CLOCK-0 == 0) - if (is_likely(load_acquire(monotonicClockChecked))) + if (Q_LIKELY(load_acquire(monotonicClockChecked))) return; # if defined(_SC_MONOTONIC_CLOCK) @@ -118,7 +113,7 @@ static inline void do_gettime(qint64 *sec, qint64 *frac) { #if (_POSIX_MONOTONIC_CLOCK-0 >= 0) unixCheckClockType(); - if (is_likely(monotonicClockAvailable)) { + if (Q_LIKELY(monotonicClockAvailable)) { timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); *sec = ts.tv_sec; |