summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-04-01 22:59:07 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-04-16 17:51:28 -0700
commit9252b9bb92ceeb05fb1700dfcf283ab10189be50 (patch)
treec5b152ca66772e598c495e5e6d935e8d6ab61f60
parent042e728752c3e35c0f8d567c1c70ab407bfff57f (diff)
QHash: remove the ability to set a non-zero global seed
We've been warning since commit 4ba740b3bac6e1824c18614f579d106eee930d42 (2017-03-31, Qt 5.9.0). Change-Id: Id2983978ad544ff79911fffd1671f505fee6f282 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/corelib/tools/qhash.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 51e2a18961..23eb07406c 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2021 Intel Corporation.
** Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>.
** Contact: https://www.qt.io/licensing/
**
@@ -725,8 +725,8 @@ static uint qt_create_qhash_seed()
uint seed = envSeed.toUInt();
if (seed) {
// can't use qWarning here (reentrancy)
- fprintf(stderr, "QT_HASH_SEED: forced seed value is not 0, cannot guarantee that the "
- "hashing functions will produce a stable value.");
+ fprintf(stderr, "QT_HASH_SEED: forced seed value is not 0; ignored.\n");
+ seed = 0;
}
return seed;
}
@@ -812,10 +812,9 @@ void qSetGlobalQHashSeed(int newSeed)
} else {
if (newSeed) {
// can't use qWarning here (reentrancy)
- fprintf(stderr, "qSetGlobalQHashSeed: forced seed value is not 0, cannot guarantee that the "
- "hashing functions will produce a stable value.");
+ fprintf(stderr, "qSetGlobalQHashSeed: forced seed value is not 0; ignoring call\n");
}
- qt_qhash_seed.storeRelaxed(newSeed & INT_MAX);
+ qt_qhash_seed.storeRelaxed(0);
}
}