Make sure atomics are initialized

This commit is contained in:
Jason Turner
2016-10-06 09:09:50 -06:00
parent bec1b91b7b
commit 21495ebb40
3 changed files with 14 additions and 15 deletions

View File

@@ -1503,7 +1503,7 @@ namespace chaiscript
Type_Conversions m_conversions;
chaiscript::detail::threading::Thread_Storage<Stack_Holder> m_stack_holder;
mutable std::atomic_uint_fast32_t m_method_missing_loc;
mutable std::atomic_uint_fast32_t m_method_missing_loc = {0};
State m_state;
};

View File

@@ -337,7 +337,6 @@ namespace chaiscript
: m_mutex(),
m_conversions(),
m_convertableTypes(),
m_num_types(0),
m_thread_cache(this),
m_conversion_saves(this)
{
@@ -498,7 +497,7 @@ namespace chaiscript
mutable chaiscript::detail::threading::shared_mutex m_mutex;
std::set<std::shared_ptr<detail::Type_Conversion_Base>> m_conversions;
std::set<const std::type_info *, Less_Than> m_convertableTypes;
std::atomic_size_t m_num_types;
std::atomic_size_t m_num_types = {0};
mutable chaiscript::detail::threading::Thread_Storage<std::set<const std::type_info *, Less_Than>> m_thread_cache;
mutable chaiscript::detail::threading::Thread_Storage<Conversion_Saves> m_conversion_saves;
};

View File

@@ -128,7 +128,7 @@ namespace chaiscript
private:
Operators::Opers m_oper;
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Int_AST_Node : public AST_Node {
@@ -203,7 +203,7 @@ namespace chaiscript
Boxed_Value m_value;
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Char_AST_Node : public AST_Node {
@@ -397,8 +397,8 @@ namespace chaiscript
{ assert(children.size() == 3); }
Operators::Opers m_oper;
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_clone_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
mutable std::atomic_uint_fast32_t m_clone_loc = {0};
virtual ~Equation_AST_Node() {}
virtual Boxed_Value eval_internal(const chaiscript::detail::Dispatch_State &t_ss) const CHAISCRIPT_OVERRIDE {
@@ -567,7 +567,7 @@ namespace chaiscript
return oss.str();
}
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Dot_Access_AST_Node : public AST_Node {
@@ -624,8 +624,8 @@ namespace chaiscript
}
private:
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_array_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
mutable std::atomic_uint_fast32_t m_array_loc = {0};
std::string m_fun_name;
};
@@ -961,7 +961,7 @@ namespace chaiscript
return Boxed_Value();
}
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Case_AST_Node : public AST_Node {
@@ -1027,7 +1027,7 @@ namespace chaiscript
return "[" + AST_Node::pretty_print() + "]";
}
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Inline_Map_AST_Node : public AST_Node {
@@ -1055,7 +1055,7 @@ namespace chaiscript
}
}
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Return_AST_Node : public AST_Node {
@@ -1147,7 +1147,7 @@ namespace chaiscript
private:
Operators::Opers m_oper;
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Break_AST_Node : public AST_Node {
@@ -1217,7 +1217,7 @@ namespace chaiscript
}
}
mutable std::atomic_uint_fast32_t m_loc;
mutable std::atomic_uint_fast32_t m_loc = {0};
};
struct Annotation_AST_Node : public AST_Node {