From owner-svn-ports-head@freebsd.org Wed Sep 23 12:04:23 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0E1E3F755F; Wed, 23 Sep 2020 12:04:23 +0000 (UTC) (envelope-from sunpoet@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxH0R667kz4h3p; Wed, 23 Sep 2020 12:04:23 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0BC91039A; Wed, 23 Sep 2020 12:04:23 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08NC4NTo061656; Wed, 23 Sep 2020 12:04:23 GMT (envelope-from sunpoet@FreeBSD.org) Received: (from sunpoet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08NC4NnQ061655; Wed, 23 Sep 2020 12:04:23 GMT (envelope-from sunpoet@FreeBSD.org) Message-Id: <202009231204.08NC4NnQ061655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sunpoet set sender to sunpoet@FreeBSD.org using -f From: Sunpoet Po-Chuan Hsieh Date: Wed, 23 Sep 2020 12:04:23 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r549685 - head/databases/rocksdb/files X-SVN-Group: ports-head X-SVN-Commit-Author: sunpoet X-SVN-Commit-Paths: head/databases/rocksdb/files X-SVN-Commit-Revision: 549685 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 12:04:24 -0000 Author: sunpoet Date: Wed Sep 23 12:04:23 2020 New Revision: 549685 URL: https://svnweb.freebsd.org/changeset/ports/549685 Log: Fix build with Clang 10 Obtained from: https://github.com/facebook/rocksdb/commit/9cc25190e1ba6fc66bbd0d47caaf043d75839b6f Added: head/databases/rocksdb/files/patch-clang10 (contents, props changed) Added: head/databases/rocksdb/files/patch-clang10 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/rocksdb/files/patch-clang10 Wed Sep 23 12:04:23 2020 (r549685) @@ -0,0 +1,145 @@ +Obtained from: https://github.com/facebook/rocksdb/commit/9cc25190e1ba6fc66bbd0d47caaf043d75839b6f + +--- db/db_iter_stress_test.cc.orig 2020-07-16 00:54:15 UTC ++++ db/db_iter_stress_test.cc +@@ -97,7 +97,8 @@ struct StressTestIterator : public InternalIterator { + + bool MaybeFail() { + if (rnd->Next() >= +- std::numeric_limits::max() * error_probability) { ++ static_cast(std::numeric_limits::max()) * ++ error_probability) { + return false; + } + if (rnd->Next() % 2) { +@@ -114,7 +115,8 @@ struct StressTestIterator : public InternalIterator { + + void MaybeMutate() { + if (rnd->Next() >= +- std::numeric_limits::max() * mutation_probability) { ++ static_cast(std::numeric_limits::max()) * ++ mutation_probability) { + return; + } + do { +@@ -126,8 +128,9 @@ struct StressTestIterator : public InternalIterator { + if (data->hidden.empty()) { + hide_probability = 1; + } +- bool do_hide = +- rnd->Next() < std::numeric_limits::max() * hide_probability; ++ bool do_hide = rnd->Next() < ++ static_cast(std::numeric_limits::max()) * ++ hide_probability; + if (do_hide) { + // Hide a random entry. + size_t idx = rnd->Next() % data->entries.size(); +--- db/db_options_test.cc.orig 2020-07-16 00:54:15 UTC ++++ db/db_options_test.cc +@@ -39,7 +39,7 @@ class DBOptionsTest : public DBTestBase { + std::unordered_map options_map; + StringToMap(options_str, &options_map); + std::unordered_map mutable_map; +- for (const auto opt : db_options_type_info) { ++ for (const auto& opt : db_options_type_info) { + if (opt.second.IsMutable() && opt.second.ShouldSerialize()) { + mutable_map[opt.first] = options_map[opt.first]; + } +@@ -57,7 +57,7 @@ class DBOptionsTest : public DBTestBase { + std::unordered_map options_map; + StringToMap(options_str, &options_map); + std::unordered_map mutable_map; +- for (const auto opt : cf_options_type_info) { ++ for (const auto& opt : cf_options_type_info) { + if (opt.second.IsMutable() && opt.second.ShouldSerialize()) { + mutable_map[opt.first] = options_map[opt.first]; + } +--- env/env_test.cc.orig 2020-07-16 00:54:15 UTC ++++ env/env_test.cc +@@ -1047,7 +1047,7 @@ TEST_P(EnvPosixTestWithParam, RandomAccessUniqueIDConc + + // Collect and check whether the IDs are unique. + std::unordered_set ids; +- for (const std::string fname : fnames) { ++ for (const std::string& fname : fnames) { + std::unique_ptr file; + std::string unique_id; + ASSERT_OK(env_->NewRandomAccessFile(fname, &file, soptions)); +@@ -1061,7 +1061,7 @@ TEST_P(EnvPosixTestWithParam, RandomAccessUniqueIDConc + } + + // Delete the files +- for (const std::string fname : fnames) { ++ for (const std::string& fname : fnames) { + ASSERT_OK(env_->DeleteFile(fname)); + } + +--- options/options_helper.cc.orig 2020-07-16 00:54:15 UTC ++++ options/options_helper.cc +@@ -656,7 +656,7 @@ Status GetStringFromStruct( + std::string* opt_string) { + assert(opt_string); + opt_string->clear(); +- for (const auto iter : type_info) { ++ for (const auto& iter : type_info) { + const auto& opt_info = iter.second; + // If the option is no longer used in rocksdb and marked as deprecated, + // we skip it in the serialization. +--- table/table_test.cc.orig 2020-07-16 00:54:15 UTC ++++ table/table_test.cc +@@ -228,7 +228,7 @@ class BlockConstructor: public Constructor { + block_ = nullptr; + BlockBuilder builder(table_options.block_restart_interval); + +- for (const auto kv : kv_map) { ++ for (const auto& kv : kv_map) { + builder.Add(kv.first, kv.second); + } + // Open the block +@@ -352,7 +352,7 @@ class TableConstructor: public Constructor { + TablePropertiesCollectorFactory::Context::kUnknownColumnFamily, + file_writer_.get())); + +- for (const auto kv : kv_map) { ++ for (const auto& kv : kv_map) { + if (convert_to_internal_key_) { + ParsedInternalKey ikey(kv.first, kMaxSequenceNumber, kTypeValue); + std::string encoded; +@@ -487,7 +487,7 @@ class MemTableConstructor: public Constructor { + kMaxSequenceNumber, 0 /* column_family_id */); + memtable_->Ref(); + int seq = 1; +- for (const auto kv : kv_map) { ++ for (const auto& kv : kv_map) { + memtable_->Add(seq, kTypeValue, kv.first, kv.second); + seq++; + } +@@ -548,7 +548,7 @@ class DBConstructor: public Constructor { + delete db_; + db_ = nullptr; + NewDB(); +- for (const auto kv : kv_map) { ++ for (const auto& kv : kv_map) { + WriteBatch batch; + batch.Put(kv.first, kv.second); + EXPECT_TRUE(db_->Write(WriteOptions(), &batch).ok()); +@@ -1224,7 +1224,7 @@ class FileChecksumTestHelper { + } + + Status WriteKVAndFlushTable() { +- for (const auto kv : kv_map_) { ++ for (const auto& kv : kv_map_) { + if (convert_to_internal_key_) { + ParsedInternalKey ikey(kv.first, kMaxSequenceNumber, kTypeValue); + std::string encoded; +--- tools/ldb_cmd_test.cc.orig 2020-07-16 00:54:15 UTC ++++ tools/ldb_cmd_test.cc +@@ -76,7 +76,7 @@ TEST_F(LdbCmdTest, HexToStringBadInputs) { + const vector badInputs = { + "0xZZ", "123", "0xx5", "0x111G", "0x123", "Ox12", "0xT", "0x1Q1", + }; +- for (const auto badInput : badInputs) { ++ for (const auto& badInput : badInputs) { + try { + ROCKSDB_NAMESPACE::LDBCommand::HexToString(badInput); + std::cerr << "Should fail on bad hex value: " << badInput << "\n";