Some clang specific fixes / warnings
This commit is contained in:
@@ -251,9 +251,9 @@ namespace chaiscript
|
|||||||
~Sentinel()
|
~Sentinel()
|
||||||
{
|
{
|
||||||
// save new pointer data
|
// save new pointer data
|
||||||
const auto ptr = m_ptr.get().get();
|
const auto ptr_ = m_ptr.get().get();
|
||||||
m_data.get().m_data_ptr = ptr;
|
m_data.get().m_data_ptr = ptr_;
|
||||||
m_data.get().m_const_data_ptr = ptr;
|
m_data.get().m_const_data_ptr = ptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sentinel& operator=(Sentinel&&s) = default;
|
Sentinel& operator=(Sentinel&&s) = default;
|
||||||
|
@@ -2261,14 +2261,14 @@ namespace chaiscript
|
|||||||
/// Reads a unary prefixed expression from input
|
/// Reads a unary prefixed expression from input
|
||||||
bool Prefix() {
|
bool Prefix() {
|
||||||
const auto prev_stack_top = m_match_stack.size();
|
const auto prev_stack_top = m_match_stack.size();
|
||||||
using SS = utility::Static_String;
|
constexpr const std::array<utility::Static_String, 6> prefix_opers{{
|
||||||
constexpr const std::array<utility::Static_String, 6> prefix_opers{
|
"++",
|
||||||
SS{"++"},
|
"--",
|
||||||
SS{"--"},
|
"-",
|
||||||
SS{"-"},
|
"+",
|
||||||
SS{"+"},
|
"!",
|
||||||
SS{"!"},
|
"~"
|
||||||
SS{"~"}};
|
}};
|
||||||
|
|
||||||
for (const auto &oper : prefix_opers)
|
for (const auto &oper : prefix_opers)
|
||||||
{
|
{
|
||||||
@@ -2426,7 +2426,7 @@ namespace chaiscript
|
|||||||
using SS = utility::Static_String;
|
using SS = utility::Static_String;
|
||||||
|
|
||||||
if (Operator()) {
|
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)) {
|
if (Symbol(sym, true)) {
|
||||||
SkipWS(true);
|
SkipWS(true);
|
||||||
|
@@ -21,6 +21,11 @@ namespace chaiscript
|
|||||||
|
|
||||||
|
|
||||||
static constexpr std::uint32_t fnv1a_32(const char *s, std::uint32_t h = 0x811c9dc5) {
|
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
|
#ifdef CHAISCRIPT_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4307)
|
#pragma warning(disable : 4307)
|
||||||
@@ -29,6 +34,11 @@ namespace chaiscript
|
|||||||
#ifdef CHAISCRIPT_MSVC
|
#ifdef CHAISCRIPT_MSVC
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1202,7 +1202,7 @@ TEST_CASE("Test reference member being registered")
|
|||||||
double d;
|
double d;
|
||||||
chai.add(chaiscript::var(Reference_MyClass(d)), "ref");
|
chai.add(chaiscript::var(Reference_MyClass(d)), "ref");
|
||||||
chai.eval("ref.x = 2.3");
|
chai.eval("ref.x = 2.3");
|
||||||
CHECK(d == 2.3);
|
CHECK(d == Approx(2.3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -204,30 +204,30 @@ int main()
|
|||||||
&& TEST_LITERAL(16777215u)
|
&& TEST_LITERAL(16777215u)
|
||||||
&& TEST_LITERAL(4294967295u)
|
&& TEST_LITERAL(4294967295u)
|
||||||
|
|
||||||
&& TEST_LITERAL(-255u)
|
&& TEST_LITERAL_SIGNED(-255u)
|
||||||
&& TEST_LITERAL(-65535u)
|
&& TEST_LITERAL_SIGNED(-65535u)
|
||||||
&& TEST_LITERAL(-16777215u)
|
&& TEST_LITERAL_SIGNED(-16777215u)
|
||||||
&& TEST_LITERAL(-4294967295u)
|
&& TEST_LITERAL_SIGNED(-4294967295u)
|
||||||
|
|
||||||
&& TEST_LITERAL(255l)
|
&& TEST_LITERAL(255l)
|
||||||
&& TEST_LITERAL(65535l)
|
&& TEST_LITERAL(65535l)
|
||||||
&& TEST_LITERAL(16777215l)
|
&& TEST_LITERAL(16777215l)
|
||||||
&& TEST_LITERAL(4294967295l)
|
&& TEST_LITERAL(4294967295l)
|
||||||
|
|
||||||
&& TEST_LITERAL(-255l)
|
&& TEST_LITERAL_SIGNED(-255l)
|
||||||
&& TEST_LITERAL(-65535l)
|
&& TEST_LITERAL_SIGNED(-65535l)
|
||||||
&& TEST_LITERAL(-16777215l)
|
&& TEST_LITERAL_SIGNED(-16777215l)
|
||||||
&& TEST_LITERAL(-4294967295l)
|
&& TEST_LITERAL_SIGNED(-4294967295l)
|
||||||
|
|
||||||
&& TEST_LITERAL(255ul)
|
&& TEST_LITERAL(255ul)
|
||||||
&& TEST_LITERAL(65535ul)
|
&& TEST_LITERAL(65535ul)
|
||||||
&& TEST_LITERAL(16777215ul)
|
&& TEST_LITERAL(16777215ul)
|
||||||
&& TEST_LITERAL(4294967295ul)
|
&& TEST_LITERAL(4294967295ul)
|
||||||
|
|
||||||
&& TEST_LITERAL(-255ul)
|
&& TEST_LITERAL_SIGNED(-255ul)
|
||||||
&& TEST_LITERAL(-65535ul)
|
&& TEST_LITERAL_SIGNED(-65535ul)
|
||||||
&& TEST_LITERAL(-16777215ul)
|
&& TEST_LITERAL_SIGNED(-16777215ul)
|
||||||
&& TEST_LITERAL(-4294967295ul)
|
&& TEST_LITERAL_SIGNED(-4294967295ul)
|
||||||
|
|
||||||
&& TEST_LITERAL(255ull)
|
&& TEST_LITERAL(255ull)
|
||||||
&& TEST_LITERAL(65535ull)
|
&& TEST_LITERAL(65535ull)
|
||||||
|
Reference in New Issue
Block a user