mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-02-08 02:36:49 +08:00
Merge 313e435697daa3938aae3ea0cf7e2cbca1aa6ec3 into 645377e1910a4dd1124c183777120351de02ce00
This commit is contained in:
commit
7f8dd58cec
@ -1445,7 +1445,7 @@ namespace chaiscript
|
|||||||
static typename Container::const_iterator find_keyed_value(const Container &t_c, const Key &t_key, const size_t t_hint)
|
static typename Container::const_iterator find_keyed_value(const Container &t_c, const Key &t_key, const size_t t_hint)
|
||||||
{
|
{
|
||||||
if (t_c.size() > t_hint && t_c[t_hint].first == t_key) {
|
if (t_c.size() > t_hint && t_c[t_hint].first == t_key) {
|
||||||
return t_c.begin() + t_hint;
|
return t_c.begin() + static_cast<long>(t_hint);
|
||||||
} else {
|
} else {
|
||||||
return find_keyed_value(t_c, t_key);
|
return find_keyed_value(t_c, t_key);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,11 +32,11 @@ namespace chaiscript
|
|||||||
CHAISCRIPT_CONSTEXPR Type_Info(bool t_is_const, bool t_is_reference, bool t_is_pointer, bool t_is_void,
|
CHAISCRIPT_CONSTEXPR Type_Info(bool t_is_const, bool t_is_reference, bool t_is_pointer, bool t_is_void,
|
||||||
bool t_is_arithmetic, const std::type_info *t_ti, const std::type_info *t_bare_ti)
|
bool t_is_arithmetic, const std::type_info *t_ti, const std::type_info *t_bare_ti)
|
||||||
: m_type_info(t_ti), m_bare_type_info(t_bare_ti),
|
: m_type_info(t_ti), m_bare_type_info(t_bare_ti),
|
||||||
m_flags((t_is_const << is_const_flag)
|
m_flags((static_cast<unsigned int>(t_is_const) << is_const_flag)
|
||||||
+ (t_is_reference << is_reference_flag)
|
+ (static_cast<unsigned int>(t_is_reference) << is_reference_flag)
|
||||||
+ (t_is_pointer << is_pointer_flag)
|
+ (static_cast<unsigned int>(t_is_pointer) << is_pointer_flag)
|
||||||
+ (t_is_void << is_void_flag)
|
+ (static_cast<unsigned int>(t_is_void) << is_void_flag)
|
||||||
+ (t_is_arithmetic << is_arithmetic_flag))
|
+ (static_cast<unsigned int>(t_is_arithmetic) << is_arithmetic_flag))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -505,7 +505,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
// Let's see if this is a link that we should expand
|
// Let's see if this is a link that we should expand
|
||||||
std::vector<char> buf(2048);
|
std::vector<char> buf(2048);
|
||||||
const size_t pathlen = readlink(dllpath.c_str(), &buf.front(), buf.size());
|
const size_t pathlen = static_cast<size_t>(readlink(dllpath.c_str(), &buf.front(), buf.size()));
|
||||||
if (pathlen > 0 && pathlen < buf.size())
|
if (pathlen > 0 && pathlen < buf.size())
|
||||||
{
|
{
|
||||||
dllpath = std::string(&buf.front(), pathlen);
|
dllpath = std::string(&buf.front(), pathlen);
|
||||||
|
|||||||
@ -147,7 +147,7 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t remaining() const {
|
size_t remaining() const {
|
||||||
return std::distance(m_pos, m_end);
|
return static_cast<size_t>(std::distance(m_pos, m_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
char operator*() const {
|
char operator*() const {
|
||||||
@ -2213,8 +2213,8 @@ namespace chaiscript
|
|||||||
|
|
||||||
switch (m_operators[t_precedence]) {
|
switch (m_operators[t_precedence]) {
|
||||||
case(AST_Node_Type::Ternary_Cond) :
|
case(AST_Node_Type::Ternary_Cond) :
|
||||||
m_match_stack.erase(m_match_stack.begin() + m_match_stack.size() - 2,
|
m_match_stack.erase(m_match_stack.begin() + static_cast<long>(m_match_stack.size()) - 2,
|
||||||
m_match_stack.begin() + m_match_stack.size() - 1);
|
m_match_stack.begin() + static_cast<long>(m_match_stack.size()) - 1);
|
||||||
if (Symbol(":")) {
|
if (Symbol(":")) {
|
||||||
if (!Operator(t_precedence+1)) {
|
if (!Operator(t_precedence+1)) {
|
||||||
throw exception::eval_error("Incomplete "
|
throw exception::eval_error("Incomplete "
|
||||||
@ -2239,7 +2239,7 @@ namespace chaiscript
|
|||||||
case(AST_Node_Type::Bitwise_Or) :
|
case(AST_Node_Type::Bitwise_Or) :
|
||||||
case(AST_Node_Type::Comparison) :
|
case(AST_Node_Type::Comparison) :
|
||||||
assert(m_match_stack.size() > 1);
|
assert(m_match_stack.size() > 1);
|
||||||
m_match_stack.erase(m_match_stack.begin() + m_match_stack.size() - 2, m_match_stack.begin() + m_match_stack.size() - 1);
|
m_match_stack.erase(m_match_stack.begin() + static_cast<long>(m_match_stack.size()) - 2, m_match_stack.begin() + static_cast<long>(m_match_stack.size()) - 1);
|
||||||
build_match<eval::Binary_Operator_AST_Node>(prev_stack_top, oper->text);
|
build_match<eval::Binary_Operator_AST_Node>(prev_stack_top, oper->text);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user