From 682544ef17cdf96cde684d5601c6145132624f22 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 7 Feb 2009 04:27:04 -0400 Subject: Refer to empty expression operators as simply NULL. --- src/account.cc | 2 +- src/item.cc | 2 +- src/op.cc | 3 +-- src/op.h | 4 ++-- src/scope.h | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/account.cc b/src/account.cc index fd1bf2e5..109089fc 100644 --- a/src/account.cc +++ b/src/account.cc @@ -217,7 +217,7 @@ expr_t::ptr_op_t account_t::lookup(const string& name) break; } - return expr_t::ptr_op_t(); + return NULL; } bool account_t::valid() const diff --git a/src/item.cc b/src/item.cc index 6be3bae3..4af37e89 100644 --- a/src/item.cc +++ b/src/item.cc @@ -309,7 +309,7 @@ expr_t::ptr_op_t item_t::lookup(const string& name) break; } - return expr_t::ptr_op_t(); + return NULL; } bool item_t::valid() const diff --git a/src/op.cc b/src/op.cc index e989f365..7f44ac16 100644 --- a/src/op.cc +++ b/src/op.cc @@ -60,8 +60,7 @@ expr_t::ptr_op_t expr_t::op_t::compile(scope_t& scope) ptr_op_t lhs(left()->compile(scope)); ptr_op_t rhs(kind > UNARY_OPERATORS && has_right() ? - (kind == O_LOOKUP ? right() : right()->compile(scope)) : - ptr_op_t()); + (kind == O_LOOKUP ? right() : right()->compile(scope)) : NULL); if (lhs == left() && (! rhs || rhs == right())) return this; diff --git a/src/op.h b/src/op.h index 1c6b246e..b7ae9430 100644 --- a/src/op.h +++ b/src/op.h @@ -287,8 +287,8 @@ public: ostream_pos_type * end_pos; bool relaxed; - context_t(const ptr_op_t& _expr_op = ptr_op_t(), - const ptr_op_t& _op_to_find = ptr_op_t(), + context_t(const ptr_op_t& _expr_op = NULL, + const ptr_op_t& _op_to_find = NULL, ostream_pos_type * const _start_pos = NULL, ostream_pos_type * const _end_pos = NULL, const bool _relaxed = true) diff --git a/src/scope.h b/src/scope.h index 3d1e5108..35b5332e 100644 --- a/src/scope.h +++ b/src/scope.h @@ -101,7 +101,7 @@ public: virtual expr_t::ptr_op_t lookup(const string& name) { if (parent) return parent->lookup(name); - return expr_t::ptr_op_t(); + return NULL; } }; -- cgit v1.2.3