summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-01-11 12:58:19 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-01-11 12:58:19 (GMT)
commit62a681d116154235325c8b13f6df0042d81851ee (patch)
tree5eb543df8414df4480249f1cc98f7e4341cd8d60
parent3bd2b098888432aa29cc085759963dbb7e009ecf (diff)
downloadQt-62a681d116154235325c8b13f6df0042d81851ee.zip
Qt-62a681d116154235325c8b13f6df0042d81851ee.tar.gz
Qt-62a681d116154235325c8b13f6df0042d81851ee.tar.bz2
fix warning "'SeedStorage* randTLS()' defined but not used"
by setting the proper macro-guards; regroup macro-guards for better readability (superfluous change, I know); fix typos in the comments was not splited into two commits to make it more clear why and how that warning is fixed now Merge-request: 955 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
-rw-r--r--src/corelib/global/qglobal.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 9b597f6..5d079d0 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2589,7 +2589,7 @@ bool qputenv(const char *varName, const QByteArray& value)
#endif
}
-#if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD)
# if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500)
// older versions of INTEGRITY used a long instead of a uint for the seed.
@@ -2620,7 +2620,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD)
SeedStorage *seedStorage = randTLS();
if (seedStorage) {
SeedStorageType *pseed = seedStorage->localData();
@@ -2628,10 +2628,10 @@ void qsrand(uint seed)
seedStorage->setLocalData(pseed = new SeedStorageType);
*pseed = seed;
} else {
- //golbal static seed storage should always exist,
+ //global static seed storage should always exist,
//except after being deleted by QGlobalStaticDeleter.
//But since it still can be called from destructor of another
- //global static object, fallback to sqrand(seed)
+ //global static object, fallback to srand(seed)
srand(seed);
}
#else
@@ -2659,7 +2659,7 @@ void qsrand(uint seed)
*/
int qrand()
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_THREAD)
SeedStorage *seedStorage = randTLS();
if (seedStorage) {
SeedStorageType *pseed = seedStorage->localData();
@@ -2669,10 +2669,10 @@ int qrand()
}
return rand_r(pseed);
} else {
- //golbal static seed storage should always exist,
+ //global static seed storage should always exist,
//except after being deleted by QGlobalStaticDeleter.
//But since it still can be called from destructor of another
- //global static object, fallback to qrand()
+ //global static object, fallback to rand()
return rand();
}
#else