From nobody Wed Jun 28 10:59:28 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QrdrJ5PNkz4kXvf; Wed, 28 Jun 2023 10:59:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QrdrJ4wcDz3QGP; Wed, 28 Jun 2023 10:59:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687949968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZeQ8gaMVd4pW1w8dQcmAEGzo9wJa+gHMN+YbmD/eDNw=; b=h5G0ge/hfK/QVgN244At4HN8Gf6KmEyPTl02TjkK9XfBt59QpFgLO5IxaQ5g55mOwKHe0F wa0kYXeUL/Aur1NdEL9e0Xt3rtf/mC5RmLpkO2nbrcg1v+6lpMSj+blPQtlBFfMievSqBI tmDLDftW/S2O2pATUSqzQWTd4Ix1ALlkXxHgeVTeZyhqgGuX3CGw2QTJvm3X+xozV9Len3 kWSJUrtSvIgmJkodPef2f/HI8/+gxC2O6OJXgR/d1DA0gOBSu3r9LnK52zBN3pmrnySnEO hKEz7vQinX4YtIhpLH7eJMCy/IcFZITw07oSw50uJrMjpOI92OYzX+FucCHx7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687949968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZeQ8gaMVd4pW1w8dQcmAEGzo9wJa+gHMN+YbmD/eDNw=; b=lOBkj9y1xv16gpix8UnACo0WDJYCBVkeXud/vXd8NF6Lt9lUTho6MVywsMZjUXTaY81li9 omkxeNpcawFCZHYYdoE1xu0CtIAGrqh8diKzAENIDDQ2Gac5kNd3FfePnClxKbKcvpUHYT 9Ks0ro5B+2a9EnFMV6BmRY/O1LtJ+gIoKVdPfY0Ntw+Et11JbQzG+BxFytRX9NHG4sVtf8 TlyHHVXdQoPdyn73cbYxs6nh0y0Jgm8obpC+DVPaj3pCrM/nM4nRv0Ww0lw6LoksqNWPXi BInwkCe9UaycBZYIXhYOAYKOyaYi+lGEvlNiV9ucrF3n4aajArYxlok6LZo3Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687949968; a=rsa-sha256; cv=none; b=YRMHH7mHGl/ho6tOf0D/VGHFBpASEhuF+mjRSFZQTtQjQIF+wp1alRRdxQMK8oX2wdn7d7 4dp/bHI4bXaIZYwNuUS+1KVaWsns4dIC+Ix0D66jynsRXQ3fgLkOCDUz363+BLbu9a0JOb sPH7/3WRTWQkz3rbTIAH/jJoZLTvV4Ld/Na8avQxaWB0l9U7G6gl2dGt//1yfgNLS4ktNp raugbROfRzgvZ5Zq58a/tk6qVQAhLspbhLs9B2FnXf4vHnrXeXdbRw6P221SR1z9v/p2tb ChPF+rNk+Wrn4atAxRHl/gMLC9p4TrP36kiLjnK8RYxzI8iyvZqx5dbjdhxT2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QrdrJ1qDLzWs6; Wed, 28 Jun 2023 10:59:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35SAxSNX075965; Wed, 28 Jun 2023 10:59:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35SAxSO0075964; Wed, 28 Jun 2023 10:59:28 GMT (envelope-from git) Date: Wed, 28 Jun 2023 10:59:28 GMT Message-Id: <202306281059.35SAxSO0075964@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 2c1a536ebca3 - main - math/sound-of-sorting: fix build on 14-CURRENT List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c1a536ebca3d3cf933f46193731e271c10be29e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/ports/commit/?id=2c1a536ebca3d3cf933f46193731e271c10be29e commit 2c1a536ebca3d3cf933f46193731e271c10be29e Author: Stefan Eßer AuthorDate: 2023-06-28 10:57:44 +0000 Commit: Stefan Eßer CommitDate: 2023-06-28 10:57:44 +0000 math/sound-of-sorting: fix build on 14-CURRENT The random_shuffle() function has been removed from C++17. Use shuffle() with a suitable pseudo-random generator instead. --- math/sound-of-sorting/files/patch-src_SortAlgo.cpp | 21 +++++++++ .../sound-of-sorting/files/patch-src_SortArray.cpp | 54 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/math/sound-of-sorting/files/patch-src_SortAlgo.cpp b/math/sound-of-sorting/files/patch-src_SortAlgo.cpp new file mode 100644 index 000000000000..596e78a99cf8 --- /dev/null +++ b/math/sound-of-sorting/files/patch-src_SortAlgo.cpp @@ -0,0 +1,21 @@ +--- src/SortAlgo.cpp.orig 2017-12-23 08:39:32 UTC ++++ src/SortAlgo.cpp +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + typedef ArrayItem value_type; + +@@ -1076,7 +1077,9 @@ void BogoSort(SortArray& A) + if (BogoCheckSorted(A)) break; + + // pick a random permutation of indexes +- std::random_shuffle(perm.begin(), perm.end()); ++ std::random_device rng; ++ std::mt19937 urng(rng()); ++ std::shuffle(perm.begin(), perm.end(), urng); + + // permute array in-place + std::vector pmark(A.size(), 0); diff --git a/math/sound-of-sorting/files/patch-src_SortArray.cpp b/math/sound-of-sorting/files/patch-src_SortArray.cpp new file mode 100644 index 000000000000..29184f4f63ba --- /dev/null +++ b/math/sound-of-sorting/files/patch-src_SortArray.cpp @@ -0,0 +1,54 @@ +--- src/SortArray.cpp.orig 2017-12-23 08:39:32 UTC ++++ src/SortArray.cpp +@@ -25,6 +25,7 @@ + #include "SortAlgo.h" + + #include ++#include + + extern void SoundAccess(size_t i); + +@@ -123,7 +124,9 @@ void SortArray::FillData(unsigned int schema, size_t a + for (size_t i = 0; i < m_array.size(); ++i) + m_array[i] = ArrayItem(i+1); + +- std::random_shuffle(m_array.begin(), m_array.end()); ++ std::random_device rng; ++ std::mt19937 urng(rng()); ++ std::shuffle(m_array.begin(), m_array.end(), urng); + } + else if (schema == 1) // Ascending [1,n] + { +@@ -150,7 +153,9 @@ void SortArray::FillData(unsigned int schema, size_t a + m_array[i] = ArrayItem(w + 1); + } + +- std::random_shuffle(m_array.begin(), m_array.end()); ++ std::random_device rng; ++ std::mt19937 urng(rng()); ++ std::shuffle(m_array.begin(), m_array.end(), urng); + } + else if (schema == 4) // Quintic skew of [1,n] + { +@@ -167,7 +172,9 @@ void SortArray::FillData(unsigned int schema, size_t a + m_array[i] = ArrayItem(w + 1); + } + +- std::random_shuffle(m_array.begin(), m_array.end()); ++ std::random_device rng; ++ std::mt19937 urng(rng()); ++ std::shuffle(m_array.begin(), m_array.end(), urng); + } + else if (schema == 5) // shuffled n-2 equal values in [1,n] + { +@@ -178,7 +185,9 @@ void SortArray::FillData(unsigned int schema, size_t a + } + m_array[m_array.size()-1] = ArrayItem(arraysize); + +- std::random_shuffle(m_array.begin(), m_array.end()); ++ std::random_device rng; ++ std::mt19937 urng(rng()); ++ std::shuffle(m_array.begin(), m_array.end(), urng); + } + else // fallback + {