initialization standars for C++1 on mayor cases

* backported ffba2b7646
* Fix initialization standars for C++11 on mayor cases
* Let compatibilty for GCC 4.4+
This commit is contained in:
mckaygerhard 2023-01-04 18:03:01 -04:00
parent cf6a378eae
commit 2cf3b684f2
3 changed files with 12 additions and 12 deletions

View File

@ -203,7 +203,7 @@ public:
deleted until this is 0 to keep the id preserved for the right
object.
*/
u16 m_known_by_count;
u16 m_known_by_count = 0;
/*
- Whether this object is to be removed when nobody knows about
@ -213,7 +213,7 @@ public:
- This is usually set to true by the step() method when the object wants
to be deleted but can be set by anything else too.
*/
bool m_pending_removal;
bool m_pending_removal = true;
/*
Same purpose as m_pending_removal but for deactivation.
@ -222,7 +222,7 @@ public:
If this is set alongside with m_pending_removal, removal takes
priority.
*/
bool m_pending_deactivation;
bool m_pending_deactivation = false;
/*
A getter that unifies the above to answer the question:
@ -234,12 +234,12 @@ public:
/*
Whether the object's static data has been stored to a block
*/
bool m_static_exists;
bool m_static_exists = true;
/*
The block from which the object was loaded from, and in which
a copy of the static data resides.
*/
v3s16 m_static_block;
v3s16 m_static_block = v3s16(1337,1337,1337);
/*
Queue of messages to be sent to the client

View File

@ -90,9 +90,9 @@ struct SettingsEntry {
is_group(true)
{}
std::string value;
std::string value = "";
Settings *group;
bool is_group;
bool is_group = false;
};
typedef UNORDERED_MAP<std::string, SettingsEntry> SettingEntries;

View File

@ -45,11 +45,11 @@ std::string getShaderPath(const std::string &name_of_shader,
const std::string &filename);
struct ShaderInfo {
std::string name;
video::E_MATERIAL_TYPE base_material;
video::E_MATERIAL_TYPE material;
u8 drawtype;
u8 material_type;
std::string name = "";
video::E_MATERIAL_TYPE base_material = video::EMT_SOLID;
video::E_MATERIAL_TYPE material = video::EMT_SOLID;
u8 drawtype = 0;
u8 material_type = 0;
s32 user_data;
ShaderInfo(): name(""), base_material(video::EMT_SOLID),