X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2FSGExpression.hxx;h=05fc8336f9fd1f7b8c5e6b02b9dbf0c75757d331;hb=4e46bb667179cd45cfb2f9934734ceddd1ea01b4;hp=2dac8efb1863c105bfd78b045af4289180df6c06;hpb=efec9070e178c9aef98332cb03d967868179ae4a;p=simgear.git diff --git a/simgear/structure/SGExpression.hxx b/simgear/structure/SGExpression.hxx index 2dac8efb..05fc8336 100644 --- a/simgear/structure/SGExpression.hxx +++ b/simgear/structure/SGExpression.hxx @@ -31,6 +31,7 @@ #include #include #include +#include /// Expression tree implementation. @@ -1009,10 +1010,16 @@ namespace simgear class ExpressionParser : public Parser { public: - ParserMap& getParserMap() { return _parserTable; } + ParserMap& getParserMap() + { + return ParserMapSingleton::instance()->_parserTable; + } static void addExpParser(const std::string&, exp_parser); protected: - static ParserMap _parserTable; + struct ParserMapSingleton : public simgear::Singleton + { + ParserMap _parserTable; + }; }; /** @@ -1195,7 +1202,7 @@ namespace simgear void eval(bool& value, const expression::Binding* b) const { value = false; - for (int i = 0; i < getNumOperands(); ++i) { + for (int i = 0; i < (int)getNumOperands(); ++i) { value = value || getOperand(i)->getValue(b); if (value) return; @@ -1209,7 +1216,7 @@ namespace simgear void eval(bool& value, const expression::Binding* b) const { value = true; - for (int i = 0; i < getNumOperands(); ++i) { + for (int i = 0; i < (int)getNumOperands(); ++i) { value = value && getOperand(i)->getValue(b); if (!value) return;