Clean up warnings
* msvc * pvs-studio
This commit is contained in:
@@ -53,6 +53,11 @@ namespace chaiscript
|
||||
|
||||
static Opers to_operator(const std::string &t_str, bool t_is_unary = false)
|
||||
{
|
||||
#ifdef CHAISCRIPT_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4307)
|
||||
#endif
|
||||
|
||||
const auto op_hash = utility::fnv1a_32(t_str.c_str());
|
||||
switch (op_hash) {
|
||||
case utility::fnv1a_32("=="): { return Opers::equals; }
|
||||
@@ -86,6 +91,10 @@ namespace chaiscript
|
||||
case utility::fnv1a_32("*"): { return Opers::product; }
|
||||
default: { return Opers::invalid; }
|
||||
}
|
||||
#ifdef CHAISCRIPT_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -433,13 +433,13 @@ namespace chaiscript
|
||||
try {
|
||||
|
||||
if (lhs.is_undef()) {
|
||||
if ((!this->children.empty()
|
||||
if (!this->children.empty()
|
||||
&& ((this->children[0]->identifier == AST_Node_Type::Reference)
|
||||
|| (!this->children[0]->children.empty()
|
||||
&& this->children[0]->children[0]->identifier == AST_Node_Type::Reference)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
{
|
||||
/// \todo This does not handle the case of an unassigned reference variable
|
||||
/// being assigned outside of its declaration
|
||||
|
||||
@@ -884,6 +884,11 @@ namespace chaiscript
|
||||
validate_object_name(text);
|
||||
}
|
||||
|
||||
#ifdef CHAISCRIPT_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4307)
|
||||
#endif
|
||||
|
||||
switch (text_hash) {
|
||||
case utility::fnv1a_32("true"): {
|
||||
m_match_stack.push_back(make_node<eval::Constant_AST_Node<Tracer>>(std::move(text), start.line, start.col, const_var(true)));
|
||||
@@ -948,6 +953,11 @@ namespace chaiscript
|
||||
} break;
|
||||
}
|
||||
|
||||
#ifdef CHAISCRIPT_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user