diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/utili_Expression.h | 1 | ||||
-rw-r--r-- | src/util/Expression.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/include/utili_Expression.h b/src/include/utili_Expression.h index b501ebad..148151a3 100644 --- a/src/include/utili_Expression.h +++ b/src/include/utili_Expression.h @@ -30,6 +30,7 @@ typedef enum {OP_NONE, OP_DIV, OP_TIMES, OP_POWER, + OP_NOT, OP_ACOS, OP_ASIN, OP_ATAN, diff --git a/src/util/Expression.c b/src/util/Expression.c index 9b6156ef..a9728878 100644 --- a/src/util/Expression.c +++ b/src/util/Expression.c @@ -109,6 +109,7 @@ static struct {"*", binary, 4,OP_TIMES}, {"^", binary, 5,OP_POWER}, /* Unary Operators - these must have the highest precedence. */ + {"!", unary, 6, OP_NOT}, {"acos", unary, 6, OP_ACOS}, {"asin", unary, 6, OP_ASIN}, {"atan", unary, 6, OP_ATAN}, @@ -998,6 +999,9 @@ static int EvaluateUnary(uExpressionValue *retval, #define EVALUATEUNARY(retval, val) \ switch(opcode) \ { \ + case OP_NOT : \ + (retval) = !(val); \ + break; \ case OP_ACOS : \ (retval) = acos(val); \ break; \ |