summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-30 17:56:44 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-30 17:57:29 -0400
commit7ca80112fc817687481a40b65e4faa56a92c3ebe (patch)
treec371d1cb802795500dc9c174014b37c1058594ec /src/value.cc
parent5f2c766e0dc5405c9fa86c39a521bd48079d4b30 (diff)
downloadledger-7ca80112fc817687481a40b65e4faa56a92c3ebe.tar.gz
ledger-7ca80112fc817687481a40b65e4faa56a92c3ebe.tar.bz2
ledger-7ca80112fc817687481a40b65e4faa56a92c3ebe.zip
Change the value_t::POINTER type to value_t::SCOPE
scope_t pointers are the only kind that are ever stored in value objects, so there was no need to make it generic and use boost::any.
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/value.cc b/src/value.cc
index a6bbb2fb..a3a05b6c 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -113,8 +113,8 @@ value_t::operator bool() const
}
}
return false;
- case POINTER:
- return ! as_any_pointer().empty();
+ case SCOPE:
+ return as_scope() != NULL;
default:
break;
}
@@ -1206,8 +1206,8 @@ bool value_t::is_realzero() const
case SEQUENCE:
return as_sequence().empty();
- case POINTER:
- return as_any_pointer().empty();
+ case SCOPE:
+ return as_scope() == NULL;
default:
throw_(value_error, _("Cannot determine if %1 is really zero") << label());
@@ -1235,8 +1235,8 @@ bool value_t::is_zero() const
case SEQUENCE:
return as_sequence().empty();
- case POINTER:
- return as_any_pointer().empty();
+ case SCOPE:
+ return as_scope() == NULL;
default:
throw_(value_error, _("Cannot determine if %1 is zero") << label());
@@ -1474,7 +1474,7 @@ value_t value_t::strip_annotations(const keep_details_t& what_to_keep) const
case DATE:
case STRING:
case MASK:
- case POINTER:
+ case SCOPE:
return *this;
case SEQUENCE: {
@@ -1579,8 +1579,8 @@ void value_t::print(std::ostream& out,
break;
}
- case POINTER:
- out << "<POINTER>";
+ case SCOPE:
+ out << "<SCOPE>";
break;
default:
@@ -1647,8 +1647,8 @@ void value_t::dump(std::ostream& out, const bool relaxed) const
out << '/' << as_mask() << '/';
break;
- case POINTER:
- out << boost::unsafe_any_cast<const void *>(&as_any_pointer());
+ case SCOPE:
+ out << as_scope();
break;
case SEQUENCE: {