From 840e442a1b6961702c1efd9b3454472cacab8993 Mon Sep 17 00:00:00 2001 From: Arash Partow Date: Fri, 13 Jun 2014 04:24:23 +1000 Subject: [PATCH] C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html --- exprtk.hpp | 14 ++++++++++++-- exprtk_simple_example_13.cpp | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/exprtk.hpp b/exprtk.hpp index 2fc9613..b4ddacc 100644 --- a/exprtk.hpp +++ b/exprtk.hpp @@ -258,8 +258,8 @@ namespace exprtk const std::size_t length = std::min(s1.size(),s2.size()); for (std::size_t i = 0; i < length; ++i) { - const char c1 = std::tolower(s1[i]); - const char c2 = std::tolower(s2[i]); + const char c1 = static_cast(std::tolower(s1[i])); + const char c2 = static_cast(std::tolower(s2[i])); if (c1 > c2) return false; else if (c1 < c2) @@ -4565,7 +4565,9 @@ namespace exprtk inline T value() const { throw break_exception(return_ ? return_->value() : std::numeric_limits::quiet_NaN()); + #ifndef _MSC_VER return std::numeric_limits::quiet_NaN(); + #endif } inline typename expression_node::node_type type() const @@ -4587,7 +4589,9 @@ namespace exprtk inline T value() const { throw continue_exception(); + #ifndef _MSC_VER return std::numeric_limits::quiet_NaN(); + #endif } inline typename expression_node::node_type type() const @@ -5422,6 +5426,8 @@ namespace exprtk private: + vector_assignment_node& operator=(const vector_assignment_node&); + mutable T* vector_base_; std::vector initialiser_list_; const std::size_t size_; @@ -12760,6 +12766,8 @@ namespace exprtk private: + scope_element_manager& operator=(const scope_element_manager&); + parser_t& parser_; std::vector element_; scope_element null_element_; @@ -12793,6 +12801,8 @@ namespace exprtk private: + scope_handler& operator=(const scope_handler&); + parser_t& parser_; }; diff --git a/exprtk_simple_example_13.cpp b/exprtk_simple_example_13.cpp index 7bb87e8..59e7c82 100644 --- a/exprtk_simple_example_13.cpp +++ b/exprtk_simple_example_13.cpp @@ -69,7 +69,7 @@ void savitzky_golay_filter() const T pi = T(3.141592653589793238462); - srand(time(0)); + srand(static_cast(time(0))); // Generate a signal with noise. for (T t = T(-5); t <= T(+5); t += T(10.0 / n))