From 9252b9bb92ceeb05fb1700dfcf283ab10189be50 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 1 Apr 2021 22:59:07 -0700 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/tools/qhash.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/corelib/tools/qhash.cpp') 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 . ** 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); } } -- cgit v1.2.3