aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-28 07:48:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-04-30 14:44:32 +0200
commit771f4176ad578e1967e0407c31cefaf1c38081aa (patch)
treec536cb2460d594a82ca1c0511dac9dc01f17660f
parent9498585efc6e92eabca596d2ecbb78ffb343bca2 (diff)
Rename target::member to target::adhoc_member
-rw-r--r--libbuild2/algorithm.cxx14
-rw-r--r--libbuild2/algorithm.ixx8
-rw-r--r--libbuild2/cc/common.cxx2
-rw-r--r--libbuild2/cc/msvc.cxx2
-rw-r--r--libbuild2/install/rule.cxx8
-rw-r--r--libbuild2/parser.cxx4
-rw-r--r--libbuild2/target.hxx10
-rw-r--r--libbuild2/target.ixx12
8 files changed, 34 insertions, 26 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index 4e47c63..ef1a78d 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -291,8 +291,8 @@ namespace build2
{
tracer trace ("add_adhoc_member");
- const_ptr<target>* mp (&t.member);
- for (; *mp != nullptr && !(*mp)->is_a (tt); mp = &(*mp)->member) ;
+ const_ptr<target>* mp (&t.adhoc_member);
+ for (; *mp != nullptr && !(*mp)->is_a (tt); mp = &(*mp)->adhoc_member) ;
if (*mp != nullptr) // Might already be there.
return **mp;
@@ -497,7 +497,7 @@ namespace build2
// Intercept and handle matching an ad hoc group member.
//
- if (t.adhoc_member ())
+ if (t.adhoc_group_member ())
{
assert (!step);
@@ -1486,7 +1486,9 @@ namespace build2
// Then ad hoc group file/fsdir members, if any.
//
- for (const target* mt (t.member); mt != nullptr; mt = mt->member)
+ for (const target* mt (t.adhoc_member);
+ mt != nullptr;
+ mt = mt->adhoc_member)
{
const path* p (nullptr);
@@ -2194,7 +2196,9 @@ namespace build2
// Now clean the ad hoc group file members, if any.
//
- for (const target* m (ft.member); m != nullptr; m = m->member)
+ for (const target* m (ft.adhoc_member);
+ m != nullptr;
+ m = m->adhoc_member)
{
const file* mf (m->is_a<file> ());
const path* mp (mf != nullptr ? &mf->path () : nullptr);
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index c421218..7231fec 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -249,16 +249,16 @@ namespace build2
inline target*
find_adhoc_member (target& g, const target_type& tt)
{
- target* m (g.member);
- for (; m != nullptr && !m->is_a (tt); m = m->member) ;
+ target* m (g.adhoc_member);
+ for (; m != nullptr && !m->is_a (tt); m = m->adhoc_member) ;
return m;
}
inline const target*
find_adhoc_member (const target& g, const target_type& tt)
{
- const target* m (g.member);
- for (; m != nullptr && !m->is_a (tt); m = m->member) ;
+ const target* m (g.adhoc_member);
+ for (; m != nullptr && !m->is_a (tt); m = m->adhoc_member) ;
return m;
}
diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx
index cf6d546..6bd9ac3 100644
--- a/libbuild2/cc/common.cxx
+++ b/libbuild2/cc/common.cxx
@@ -673,7 +673,7 @@ namespace build2
{
if (l.owns_lock ())
{
- s->member = i; // We are first.
+ s->adhoc_member = i; // We are first.
l.unlock ();
}
else
diff --git a/libbuild2/cc/msvc.cxx b/libbuild2/cc/msvc.cxx
index 77d5330..8887555 100644
--- a/libbuild2/cc/msvc.cxx
+++ b/libbuild2/cc/msvc.cxx
@@ -585,7 +585,7 @@ namespace build2
{
if (l.owns_lock ())
{
- s->member = i; // We are first.
+ s->adhoc_member = i; // We are first.
l.unlock ();
}
else
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index 8a5d174..b8d6a34 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -978,7 +978,9 @@ namespace build2
// Then installable ad hoc group members, if any.
//
- for (const target* m (t.member); m != nullptr; m = m->member)
+ for (const target* m (t.adhoc_member);
+ m != nullptr;
+ m = m->adhoc_member)
{
if (const file* mf = m->is_a<file> ())
{
@@ -1256,7 +1258,9 @@ namespace build2
// we would have to do it in reverse, but that's not easy (it's a
// single-linked list).
//
- for (const target* m (t.member); m != nullptr; m = m->member)
+ for (const target* m (t.adhoc_member);
+ m != nullptr;
+ m = m->adhoc_member)
{
if (const file* mf = m->is_a<file> ())
{
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index a5c34d9..1432d4b 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -999,8 +999,8 @@ namespace build2
// Add as an ad hoc member at the end of the chain skipping duplicates.
//
{
- const_ptr<target>* mp (&target_->member);
- for (; *mp != nullptr; mp = &(*mp)->member)
+ const_ptr<target>* mp (&target_->adhoc_member);
+ for (; *mp != nullptr; mp = &(*mp)->adhoc_member)
{
if (*mp == &at)
{
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx
index eea43df..9975f33 100644
--- a/libbuild2/target.hxx
+++ b/libbuild2/target.hxx
@@ -231,21 +231,21 @@ namespace build2
// Use add_adhoc_member(), find_adhoc_member() from algorithms to manage
// ad hoc members.
//
- const_ptr<target> member = nullptr;
+ const_ptr<target> adhoc_member = nullptr;
bool
adhoc_group () const
{
// An ad hoc group can be a member of a normal group.
//
- return member != nullptr &&
- (group == nullptr || group->member == nullptr);
+ return adhoc_member != nullptr &&
+ (group == nullptr || group->adhoc_member == nullptr);
}
bool
- adhoc_member () const
+ adhoc_group_member () const
{
- return group != nullptr && group->member != nullptr;
+ return group != nullptr && group->adhoc_member != nullptr;
}
public:
diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx
index 4717800..bb30c9c 100644
--- a/libbuild2/target.ixx
+++ b/libbuild2/target.ixx
@@ -271,7 +271,7 @@ namespace build2
group_prerequisites (const target& t)
: t_ (t),
g_ (t_.group == nullptr ||
- t_.group->member != nullptr || // Ad hoc group member.
+ t_.group->adhoc_member != nullptr || // Ad hoc group member.
t_.group->prerequisites ().empty ()
? nullptr : t_.group)
{
@@ -345,7 +345,7 @@ namespace build2
// An ad hoc group member cannot be used as a prerequisite (use the whole
// group instead).
//
- assert (!member->adhoc_member ());
+ assert (!member->adhoc_group_member ());
return prerequisite_type (*member);
}
@@ -384,7 +384,7 @@ namespace build2
operator++ () -> iterator&
{
if (k_ != nullptr) // Iterating over an ad hoc group.
- k_ = k_->member;
+ k_ = k_->adhoc_member;
if (k_ == nullptr && g_.count != 0) // Iterating over a normal group.
{
@@ -418,7 +418,7 @@ namespace build2
? j_ != 0 ? g_.members[j_ - 1] : nullptr
: i_->target.load (memory_order_consume));
- if (t != nullptr && t->member != nullptr)
+ if (t != nullptr && t->adhoc_member != nullptr)
k_ = t; // Increment that follows will make it t->member.
else
{
@@ -447,7 +447,7 @@ namespace build2
{
// Skip until the last element (next increment will reach the end).
//
- for (; k_->member != nullptr; k_ = k_->member) ;
+ for (; k_->adhoc_member != nullptr; k_ = k_->adhoc_member) ;
}
else
{
@@ -464,7 +464,7 @@ namespace build2
group () const
{
return
- k_ != nullptr ? k_->member != nullptr : /* ad hoc */
+ k_ != nullptr ? k_->adhoc_member != nullptr : /* ad hoc */
g_.count != 0 ? g_.members != nullptr && j_ < g_.count : /* explicit */
false;
}