diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-10-25 00:31:02 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2011-10-25 00:31:02 (GMT) |
commit | e575aaaad8523d9117d6893a7c9bffe16791f7c1 (patch) | |
tree | 213bd2cb9c7939ec90d73b729bc0e89d8f167eb7 /src | |
parent | 6b495672dbd0629beb5f1ec6cf2ca7cbaf087bb9 (diff) | |
parent | 8aa762d4d5da7e267094cfc35589c2d7f179bb63 (diff) |
Merge remote branch 'upstream/visitortests' into visitortests
Diffstat (limited to 'src')
-rw-r--r-- | src/CSGTermEvaluator.h | 1 | ||||
-rw-r--r-- | src/expr.cc | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/CSGTermEvaluator.h b/src/CSGTermEvaluator.h index cca6c91..3a8122b 100644 --- a/src/CSGTermEvaluator.h +++ b/src/CSGTermEvaluator.h @@ -4,6 +4,7 @@ #include <map> #include <list> #include <vector> +#include <cstddef> #include "visitor.h" class CSGTermEvaluator : public Visitor diff --git a/src/expr.cc b/src/expr.cc index c9eda4e..fc1fbf0 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -75,9 +75,7 @@ Value Expression::evaluate(const Context *context) const return this->children[0]->evaluate(context) > this->children[1]->evaluate(context); if (this->type == "?:") { Value v = this->children[0]->evaluate(context); - if (v.type == Value::BOOL) - return this->children[v.b ? 1 : 2]->evaluate(context); - return Value(); + return this->children[v.toBool() ? 1 : 2]->evaluate(context); } if (this->type == "[]") { Value v1 = this->children[0]->evaluate(context); |