Fix issues found by cppcheck 1.65
This commit is contained in:
@@ -208,7 +208,7 @@ namespace chaiscript
|
||||
std::vector<Dynamic_Cast_Conversion> m_conversions;
|
||||
|
||||
template<typename T, typename InItr>
|
||||
void apply(InItr begin, InItr end, T &t) const
|
||||
static void apply(InItr begin, InItr end, T &t)
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
@@ -223,7 +223,7 @@ namespace chaiscript
|
||||
}
|
||||
|
||||
template<typename T, typename InItr>
|
||||
void apply_globals(InItr begin, InItr end, T &t) const
|
||||
static void apply_globals(InItr begin, InItr end, T &t)
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ namespace chaiscript
|
||||
}
|
||||
|
||||
template<typename T, typename InItr>
|
||||
void apply_single(InItr begin, InItr end, T &t) const
|
||||
static void apply_single(InItr begin, InItr end, T &t)
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
@@ -243,7 +243,7 @@ namespace chaiscript
|
||||
}
|
||||
|
||||
template<typename T, typename InItr>
|
||||
void apply_eval(InItr begin, InItr end, T &t) const
|
||||
static void apply_eval(InItr begin, InItr end, T &t)
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
@@ -484,16 +484,16 @@ namespace chaiscript
|
||||
|
||||
add_object(name, obj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds a named object to the current scope
|
||||
*/
|
||||
void add_object(const std::string &name, const Boxed_Value &obj)
|
||||
void add_object(const std::string &name, const Boxed_Value &obj) const
|
||||
{
|
||||
StackData &stack = get_stack_data();
|
||||
validate_object_name(name);
|
||||
|
||||
|
||||
Scope &scope = stack.back();
|
||||
auto itr = scope.find(name);
|
||||
if (itr != stack.back().end())
|
||||
@@ -987,7 +987,7 @@ namespace chaiscript
|
||||
return get_type_name(obj.get_type_info());
|
||||
}
|
||||
|
||||
State get_state()
|
||||
State get_state() const
|
||||
{
|
||||
chaiscript::detail::threading::shared_lock<chaiscript::detail::threading::shared_mutex> l(m_mutex);
|
||||
chaiscript::detail::threading::shared_lock<chaiscript::detail::threading::shared_mutex> l2(m_global_object_mutex);
|
||||
|
@@ -372,7 +372,7 @@ namespace chaiscript
|
||||
|
||||
|
||||
/// Helper function for loading a file
|
||||
std::string load_file(const std::string &t_filename) {
|
||||
static std::string load_file(const std::string &t_filename) {
|
||||
std::ifstream infile(t_filename.c_str(), std::ios::in | std::ios::ate | std::ios::binary );
|
||||
|
||||
if (!infile.is_open()) {
|
||||
|
@@ -200,7 +200,7 @@ namespace chaiscript
|
||||
/**
|
||||
* test a char in an m_alphabet
|
||||
*/
|
||||
bool char_in_alphabet(unsigned char c, detail::Alphabet a) { return m_alphabet[a][c]; }
|
||||
bool char_in_alphabet(unsigned char c, detail::Alphabet a) const { return m_alphabet[a][c]; }
|
||||
|
||||
/**
|
||||
* Prints the parsed ast_nodes as a tree
|
||||
@@ -217,7 +217,7 @@ namespace chaiscript
|
||||
/**
|
||||
* Shows the current stack of matched ast_nodes
|
||||
*/
|
||||
void show_match_stack() {
|
||||
void show_match_stack() const {
|
||||
for (auto & elem : m_match_stack) {
|
||||
//debug_print(match_stack[i]);
|
||||
std::cout << elem->to_string();
|
||||
@@ -280,7 +280,7 @@ namespace chaiscript
|
||||
/**
|
||||
* Check to see if there is more text parse
|
||||
*/
|
||||
inline bool has_more_input() {
|
||||
inline bool has_more_input() const {
|
||||
return (m_input_pos != m_input_end);
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ namespace chaiscript
|
||||
return retval;
|
||||
}
|
||||
|
||||
Boxed_Value buildFloat(const std::string &t_val)
|
||||
static Boxed_Value buildFloat(const std::string &t_val)
|
||||
{
|
||||
bool float_ = false;
|
||||
bool long_ = false;
|
||||
@@ -508,7 +508,7 @@ namespace chaiscript
|
||||
|
||||
|
||||
template<typename IntType>
|
||||
Boxed_Value buildInt(const IntType &t_type, const std::string &t_val)
|
||||
static Boxed_Value buildInt(const IntType &t_type, const std::string &t_val)
|
||||
{
|
||||
bool unsigned_ = false;
|
||||
bool long_ = false;
|
||||
|
Reference in New Issue
Block a user