diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index c2cd20e..8b3d763 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -251,9 +251,9 @@ namespace chaiscript ~Sentinel() { // save new pointer data - const auto ptr = m_ptr.get().get(); - m_data.get().m_data_ptr = ptr; - m_data.get().m_const_data_ptr = ptr; + const auto ptr_ = m_ptr.get().get(); + m_data.get().m_data_ptr = ptr_; + m_data.get().m_const_data_ptr = ptr_; } Sentinel& operator=(Sentinel&&s) = default; diff --git a/include/chaiscript/language/chaiscript_parser.hpp b/include/chaiscript/language/chaiscript_parser.hpp index f0b57f0..c703fb4 100644 --- a/include/chaiscript/language/chaiscript_parser.hpp +++ b/include/chaiscript/language/chaiscript_parser.hpp @@ -2261,14 +2261,14 @@ namespace chaiscript /// Reads a unary prefixed expression from input bool Prefix() { const auto prev_stack_top = m_match_stack.size(); - using SS = utility::Static_String; - constexpr const std::array prefix_opers{ - SS{"++"}, - SS{"--"}, - SS{"-"}, - SS{"+"}, - SS{"!"}, - SS{"~"}}; + constexpr const std::array prefix_opers{{ + "++", + "--", + "-", + "+", + "!", + "~" + }}; for (const auto &oper : prefix_opers) { @@ -2426,7 +2426,7 @@ namespace chaiscript using SS = utility::Static_String; if (Operator()) { - for (const auto sym : {SS{"="}, SS{":="}, SS{"+="}, SS{"-="}, SS{"*="}, SS{"/="}, SS{"%="}, SS{"<<="}, SS{">>="}, SS{"&="}, SS{"^="}, SS{"|="}}) + for (const auto &sym : {SS{"="}, SS{":="}, SS{"+="}, SS{"-="}, SS{"*="}, SS{"/="}, SS{"%="}, SS{"<<="}, SS{">>="}, SS{"&="}, SS{"^="}, SS{"|="}}) { if (Symbol(sym, true)) { SkipWS(true); diff --git a/include/chaiscript/utility/fnv1a.hpp b/include/chaiscript/utility/fnv1a.hpp index 54378cd..b8c0187 100644 --- a/include/chaiscript/utility/fnv1a.hpp +++ b/include/chaiscript/utility/fnv1a.hpp @@ -21,6 +21,11 @@ namespace chaiscript static constexpr std::uint32_t fnv1a_32(const char *s, std::uint32_t h = 0x811c9dc5) { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#endif + #ifdef CHAISCRIPT_MSVC #pragma warning(push) #pragma warning(disable : 4307) @@ -29,6 +34,11 @@ namespace chaiscript #ifdef CHAISCRIPT_MSVC #pragma warning(pop) #endif + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + } diff --git a/unittests/compiled_tests.cpp b/unittests/compiled_tests.cpp index 9d75519..8bebc92 100644 --- a/unittests/compiled_tests.cpp +++ b/unittests/compiled_tests.cpp @@ -1202,7 +1202,7 @@ TEST_CASE("Test reference member being registered") double d; chai.add(chaiscript::var(Reference_MyClass(d)), "ref"); chai.eval("ref.x = 2.3"); - CHECK(d == 2.3); + CHECK(d == Approx(2.3)); } diff --git a/unittests/integer_literal_test.cpp b/unittests/integer_literal_test.cpp index bd5ef10..4c20f28 100644 --- a/unittests/integer_literal_test.cpp +++ b/unittests/integer_literal_test.cpp @@ -204,30 +204,30 @@ int main() && TEST_LITERAL(16777215u) && TEST_LITERAL(4294967295u) - && TEST_LITERAL(-255u) - && TEST_LITERAL(-65535u) - && TEST_LITERAL(-16777215u) - && TEST_LITERAL(-4294967295u) + && TEST_LITERAL_SIGNED(-255u) + && TEST_LITERAL_SIGNED(-65535u) + && TEST_LITERAL_SIGNED(-16777215u) + && TEST_LITERAL_SIGNED(-4294967295u) && TEST_LITERAL(255l) && TEST_LITERAL(65535l) && TEST_LITERAL(16777215l) && TEST_LITERAL(4294967295l) - && TEST_LITERAL(-255l) - && TEST_LITERAL(-65535l) - && TEST_LITERAL(-16777215l) - && TEST_LITERAL(-4294967295l) + && TEST_LITERAL_SIGNED(-255l) + && TEST_LITERAL_SIGNED(-65535l) + && TEST_LITERAL_SIGNED(-16777215l) + && TEST_LITERAL_SIGNED(-4294967295l) && TEST_LITERAL(255ul) && TEST_LITERAL(65535ul) && TEST_LITERAL(16777215ul) && TEST_LITERAL(4294967295ul) - && TEST_LITERAL(-255ul) - && TEST_LITERAL(-65535ul) - && TEST_LITERAL(-16777215ul) - && TEST_LITERAL(-4294967295ul) + && TEST_LITERAL_SIGNED(-255ul) + && TEST_LITERAL_SIGNED(-65535ul) + && TEST_LITERAL_SIGNED(-16777215ul) + && TEST_LITERAL_SIGNED(-4294967295ul) && TEST_LITERAL(255ull) && TEST_LITERAL(65535ull)