aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2013-06-20 18:43:09 -0700
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2013-06-23 11:59:55 -0700
commit3f2aca298c28e50745926a96758f4641dc73cf51 (patch)
tree88c7cbdcc9e6bb6e530849f71ca9df4055f6f418
parentf5088a55a9c88793a53172b7029713f2f64e687a (diff)
downloadpaludis-3f2aca298c28e50745926a96758f4641dc73cf51.tar.gz
paludis-3f2aca298c28e50745926a96758f4641dc73cf51.tar.xz
C++11: auto convert to nullptr via cpp11-migrate
This is a blanket migration via the clang C++11 migration tool to convert NULL pointer to nullptr usage. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
-rw-r--r--paludis/args/args_option.cc4
-rw-r--r--paludis/elf_linkage_checker.cc4
-rw-r--r--paludis/elike_use_requirement.cc2
-rw-r--r--paludis/elike_use_requirement_TEST.cc318
-rw-r--r--paludis/environment_factory.cc8
-rw-r--r--paludis/environments/paludis/output_conf.cc2
-rw-r--r--paludis/fs_merger.cc4
-rw-r--r--paludis/ipc_output_manager.cc2
-rw-r--r--paludis/paludislike_options_conf.cc4
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc10
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc2
-rw-r--r--paludis/repositories/accounts/passwd_accounts_handler.cc4
-rw-r--r--paludis/repositories/e/a_finder.cc2
-rw-r--r--paludis/repositories/e/ebuild/utils/print_exports.cc2
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc2
-rw-r--r--paludis/repositories/e/xml_things_handle.cc14
-rw-r--r--paludis/repositories/fake/fake_repository.cc6
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.cc6
-rw-r--r--paludis/repositories/gemcutter/json_things_handle.cc4
-rw-r--r--paludis/repositories/repository/repository_repository.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc6
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc4
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc6
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc6
-rw-r--r--paludis/repository_factory.cc18
-rw-r--r--paludis/resolver/decisions.hh2
-rw-r--r--paludis/set_file_TEST.cc8
-rw-r--r--paludis/stripper.cc14
-rw-r--r--paludis/stripper_extras.cc2
-rw-r--r--paludis/tar_extras.cc4
-rw-r--r--paludis/user_dep_spec.cc12
-rw-r--r--paludis/util/process.cc44
-rw-r--r--paludis/util/singleton_TEST.cc12
-rw-r--r--paludis/util/string_list_stream.cc2
-rw-r--r--paludis/util/tribool.cc2
-rw-r--r--paludis/util/wildcard_expander.cc2
-rw-r--r--paludis/util/wrapped_value.hh2
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc2
-rw-r--r--src/clients/cave/cmd_match.cc8
-rw-r--r--src/clients/cave/cmd_print_id_environment_variable.cc2
-rw-r--r--src/clients/cave/search_extras.cc14
-rw-r--r--src/clients/cave/search_extras_handle.cc16
43 files changed, 297 insertions, 297 deletions
diff --git a/paludis/args/args_option.cc b/paludis/args/args_option.cc
index 5088063..3d91f61 100644
--- a/paludis/args/args_option.cc
+++ b/paludis/args/args_option.cc
@@ -134,7 +134,7 @@ StringArg::StringArg(ArgsGroup * const g, const std::string & our_long_name,
const bool neg) :
ArgsOption(g, our_long_name, our_short_name, our_description),
_can_be_negated(neg),
- _validator(0)
+ _validator(nullptr)
{
}
@@ -201,7 +201,7 @@ StringSetArg::StringSetArg(ArgsGroup * const g, const std::string & our_long_nam
const StringSetArgOptions & opts) :
ArgsOption(g, our_long_name, our_short_name, our_description),
_imp(),
- _validator(0)
+ _validator(nullptr)
{
std::copy(opts._imp->options.begin(), opts._imp->options.end(),
std::back_inserter(_imp->allowed_args));
diff --git a/paludis/elf_linkage_checker.cc b/paludis/elf_linkage_checker.cc
index 713c8f6..d378e2f 100644
--- a/paludis/elf_linkage_checker.cc
+++ b/paludis/elf_linkage_checker.cc
@@ -186,13 +186,13 @@ Imp<ElfLinkageChecker>::check_elf(const FSPath & file, std::istream & stream)
{
const DynamicSection<ElfType_> * dyn_sec(visitor_cast<const DynamicSection<ElfType_> >(*sec_it));
- if (0 != dyn_sec)
+ if (nullptr != dyn_sec)
for (typename DynamicSection<ElfType_>::EntryIterator ent_it(dyn_sec->entry_begin()),
ent_it_end(dyn_sec->entry_end()); ent_it_end != ent_it; ++ent_it)
{
const DynamicEntryString<ElfType_> * ent_str(visitor_cast<const DynamicEntryString<ElfType_> >(*ent_it));
- if (0 != ent_str && "NEEDED" == ent_str->tag_name())
+ if (nullptr != ent_str && "NEEDED" == ent_str->tag_name())
{
const std::string & req((*ent_str)());
if (check_libraries.empty() || check_libraries.end() != check_libraries.find(req))
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index a630e5f..996c09b 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -955,7 +955,7 @@ namespace
const std::shared_ptr<const PackageID> & spec_id,
ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result))
{
- if (requirement_met(env, maybe_changes_to_owner, id, spec_id, 0).first)
+ if (requirement_met(env, maybe_changes_to_owner, id, spec_id, nullptr).first)
return indeterminate;
else
return false;
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index f48df88..67496ea 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -77,25 +77,25 @@ TEST(ELikeUseRequirements, Simple)
parse_elike_use_requirement_no_accumulate("enabled", { euro_strict_parsing }));
EXPECT_EQ("[enabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled", req1->as_human_string(nullptr));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("disabled", { euro_strict_parsing }));
EXPECT_EQ("[disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'disabled' enabled", req2->as_human_string(nullptr));
- EXPECT_TRUE(! req2->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req2->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement_no_accumulate("-enabled", { euro_strict_parsing }));
EXPECT_EQ("[-enabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled", req3->as_human_string(nullptr));
- EXPECT_TRUE(! req3->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req3->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement_no_accumulate("-disabled", { euro_strict_parsing }));
EXPECT_EQ("[-disabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'disabled' disabled", req4->as_human_string(nullptr));
- EXPECT_TRUE(req4->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req4->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
}
TEST(ELikeUseRequirements, Portage)
@@ -113,25 +113,25 @@ TEST(ELikeUseRequirements, Portage)
parse_elike_use_requirement_no_accumulate("enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled", req1->as_human_string(nullptr));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'disabled' enabled", req2->as_human_string(nullptr));
- EXPECT_TRUE(! req2->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req2->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement_no_accumulate("-enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-enabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled", req3->as_human_string(nullptr));
- EXPECT_TRUE(! req3->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req3->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement_no_accumulate("-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-disabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'disabled' disabled", req4->as_human_string(nullptr));
- EXPECT_TRUE(req4->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req4->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
}
TEST(ELikeUseRequirements, Multiple)
@@ -149,31 +149,31 @@ TEST(ELikeUseRequirements, Multiple)
parse_elike_use_requirement_no_accumulate("enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled", req1->as_human_string(nullptr));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("enabled,disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' enabled", req2->as_human_string(nullptr));
- EXPECT_TRUE(! req2->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req2->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement_no_accumulate("-enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-enabled,-disabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled; Flag 'disabled' disabled", req3->as_human_string(nullptr));
- EXPECT_TRUE(! req3->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req3->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement_no_accumulate("enabled,-disabled,-enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled,-enabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled", req4->as_human_string(nullptr));
- EXPECT_TRUE(! req4->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req4->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement_no_accumulate("enabled,-disabled,enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled,enabled]", req5->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled", req5->as_human_string(nullptr));
- EXPECT_TRUE(req5->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req5->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
}
TEST(ELikeUseRequirements, Complex)
@@ -193,85 +193,85 @@ TEST(ELikeUseRequirements, Complex)
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req1->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
- EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req3->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req3->as_human_string(id));
- EXPECT_TRUE(! req3->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req3->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req3->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req3->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req4->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req4->as_human_string(id2));
- EXPECT_TRUE(req4->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req4->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req4->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req4->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req5->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req5->as_human_string(id));
- EXPECT_TRUE(req5->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req5->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req5->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req5->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req6(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req6->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req6->as_human_string(id2));
- EXPECT_TRUE(req6->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req6->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req6->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req6->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
- EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
- EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req8->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req8->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
- EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req9->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req9->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
- EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req10->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req10->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
- EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req11->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req11->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
- EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req12->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req12->requirement_met(&env, nullptr, id2, id2, nullptr).first);
}
TEST(ELikeUseRequirements, ComplexPortage)
@@ -291,57 +291,57 @@ TEST(ELikeUseRequirements, ComplexPortage)
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req1->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
- EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
- EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
- EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req8->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req8->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
- EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req9->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req9->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
- EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req10->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req10->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
- EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req11->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req11->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
- EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req12->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req12->requirement_met(&env, nullptr, id2, id2, nullptr).first);
}
TEST(ELikeUseRequirements, Both)
@@ -361,113 +361,113 @@ TEST(ELikeUseRequirements, Both)
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req1->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
- EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
- EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
- EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req8->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req8->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
- EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req9->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req9->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
- EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req10->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req10->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
- EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req11->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req11->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
- EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req12->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req12->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
- EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req13->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req13->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
- EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req14->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req14->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
- EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req15->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req15->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
- EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req16->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req16->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
- EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req17->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req17->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
- EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req18->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req18->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
- EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req19->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req19->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
- EXPECT_TRUE(req20->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req20->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req20->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req20->requirement_met(&env, nullptr, id2, id2, nullptr).first);
}
TEST(ELikeUseRequirements, Malformed)
@@ -565,113 +565,113 @@ TEST(ELikeUseRequirements, ComplexNonStrict)
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req1->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
- EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
- EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
- EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req8->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req8->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
- EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req9->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req9->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
- EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req10->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req10->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
- EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req11->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req11->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
- EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req12->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req12->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
- EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req13->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req13->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
- EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req14->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req14->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
- EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req15->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req15->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
- EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req16->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req16->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
- EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req17->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req17->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
- EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req18->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req18->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
- EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req19->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req19->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
- EXPECT_TRUE(req20->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req20->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req20->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req20->requirement_met(&env, nullptr, id2, id2, nullptr).first);
}
TEST(ELikeUseRequirements, PortageNonStrict)
@@ -691,113 +691,113 @@ TEST(ELikeUseRequirements, PortageNonStrict)
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req1->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
- EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
- EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req7->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
- EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req8->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req8->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
- EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req9->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(! req9->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
- EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req10->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req10->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
- EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req11->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req11->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
- EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req12->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req12->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
- EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req13->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req13->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
- EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req14->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req14->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
- EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req15->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req15->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
- EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req16->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req16->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
- EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(req17->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req17->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
- EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(! req18->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(req18->requirement_met(&env, nullptr, id2, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
- EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
- EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
+ EXPECT_TRUE(! req19->requirement_met(&env, nullptr, id, id, nullptr).first);
+ EXPECT_TRUE(req19->requirement_met(&env, nullptr, id2, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
- EXPECT_TRUE(req20->requirement_met(&env, 0, id, id2, 0).first);
- EXPECT_TRUE(! req20->requirement_met(&env, 0, id2, id2, 0).first);
+ EXPECT_TRUE(req20->requirement_met(&env, nullptr, id, id2, nullptr).first);
+ EXPECT_TRUE(! req20->requirement_met(&env, nullptr, id2, id2, nullptr).first);
}
TEST(ELikeUseRequirements, Defaults)
@@ -815,25 +815,25 @@ TEST(ELikeUseRequirements, Defaults)
parse_elike_use_requirement_no_accumulate("missing(+)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[missing(+)]", req1->as_raw_string());
EXPECT_EQ("Flag 'missing' enabled, assuming enabled if missing", req1->as_human_string(nullptr));
- EXPECT_TRUE(req1->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("missing(-)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[missing(-)]", req2->as_raw_string());
EXPECT_EQ("Flag 'missing' enabled, assuming disabled if missing", req2->as_human_string(nullptr));
- EXPECT_TRUE(! req2->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req2->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement_no_accumulate("-missing(+)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[-missing(+)]", req3->as_raw_string());
EXPECT_EQ("Flag 'missing' disabled, assuming enabled if missing", req3->as_human_string(nullptr));
- EXPECT_TRUE(! req3->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(! req3->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement_no_accumulate("-missing(-)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[-missing(-)]", req4->as_raw_string());
EXPECT_EQ("Flag 'missing' disabled, assuming disabled if missing", req4->as_human_string(nullptr));
- EXPECT_TRUE(req4->requirement_met(&env, 0, id, nullptr, 0).first);
+ EXPECT_TRUE(req4->requirement_met(&env, nullptr, id, nullptr, nullptr).first);
}
TEST(ELikeUseRequirements, PrefixStar)
@@ -850,12 +850,12 @@ TEST(ELikeUseRequirements, PrefixStar)
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement_no_accumulate("foo:*", { euro_allow_default_values, euro_allow_self_deps }));
EXPECT_EQ("[foo:*]", req1->as_raw_string());
- EXPECT_TRUE(! req1->requirement_met(&env, 0, id, id, 0).first);
+ EXPECT_TRUE(! req1->requirement_met(&env, nullptr, id, id, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("foo:*=", { euro_allow_default_values, euro_allow_self_deps }));
EXPECT_EQ("[foo:*=]", req2->as_raw_string());
- EXPECT_TRUE(req2->requirement_met(&env, 0, id, id, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id, id, nullptr).first);
}
TEST(ELikeUseRequirements, QuestionDefaults)
@@ -876,13 +876,13 @@ TEST(ELikeUseRequirements, QuestionDefaults)
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
parse_elike_use_requirement_no_accumulate("foo:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
EXPECT_EQ("[foo:*(?)=]", req1->as_raw_string());
- EXPECT_TRUE(req1->requirement_met(&env, 0, id2, id2, 0).first);
- EXPECT_TRUE(req1->requirement_met(&env, 0, id1, id2, 0).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id2, id2, nullptr).first);
+ EXPECT_TRUE(req1->requirement_met(&env, nullptr, id1, id2, nullptr).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement_no_accumulate("bar:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
EXPECT_EQ("[bar:*(?)=]", req2->as_raw_string());
- EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
- EXPECT_TRUE(req2->requirement_met(&env, 0, id1, id2, 0).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id2, id2, nullptr).first);
+ EXPECT_TRUE(req2->requirement_met(&env, nullptr, id1, id2, nullptr).first);
}
diff --git a/paludis/environment_factory.cc b/paludis/environment_factory.cc
index 1c21433..2b10829 100644
--- a/paludis/environment_factory.cc
+++ b/paludis/environment_factory.cc
@@ -77,10 +77,10 @@ EnvironmentFactory::EnvironmentFactory() :
{
using namespace environment_groups;
- register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_dummy>::Type *>(0), this);
- register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_paludis>::Type *>(0), this);
- register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_portage>::Type *>(0), this);
- register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_test>::Type *>(0), this);
+ register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_dummy>::Type *>(nullptr), this);
+ register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_paludis>::Type *>(nullptr), this);
+ register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_portage>::Type *>(nullptr), this);
+ register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_test>::Type *>(nullptr), this);
}
EnvironmentFactory::~EnvironmentFactory()
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index a53b73c..6886b96 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -249,7 +249,7 @@ namespace
m->insert("green", "\033[1;32m");
m->insert("blue", "\033[1;34m");
m->insert("normal", "\033[0;0m");
- m->insert("time", stringify(time(0)));
+ m->insert("time", stringify(time(nullptr)));
m->insert("pid", stringify(getpid()));
const std::shared_ptr<const PaludisDistribution> dist(
diff --git a/paludis/fs_merger.cc b/paludis/fs_merger.cc
index 908ce12..7b6d074 100644
--- a/paludis/fs_merger.cc
+++ b/paludis/fs_merger.cc
@@ -803,7 +803,7 @@ FSMerger::try_to_copy_xattrs(const FSPath & src, int dst_fd, FSMergerStatusFlags
{
FDHolder src_fd(::open(stringify(src).c_str(), O_RDONLY));
- ssize_t list_sz(flistxattr(src_fd, 0, 0));
+ ssize_t list_sz(flistxattr(src_fd, nullptr, 0));
if (-1 == list_sz)
{
if (ENOTSUP != errno)
@@ -833,7 +833,7 @@ FSMerger::try_to_copy_xattrs(const FSPath & src, int dst_fd, FSMergerStatusFlags
std::string key(list_holder.get() + offset);
do
{
- ssize_t value_sz(fgetxattr(src_fd, key.c_str(), 0, 0));
+ ssize_t value_sz(fgetxattr(src_fd, key.c_str(), nullptr, 0));
if (-1 == value_sz)
{
Log::get_instance()->message("merger.xattrs.failure", ll_warning, lc_context) <<
diff --git a/paludis/ipc_output_manager.cc b/paludis/ipc_output_manager.cc
index df83680..24285de 100644
--- a/paludis/ipc_output_manager.cc
+++ b/paludis/ipc_output_manager.cc
@@ -405,7 +405,7 @@ IPCInputManager::_copy_thread()
FD_SET(_imp->finished_pipe.read_fd(), &read_fds);
max_fd = std::max(max_fd, _imp->finished_pipe.read_fd());
- int retval(pselect(max_fd + 1, &read_fds, 0, 0, 0, 0));
+ int retval(pselect(max_fd + 1, &read_fds, nullptr, nullptr, nullptr, nullptr));
if (-1 == retval)
throw InternalError(PALUDIS_HERE, "pselect failed: " + stringify(strerror(errno)));
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 1e96408..44291cc 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -192,7 +192,7 @@ PaludisLikeOptionsConf::add_file(const FSPath & f)
if (tokens.size() < 2)
continue;
- ValuesGroups * values_groups(0);
+ ValuesGroups * values_groups(nullptr);
try
{
std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
@@ -243,7 +243,7 @@ PaludisLikeOptionsConf::add_file(const FSPath & f)
if (! values_groups)
throw InternalError(PALUDIS_HERE, "huh?");
- ValuesGroup * values_group(0);
+ ValuesGroup * values_group(nullptr);
for (std::vector<std::string>::iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index e18db9d..b787987 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -108,9 +108,9 @@ AccountsRepository::AccountsRepository(const AccountsRepositoryParams & p) :
p.environment(),
p.name(),
make_named_values<RepositoryCapabilities>(
- n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(nullptr),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(p.name(), p)
{
@@ -123,8 +123,8 @@ AccountsRepository::AccountsRepository(const InstalledAccountsRepositoryParams &
p.name(),
make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(p.name(), p)
{
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index 4bba754..a807437 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -142,7 +142,7 @@ InstalledAccountsID::need_keys_added() const
struct group grp;
struct group * grp_result;
- if (0 == getgrgid_r(pwd.pw_gid, &grp, &grp_buf[0], grp_buf_sz, &grp_result) && 0 != grp_result)
+ if (0 == getgrgid_r(pwd.pw_gid, &grp, &grp_buf[0], grp_buf_sz, &grp_result) && nullptr != grp_result)
{
/* really we should only do this if the group in question is managed by accounts. users
* might have accounts installed by hand with a group that's unmanaged. */
diff --git a/paludis/repositories/accounts/passwd_accounts_handler.cc b/paludis/repositories/accounts/passwd_accounts_handler.cc
index 15195ad..f76d5e1 100644
--- a/paludis/repositories/accounts/passwd_accounts_handler.cc
+++ b/paludis/repositories/accounts/passwd_accounts_handler.cc
@@ -68,7 +68,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
username = k->parse_value();
- if (0 != getpwnam(username.c_str()))
+ if (nullptr != getpwnam(username.c_str()))
throw ActionFailedError("User '" + username + "' already exists");
} while (false);
@@ -225,7 +225,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
groupname = k->parse_value();
- if (0 != getgrnam(groupname.c_str()))
+ if (nullptr != getgrnam(groupname.c_str()))
throw ActionFailedError("Group '" + groupname + "' already exists");
} while (false);
diff --git a/paludis/repositories/e/a_finder.cc b/paludis/repositories/e/a_finder.cc
index 24611f9..9ecaa06 100644
--- a/paludis/repositories/e/a_finder.cc
+++ b/paludis/repositories/e/a_finder.cc
@@ -28,7 +28,7 @@ AFinder::AFinder(const Environment * const e, const std::shared_ptr<const Packag
env(e),
id(i)
{
- _labels.push_back(0);
+ _labels.push_back(nullptr);
}
void
diff --git a/paludis/repositories/e/ebuild/utils/print_exports.cc b/paludis/repositories/e/ebuild/utils/print_exports.cc
index a75bd2e..b51524a 100644
--- a/paludis/repositories/e/ebuild/utils/print_exports.cc
+++ b/paludis/repositories/e/ebuild/utils/print_exports.cc
@@ -25,7 +25,7 @@ extern char ** environ;
int
main()
{
- for (char ** it = environ; 0 != *it; ++it)
+ for (char ** it = environ; nullptr != *it; ++it)
{
std::string str(*it);
std::cout << "export " << str.substr(0, str.find('=')) << std::endl;
diff --git a/paludis/repositories/e/eclass_mtimes.cc b/paludis/repositories/e/eclass_mtimes.cc
index 2ce163f..6955171 100644
--- a/paludis/repositories/e/eclass_mtimes.cc
+++ b/paludis/repositories/e/eclass_mtimes.cc
@@ -64,7 +64,7 @@ namespace
return & c.files.insert(std::make_pair(e, std::make_pair(f.realpath(), f.stat()))).first->second;
}
- return 0;
+ return nullptr;
}
}
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 81116a4..31b4e0e 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -113,7 +113,7 @@ ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepo
make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
n::environment_variable_interface() = this,
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(p)
{
diff --git a/paludis/repositories/e/xml_things_handle.cc b/paludis/repositories/e/xml_things_handle.cc
index 983495a..4c5a9a7 100644
--- a/paludis/repositories/e/xml_things_handle.cc
+++ b/paludis/repositories/e/xml_things_handle.cc
@@ -55,12 +55,12 @@ namespace paludis
CleanupPtr cleanup;
Imp() :
- paludis_handle(0),
- handle(0),
- create_glsa_from_xml_file(0),
- create_metadata_xml_from_xml_file(0),
- init(0),
- cleanup(0)
+ paludis_handle(nullptr),
+ handle(nullptr),
+ create_glsa_from_xml_file(nullptr),
+ create_metadata_xml_from_xml_file(nullptr),
+ init(nullptr),
+ cleanup(nullptr)
{
#if ENABLE_XML
if (! getenv_with_default(env_vars::no_xml, "").empty())
@@ -134,7 +134,7 @@ XMLThingsHandle::XMLThingsHandle() :
XMLThingsHandle::~XMLThingsHandle()
{
- if (0 != _imp->cleanup)
+ if (nullptr != _imp->cleanup)
_imp->cleanup();
// don't dlclose, gcc does something dumb on cleanup
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 1c78534..6768977 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -51,9 +51,9 @@ namespace paludis
FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
FakeRepositoryBase(params.environment(), params.name(), make_named_values<RepositoryCapabilities>(
- n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(nullptr),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp()
{
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.cc b/paludis/repositories/gemcutter/gemcutter_repository.cc
index 6540fdb..9585b83 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.cc
+++ b/paludis/repositories/gemcutter/gemcutter_repository.cc
@@ -83,9 +83,9 @@ GemcutterRepository::GemcutterRepository(const GemcutterRepositoryParams & p) :
p.environment(),
p.name(),
make_named_values<RepositoryCapabilities>(
- n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(nullptr),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/gemcutter/json_things_handle.cc b/paludis/repositories/gemcutter/json_things_handle.cc
index 5019268..e733830 100644
--- a/paludis/repositories/gemcutter/json_things_handle.cc
+++ b/paludis/repositories/gemcutter/json_things_handle.cc
@@ -35,8 +35,8 @@ using namespace paludis;
using namespace paludis::gemcutter_repository;
JSONThingsHandle::JSONThingsHandle() :
- handle(0),
- parse_all_gems_function(0)
+ handle(nullptr),
+ parse_all_gems_function(nullptr)
{
handle = ::dlopen(("libpaludisgemcutterrepositoryjsonthings_" + stringify(PALUDIS_PC_SLOT) + ".so").c_str(), RTLD_NOW | RTLD_GLOBAL);
if (! handle)
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 299888e..d510b59 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -93,8 +93,8 @@ RepositoryRepository::RepositoryRepository(const RepositoryRepositoryParams & p)
p.name(),
make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(this),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 5be25fd..e729ad3 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -101,9 +101,9 @@ UnavailableRepository::UnavailableRepository(const UnavailableRepositoryParams &
p.environment(),
p.name(),
make_named_values<RepositoryCapabilities>(
- n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(nullptr),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 80bc449..b0ea4ad 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -96,8 +96,8 @@ InstalledUnpackagedRepository::InstalledUnpackagedRepository(
const RepositoryName & n, const InstalledUnpackagedRepositoryParams & p) :
Repository(p.environment(), n, make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(p)
{
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index e656f21..00d2853 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -94,9 +94,9 @@ namespace paludis
UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
const UnpackagedRepositoryParams & params) :
Repository(params.environment(), n, make_named_values<RepositoryCapabilities>(
- n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(nullptr),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(n, params)
{
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 43717db..c3ad678 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -95,9 +95,9 @@ UnwrittenRepository::UnwrittenRepository(const UnwrittenRepositoryParams & p) :
p.environment(),
p.name(),
make_named_values<RepositoryCapabilities>(
- n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
- n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
+ n::destination_interface() = static_cast<RepositoryDestinationInterface *>(nullptr),
+ n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(nullptr),
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(nullptr)
)),
_imp(this, p)
{
diff --git a/paludis/repository_factory.cc b/paludis/repository_factory.cc
index 6e5db6c..d800408 100644
--- a/paludis/repository_factory.cc
+++ b/paludis/repository_factory.cc
@@ -115,15 +115,15 @@ RepositoryFactory::RepositoryFactory() :
{
using namespace repository_groups;
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_accounts>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_dummy>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_e>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_fake>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_gemcutter>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_repository>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unavailable>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unwritten>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unpackaged>::Type *>(0), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_accounts>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_dummy>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_e>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_fake>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_gemcutter>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_repository>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unavailable>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unwritten>::Type *>(nullptr), this);
+ register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unpackaged>::Type *>(nullptr), this);
}
RepositoryFactory::~RepositoryFactory()
diff --git a/paludis/resolver/decisions.hh b/paludis/resolver/decisions.hh
index 55eddc8..79fd215 100644
--- a/paludis/resolver/decisions.hh
+++ b/paludis/resolver/decisions.hh
@@ -60,7 +60,7 @@ namespace paludis
void push_back(
const std::shared_ptr<const Decision_> &,
- const Notes_ & = static_cast<NoType<0u> *>(0));
+ const Notes_ & = static_cast<NoType<0u> *>(nullptr));
typedef DecisionsConstIteratorTag<Decision_, Notes_> ConstIteratorTag;
typedef WrappedForwardIterator<ConstIteratorTag,
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index a42c05d..24329f1 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -66,7 +66,7 @@ TEST(SetFile, Simple)
TestEnvironment env;
SetFile f(make_named_values<SetFileParams>(
- n::environment() = static_cast<Environment *>(0),
+ n::environment() = static_cast<Environment *>(nullptr),
n::file_name() = FSPath("set_file_TEST_dir/simple1"),
n::parser() = std::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All()),
n::set_operator_mode() = sfsmo_natural,
@@ -122,7 +122,7 @@ TEST(SetFile, PaludisConf)
TestEnvironment env;
SetFile f(make_named_values<SetFileParams>(
- n::environment() = static_cast<Environment *>(0),
+ n::environment() = static_cast<Environment *>(nullptr),
n::file_name() = FSPath("set_file_TEST_dir/paludisconf1"),
n::parser() = std::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All()),
n::set_operator_mode() = sfsmo_natural,
@@ -181,7 +181,7 @@ TEST(SetFile, Overrides)
TestEnvironment env;
SetFile f(make_named_values<SetFileParams>(
- n::environment() = static_cast<Environment *>(0),
+ n::environment() = static_cast<Environment *>(nullptr),
n::file_name() = FSPath("set_file_TEST_dir/override"),
n::parser() = std::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All()),
n::set_operator_mode() = sfsmo_natural,
@@ -195,7 +195,7 @@ TEST(SetFile, Overrides)
}
SetFile fstar(make_named_values<SetFileParams>(
- n::environment() = static_cast<Environment *>(0),
+ n::environment() = static_cast<Environment *>(nullptr),
n::file_name() = FSPath("set_file_TEST_dir/override"),
n::parser() = std::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All()),
n::set_operator_mode() = sfsmo_star,
diff --git a/paludis/stripper.cc b/paludis/stripper.cc
index 0c5084b..4038c0a 100644
--- a/paludis/stripper.cc
+++ b/paludis/stripper.cc
@@ -67,10 +67,10 @@ namespace
CleanupPtr cleanup;
StripperHandle() :
- handle(0),
- init(0),
- lookup(0),
- cleanup(0)
+ handle(nullptr),
+ init(nullptr),
+ lookup(nullptr),
+ cleanup(nullptr)
{
#ifndef ENABLE_STRIPPER
Log::get_instance()->message("strip.unsupported", ll_warning, lc_context)
@@ -103,7 +103,7 @@ namespace
if (handle)
::dlclose(handle);
- handle = 0;
+ handle = nullptr;
}
#endif
}
@@ -127,7 +127,7 @@ namespace paludis
Imp(const StripperOptions & o) :
options(o),
- stripper_extras(0)
+ stripper_extras(nullptr)
{
try
{
@@ -138,7 +138,7 @@ namespace paludis
{
Log::get_instance()->message("strip.broken", ll_warning, lc_context)
<< "Got error '" << e.message() << "' (" << e.what() << ") when attempting to strip";
- stripper_extras = 0;
+ stripper_extras = nullptr;
}
}
diff --git a/paludis/stripper_extras.cc b/paludis/stripper_extras.cc
index 6ffc45b..dad01e6 100644
--- a/paludis/stripper_extras.cc
+++ b/paludis/stripper_extras.cc
@@ -40,7 +40,7 @@ paludis_stripper_extras_init()
if (! extras->magic)
throw StripperError("magic_open returned null");
- if (-1 == magic_load(extras->magic, NULL))
+ if (-1 == magic_load(extras->magic, nullptr))
throw StripperError("magic_load returned error");
return extras;
diff --git a/paludis/tar_extras.cc b/paludis/tar_extras.cc
index 5917ac9..6e459d6 100644
--- a/paludis/tar_extras.cc
+++ b/paludis/tar_extras.cc
@@ -57,7 +57,7 @@ paludis_tar_extras_init(const std::string & f, const std::string & compress)
extras->linkresolver = archive_entry_linkresolver_new();
- if (extras->linkresolver == NULL)
+ if (extras->linkresolver == nullptr)
throw MergerError("archive_entry_linkresolver_new failed");
archive_entry_linkresolver_set_strategy(extras->linkresolver, archive_format(extras->archive));
@@ -81,7 +81,7 @@ paludis_tar_extras_add_file(PaludisTarExtras * const extras, const std::string &
int fd(open(from.c_str(), O_RDONLY));
archive_entry_copy_pathname(entry, path.c_str());
- if (ARCHIVE_OK != archive_read_disk_entry_from_file(disk_archive, entry, fd, 0))
+ if (ARCHIVE_OK != archive_read_disk_entry_from_file(disk_archive, entry, fd, nullptr))
throw MergerError("archive_read_disk_entry_from_file failed");
archive_entry_linkify(extras->linkresolver, &entry, &sparse);
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index e75d19e..43099c5 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -940,7 +940,7 @@ namespace
const MetadataKey * const visit(const UserMask &) const
{
- return 0;
+ return nullptr;
}
const MetadataKey * const visit(const UnacceptedMask & m) const
@@ -949,17 +949,17 @@ namespace
if (k != id->end_metadata())
return &**k;
else
- return 0;
+ return nullptr;
}
const MetadataKey * const visit(const RepositoryMask &) const
{
- return 0;
+ return nullptr;
}
const MetadataKey * const visit(const UnsupportedMask &) const
{
- return 0;
+ return nullptr;
}
};
@@ -999,8 +999,8 @@ UserKeyRequirement::requirement_met(
{
Context context("When working out whether '" + stringify(*id) + "' matches " + as_raw_string() + ":");
- const MetadataKey * key(0);
- const Mask * mask(0);
+ const MetadataKey * key(nullptr);
+ const Mask * mask(nullptr);
auto repo(env->fetch_repository(id->repository_name()));
if (0 == _imp->key.compare(0, 3, "::$"))
diff --git a/paludis/util/process.cc b/paludis/util/process.cc
index 22f8cb5..833a238 100644
--- a/paludis/util/process.cc
+++ b/paludis/util/process.cc
@@ -117,7 +117,7 @@ ProcessCommand::exec()
s.append(" ");
s.append(_imp->args_string);
- execl("/bin/sh", "sh", "-c", s.c_str(), static_cast<char *>(0));
+ execl("/bin/sh", "sh", "-c", s.c_str(), static_cast<char *>(nullptr));
throw ProcessError("execl failed");
}
@@ -130,7 +130,7 @@ ProcessCommand::exec()
* call _exit() shortly afterwards */
char ** argv(new char * [_imp->args.size() + 1]);
- argv[_imp->args.size()] = 0;
+ argv[_imp->args.size()] = nullptr;
for (auto v_begin(_imp->args.begin()), v(v_begin), v_end(_imp->args.end()) ;
v != v_end ; ++v)
{
@@ -198,10 +198,10 @@ namespace paludis
RunningProcessThread() :
ctl_pipe(true),
- capture_stdout(0),
- capture_stderr(0),
- capture_output_to_fd(0),
- send_input_to_fd(0),
+ capture_stdout(nullptr),
+ capture_stderr(nullptr),
+ capture_output_to_fd(nullptr),
+ send_input_to_fd(nullptr),
as_main_process(false)
{
}
@@ -272,7 +272,7 @@ RunningProcessThread::thread_func()
max_fd = std::max(max_fd, pipe_command_handler_command_pipe->read_fd());
}
- int retval(::pselect(max_fd + 1, &read_fds, &write_fds, 0, 0, 0));
+ int retval(::pselect(max_fd + 1, &read_fds, &write_fds, nullptr, nullptr, nullptr));
if (-1 == retval)
throw ProcessError("pselect() failed");
@@ -355,7 +355,7 @@ RunningProcessThread::thread_func()
if (0 != ::close(send_input_to_fd_pipe->write_fd()))
throw ProcessError("close() send_input_to_fd_pipe write_fd failed");
send_input_to_fd_pipe->clear_write_fd();
- send_input_to_fd = 0;
+ send_input_to_fd = nullptr;
want_to_finish = true;
}
@@ -528,17 +528,17 @@ namespace paludis
command(std::move(c)),
need_thread(false),
use_ptys(false),
- capture_stdout(0),
- capture_stderr(0),
- capture_output_to_fd_stream(0),
+ capture_stdout(nullptr),
+ capture_stderr(nullptr),
+ capture_output_to_fd_stream(nullptr),
capture_output_to_fd_fd(-1),
- send_input_to_fd_stream(0),
+ send_input_to_fd_stream(nullptr),
send_input_to_fd_fd(-1),
set_stdin_fd(-1),
clearenv(false),
setuid(getuid()),
setgid(getgid()),
- echo_command_to(0),
+ echo_command_to(nullptr),
extra_newlines_if_any_output_exists(false),
as_main_process(false)
{
@@ -639,7 +639,7 @@ Process::run()
sigemptyset(&intandterm);
sigaddset(&intandterm, SIGINT);
sigaddset(&intandterm, SIGTERM);
- if (0 != pthread_sigmask(SIG_BLOCK, &intandterm, 0))
+ if (0 != pthread_sigmask(SIG_BLOCK, &intandterm, nullptr))
throw ProcessError("pthread_sigmask failed");
pid_t child(fork());
@@ -661,15 +661,15 @@ Process::run()
sigemptyset(&act.sa_mask);
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
- sigaction(SIGINT, &act, 0);
- sigaction(SIGTERM, &act, 0);
- if (0 != pthread_sigmask(SIG_UNBLOCK, &intandterm, 0))
+ sigaction(SIGINT, &act, nullptr);
+ sigaction(SIGTERM, &act, nullptr);
+ if (0 != pthread_sigmask(SIG_UNBLOCK, &intandterm, nullptr))
throw ProcessError("pthread_sigmask failed");
if (_imp->clearenv)
{
std::map<std::string, std::string> setenvs;
- for (const char * const * it(environ) ; 0 != *it ; ++it)
+ for (const char * const * it(environ) ; nullptr != *it ; ++it)
{
std::string var(*it);
if (std::string::npos != var.find('=') &&
@@ -768,8 +768,8 @@ Process::run()
std::unique_ptr<char []> buf(new char[buflen]);
struct passwd pw;
- struct passwd * pw_result(0);
- if (0 != getpwuid_r(_imp->setuid, &pw, buf.get(), buflen, &pw_result) || 0 == pw_result)
+ struct passwd * pw_result(nullptr);
+ if (0 != getpwuid_r(_imp->setuid, &pw, buf.get(), buflen, &pw_result) || nullptr == pw_result)
throw ProcessError("getpwuid_r() failed");
if (0 != ::initgroups(pw_result->pw_name, getgid()))
@@ -797,7 +797,7 @@ Process::run()
sigemptyset(&act.sa_mask);
act.sa_handler = SIG_IGN;
act.sa_flags = 0;
- sigaction(SIGCLD, &act, 0);
+ sigaction(SIGCLD, &act, nullptr);
pid_t p(fork());
if (-1 == p)
@@ -807,7 +807,7 @@ Process::run()
}
/* Restore SIGINT and SIGTERM handling */
- if (0 != pthread_sigmask(SIG_UNBLOCK, &intandterm, 0))
+ if (0 != pthread_sigmask(SIG_UNBLOCK, &intandterm, nullptr))
throw ProcessError("pthread_sigmask failed");
if (thread)
diff --git a/paludis/util/singleton_TEST.cc b/paludis/util/singleton_TEST.cc
index d6bea14..25146e2 100644
--- a/paludis/util/singleton_TEST.cc
+++ b/paludis/util/singleton_TEST.cc
@@ -121,7 +121,7 @@ namespace
TEST(Singleton, Works)
{
ASSERT_EQ(0, MyClass::instances);
- ASSERT_TRUE(0 != MyClass::get_instance());
+ ASSERT_TRUE(nullptr != MyClass::get_instance());
ASSERT_EQ(1, MyClass::instances);
ASSERT_TRUE(MyClass::get_instance() == MyClass::get_instance());
ASSERT_TRUE(MyClass::get_instance()->s.empty());
@@ -134,23 +134,23 @@ TEST(Singleton, Threaded)
using namespace std::placeholders;
const int c = 100;
- std::vector<void *> a(c, static_cast<void *>(0));
+ std::vector<void *> a(c, static_cast<void *>(nullptr));
ASSERT_EQ(0, MyThreadedClass::instances);
- ASSERT_TRUE(c == std::count(a.begin(), a.end(), static_cast<void *>(0)));
+ ASSERT_TRUE(c == std::count(a.begin(), a.end(), static_cast<void *>(nullptr)));
{
ThreadPool p;
for (int x(0) ; x < c ; ++x)
p.create_thread(std::bind(&thread_func, &a[x]));
}
ASSERT_EQ(1, MyThreadedClass::instances);
- ASSERT_TRUE(0 == std::count(a.begin(), a.end(), static_cast<void *>(0)));
+ ASSERT_TRUE(0 == std::count(a.begin(), a.end(), static_cast<void *>(nullptr)));
ASSERT_TRUE(c == std::count(a.begin(), a.end(), MyThreadedClass::get_instance()));
}
TEST(Singleton, Delete)
{
ASSERT_EQ(0, MyClassTwo::instances);
- ASSERT_TRUE(0 != MyClassTwo::get_instance());
+ ASSERT_TRUE(nullptr != MyClassTwo::get_instance());
ASSERT_EQ(1, MyClassTwo::instances);
ASSERT_TRUE(MyClassTwo::get_instance() == MyClassTwo::get_instance());
ASSERT_TRUE(MyClassTwo::get_instance()->s.empty());
@@ -158,7 +158,7 @@ TEST(Singleton, Delete)
ASSERT_EQ("foo", MyClassTwo::get_instance()->s);
MyClassTwo::destroy_instance();
ASSERT_EQ(MyClassTwo::instances, 0);
- ASSERT_TRUE(0 != MyClassTwo::get_instance());
+ ASSERT_TRUE(nullptr != MyClassTwo::get_instance());
ASSERT_EQ(1, MyClassTwo::instances);
ASSERT_TRUE(MyClassTwo::get_instance()->s.empty());
}
diff --git a/paludis/util/string_list_stream.cc b/paludis/util/string_list_stream.cc
index baa3300..a42f3dc 100644
--- a/paludis/util/string_list_stream.cc
+++ b/paludis/util/string_list_stream.cc
@@ -49,7 +49,7 @@ namespace paludis
StringListStreamBuf::StringListStreamBuf() :
_imp()
{
- setg(0, 0, 0);
+ setg(nullptr, nullptr, nullptr);
}
StringListStreamBuf::~StringListStreamBuf()
diff --git a/paludis/util/tribool.cc b/paludis/util/tribool.cc
index b1bcf16..4c2f876 100644
--- a/paludis/util/tribool.cc
+++ b/paludis/util/tribool.cc
@@ -62,7 +62,7 @@ Tribool::is_indeterminate() const
NoType<0u> *
paludis::indeterminate(const NoType<0u> * const)
{
- return 0;
+ return nullptr;
}
std::ostream &
diff --git a/paludis/util/wildcard_expander.cc b/paludis/util/wildcard_expander.cc
index 2870bb0..175a292 100644
--- a/paludis/util/wildcard_expander.cc
+++ b/paludis/util/wildcard_expander.cc
@@ -84,7 +84,7 @@ namespace
Glob::Glob(const std::string & pattern, int flags)
{
- int ret(glob(pattern.c_str(), flags, 0, &g));
+ int ret(glob(pattern.c_str(), flags, nullptr, &g));
switch (ret)
{
case 0:
diff --git a/paludis/util/wrapped_value.hh b/paludis/util/wrapped_value.hh
index aa2c736..46344fc 100644
--- a/paludis/util/wrapped_value.hh
+++ b/paludis/util/wrapped_value.hh
@@ -49,7 +49,7 @@ namespace paludis
public:
explicit WrappedValue(
const typename WrappedValueTraits<Tag_>::UnderlyingType &,
- const typename WrappedValueDevoid<typename WrappedValueTraits<Tag_>::ValidationParamsType>::Type & = static_cast<NoType<0u> *>(0)
+ const typename WrappedValueDevoid<typename WrappedValueTraits<Tag_>::ValidationParamsType>::Type & = static_cast<NoType<0u> *>(nullptr)
);
WrappedValue & operator= (const WrappedValue &);
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 9fc1d94..6fbc6a1 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -1290,7 +1290,7 @@ namespace
else if (initial_state.done)
{
want = false;
- already_done_action(env, "succeeded", job, counts, 0, 0);
+ already_done_action(env, "succeeded", job, counts, nullptr, nullptr);
}
}
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index 7c13290..60b08bb 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -73,8 +73,8 @@ namespace
MatchFunction match_function;
ExtrasHandle() :
- handle(0),
- match_function(0)
+ handle(nullptr),
+ match_function(nullptr)
{
handle = ::dlopen(("libcavematchextras_" + stringify(PALUDIS_PC_SLOT) + ".so").c_str(), RTLD_NOW | RTLD_GLOBAL);
if (! handle)
@@ -123,9 +123,9 @@ namespace
bool match_text(const std::string & text, const std::string & pattern, bool case_sensitive)
{
if (case_sensitive)
- return 0 != strstr(text.c_str(), pattern.c_str());
+ return nullptr != strstr(text.c_str(), pattern.c_str());
else
- return 0 != strcasestr(text.c_str(), pattern.c_str());
+ return nullptr != strcasestr(text.c_str(), pattern.c_str());
}
bool match_exact(const std::string & text, const std::string & pattern, bool case_sensitive)
diff --git a/src/clients/cave/cmd_print_id_environment_variable.cc b/src/clients/cave/cmd_print_id_environment_variable.cc
index 487b9d6..ae1bea6 100644
--- a/src/clients/cave/cmd_print_id_environment_variable.cc
+++ b/src/clients/cave/cmd_print_id_environment_variable.cc
@@ -99,7 +99,7 @@ namespace
{
auto repo(env->fetch_repository(id->repository_name()));
- if (0 != repo->environment_variable_interface())
+ if (nullptr != repo->environment_variable_interface())
{
std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('n', n);
diff --git a/src/clients/cave/search_extras.cc b/src/clients/cave/search_extras.cc
index 96f3c43..68957df 100644
--- a/src/clients/cave/search_extras.cc
+++ b/src/clients/cave/search_extras.cc
@@ -36,7 +36,7 @@ cave_search_extras_create_db(const std::string & file)
{
auto data(cave_search_extras_open_db(file));
- if (SQLITE_OK != sqlite3_exec(data->db, "drop table if exists candidates", 0, 0, 0))
+ if (SQLITE_OK != sqlite3_exec(data->db, "drop table if exists candidates", nullptr, nullptr, nullptr))
throw InternalError(PALUDIS_HERE, "sqlite3_exec drop candidates failed");
if (SQLITE_OK != sqlite3_exec(data->db, "create table candidates ( "
@@ -47,13 +47,13 @@ cave_search_extras_create_db(const std::string & file)
"name text not null, "
"short_desc text not null, "
"long_desc text not null"
- ")", 0, 0, 0))
+ ")", nullptr, nullptr, nullptr))
throw InternalError(PALUDIS_HERE, "sqlite3_exec create candidates failed");
if (SQLITE_OK != sqlite3_prepare_v2(data->db, "insert into candidates "
"( spec, is_visible, is_best, is_best_visible, name, short_desc, long_desc ) "
"values ( ?1, ?2, ?3, ?4, ?5, ?6, ?7 )",
- -1, &data->add_candidate, 0))
+ -1, &data->add_candidate, nullptr))
throw InternalError(PALUDIS_HERE, "sqlite3_prepare_v2 insert into candidates failed");
return data;
@@ -66,7 +66,7 @@ cave_search_extras_open_db(const std::string & file)
if (SQLITE_OK != sqlite3_open(file.c_str(), &data->db))
throw InternalError(PALUDIS_HERE, "sqlite3_open failed");
- data->add_candidate = 0;
+ data->add_candidate = nullptr;
return data;
}
@@ -123,7 +123,7 @@ extern "C"
void
cave_search_extras_starting_adds(CaveSearchExtrasDB * const data)
{
- if (SQLITE_OK != sqlite3_exec(data->db, "begin", 0, 0, 0))
+ if (SQLITE_OK != sqlite3_exec(data->db, "begin", nullptr, nullptr, nullptr))
throw InternalError(PALUDIS_HERE, "sqlite3_exec begin failed");
}
@@ -131,7 +131,7 @@ extern "C"
void
cave_search_extras_done_adds(CaveSearchExtrasDB * const data)
{
- if (SQLITE_OK != sqlite3_exec(data->db, "commit", 0, 0, 0))
+ if (SQLITE_OK != sqlite3_exec(data->db, "commit", nullptr, nullptr, nullptr))
throw InternalError(PALUDIS_HERE, "sqlite3_exec commit failed");
}
@@ -176,7 +176,7 @@ cave_search_extras_find_candidates(CaveSearchExtrasDB * const data,
}
int code;
- if (SQLITE_OK != ((code = sqlite3_prepare_v2(data->db, ("select spec from candidates where " + s + " = 1" + h).c_str(), -1, &find_candidates, 0))))
+ if (SQLITE_OK != ((code = sqlite3_prepare_v2(data->db, ("select spec from candidates where " + s + " = 1" + h).c_str(), -1, &find_candidates, nullptr))))
throw InternalError(PALUDIS_HERE, "sqlite3_prepare_v2 select from candidates failed:" + stringify(code));
if (! p1.empty())
diff --git a/src/clients/cave/search_extras_handle.cc b/src/clients/cave/search_extras_handle.cc
index 95c06ba..7cbf664 100644
--- a/src/clients/cave/search_extras_handle.cc
+++ b/src/clients/cave/search_extras_handle.cc
@@ -38,14 +38,14 @@ using namespace paludis;
using namespace cave;
SearchExtrasHandle::SearchExtrasHandle() :
- handle(0),
- create_db_function(0),
- open_db_function(0),
- cleanup_db_function(0),
- starting_adds_function(0),
- add_candidate_function(0),
- done_adds_function(0),
- find_candidates_function(0)
+ handle(nullptr),
+ create_db_function(nullptr),
+ open_db_function(nullptr),
+ cleanup_db_function(nullptr),
+ starting_adds_function(nullptr),
+ add_candidate_function(nullptr),
+ done_adds_function(nullptr),
+ find_candidates_function(nullptr)
{
#ifndef ENABLE_SEARCH_INDEX
throw NotAvailableError("cave was built without support for search indexes");