Skip to content

Commit

Permalink
fix msvc build
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Mar 21, 2016
1 parent 72c5abc commit 1094db6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/formula/formula.cpp
Expand Up @@ -455,9 +455,9 @@ class operator_expression : public formula_expression {
} else if(op == "./") {
op_ = DIVL;
} else if(op == "..") {
op_ = CAT;
op_ = OP_CAT;
} else if(op == "in") {
op_ = IN;
op_ = OP_IN;
}
}

Expand Down Expand Up @@ -494,9 +494,9 @@ class operator_expression : public formula_expression {
return left.list_elements_mul(right);
case DIVL:
return left.list_elements_div(right);
case IN:
case OP_IN:
return variant(right.contains(left));
case CAT:
case OP_CAT:
return left.concatenate(right);
case EQ:
return left == right ? variant(1) : variant(0);
Expand Down Expand Up @@ -534,7 +534,8 @@ class operator_expression : public formula_expression {
return res;
}

enum OP { AND, OR, NEQ, LTE, GTE, CAT, IN, GT='>', LT='<', EQ='=', RAN='~',
//In some cases a IN or CAT macros are defined.
enum OP { AND, OR, NEQ, LTE, GTE, OP_CAT, OP_IN, GT='>', LT='<', EQ='=', RAN='~',
ADD='+', SUB='-', MUL='*', DIV='/', ADDL, SUBL, MULL, DIVL, DICE='d', POW='^', MOD='%' };

OP op_;
Expand Down
4 changes: 2 additions & 2 deletions src/formula/function.cpp
Expand Up @@ -597,7 +597,7 @@ class cbrt_function : public function_expression {
private:
variant execute(const formula_callable& variables, formula_debugger *fdb) const {
const double num = args()[0]->evaluate(variables,fdb).as_decimal() / 1000.0;
const double result = num < 0 ? -pow(-num, 1.0l / 3.0l) : pow(num, 1.0l / 3.0l);
const double result = num < 0 ? -pow(-num, 1.0 / 3.0) : pow(num, 1.0 / 3.0);
return variant(result, variant::DECIMAL_VARIANT);
}
};
Expand All @@ -611,7 +611,7 @@ class root_function : public function_expression {
variant execute(const formula_callable& variables, formula_debugger *fdb) const {
const double base = args()[0]->evaluate(variables,fdb).as_decimal() / 1000.0;
const double root = args()[1]->evaluate(variables,fdb).as_decimal() / 1000.0;
const double result = base < 0 && fmod(root,2) == 1 ? -pow(-base, 1.0l / root) : pow(base, 1.0l / root);
const double result = base < 0 && fmod(root,2) == 1 ? -pow(-base, 1.0 / root) : pow(base, 1.0 / root);
if(result != result) {
return variant();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lua/ldo.cpp
Expand Up @@ -11,7 +11,7 @@
#define ldo_c
#define LUA_CORE

#include "lua_jailbreak_exception.hpp"
#include "../lua_jailbreak_exception.hpp"
#include <exception>
#if !defined(__cplusplus)
#error "Exception support requires a C++ compiler."
Expand Down

0 comments on commit 1094db6

Please sign in to comment.