From 81896304dc1fb65da3302deb54ab4cfe060625ff Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sun, 16 Aug 2020 10:54:27 +0200 Subject: Remove dead code in qrandom After 9ee554ac1d1af97e7ad5b4bf78e2779f7d1c405f, the various static inline versions of randTLS are no longer used, which clang warns about. Change-Id: I6dc21c0aab35fb6a8ca9e8d43ee4960ee844ef47 Reviewed-by: Thiago Macieira --- src/corelib/global/qrandom.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 424fa4449e..6a0b86dd6e 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -1217,29 +1217,4 @@ struct QRandEngine }; } -#if defined(Q_OS_WIN) -// On Windows srand() and rand() already use Thread-Local-Storage -// to store the seed between calls -static inline QRandEngine *randTLS() -{ - return nullptr; -} -#elif defined(Q_COMPILER_THREAD_LOCAL) -static inline QRandEngine *randTLS() -{ - thread_local QRandEngine r; - return &r; -} -#else -Q_GLOBAL_STATIC(QThreadStorage, g_randTLS) -static inline QRandEngine *randTLS() -{ - auto tls = g_randTLS(); - if (!tls) - return nullptr; - return &tls->localData(); - -} -#endif - QT_END_NAMESPACE -- cgit v1.2.3