Enable MSVC warning for thread safety with statics
Clean up a couple of additional issues found while playing with /Wall in MSVC.
This commit is contained in:
@@ -114,7 +114,7 @@ else()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(/W4)
|
||||
add_definitions(/W4 /w44640)
|
||||
add_definitions(/bigobj)
|
||||
# Note on MSVC compiler flags.
|
||||
# The code base selective disables warnings as necessary when the compiler is complaining too much
|
||||
|
@@ -541,7 +541,7 @@ namespace chaiscript
|
||||
|
||||
m->add(fun( std::function<const char *(const String *)>( [](const String *s) { return s->c_str(); } ) ), "c_str");
|
||||
m->add(fun( std::function<const char *(const String *)>( [](const String *s) { return s->data(); } ) ), "data");
|
||||
m->add(fun( std::function<String (const String *, int, int)>( [](const String *s, int pos, int len) { return s->substr(pos, len); } ) ), "substr");
|
||||
m->add(fun( std::function<String (const String *, size_t, size_t)>( [](const String *s, size_t pos, size_t len) { return s->substr(pos, len); } ) ), "substr");
|
||||
|
||||
return m;
|
||||
}
|
||||
|
@@ -15,9 +15,12 @@
|
||||
namespace chaiscript
|
||||
{
|
||||
|
||||
// Due to the nature of generating every possible arithmetic operation, there
|
||||
// are going to be warnings generated on every platform regarding size and sign,
|
||||
// this is OK, so we're disabling size/and sign type warnings
|
||||
#ifdef CHAISCRIPT_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4244 4018 4389 4146)
|
||||
#pragma warning(disable : 4244 4018 4389 4146 4365)
|
||||
#endif
|
||||
|
||||
/// \brief Represents any numeric type, generically. Used internally for generic operations between POD values
|
||||
|
@@ -194,7 +194,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(char c, detail::Alphabet a) { return m_alphabet[a][c]; }
|
||||
|
||||
/**
|
||||
* Prints the parsed ast_nodes as a tree
|
||||
|
Reference in New Issue
Block a user