mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
This commit is contained in:
parent
c5d76139dc
commit
cb282c6ef0
247 changed files with 794 additions and 794 deletions
|
@ -522,7 +522,7 @@ void GDScript::update_exports() {
|
|||
void GDScript::_set_subclass_path(Ref<GDScript> &p_sc, const String &p_path) {
|
||||
|
||||
p_sc->path = p_path;
|
||||
for (Map<StringName, Ref<GDScript> >::Element *E = p_sc->subclasses.front(); E; E = E->next()) {
|
||||
for (Map<StringName, Ref<GDScript>>::Element *E = p_sc->subclasses.front(); E; E = E->next()) {
|
||||
|
||||
_set_subclass_path(E->get(), p_path);
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ Error GDScript::reload(bool p_keep_state) {
|
|||
|
||||
valid = true;
|
||||
|
||||
for (Map<StringName, Ref<GDScript> >::Element *E = subclasses.front(); E; E = E->next()) {
|
||||
for (Map<StringName, Ref<GDScript>>::Element *E = subclasses.front(); E; E = E->next()) {
|
||||
|
||||
_set_subclass_path(E->get(), path);
|
||||
}
|
||||
|
@ -715,7 +715,7 @@ bool GDScript::_get(const StringName &p_name, Variant &r_ret) const {
|
|||
}
|
||||
|
||||
{
|
||||
const Map<StringName, Ref<GDScript> >::Element *E = subclasses.find(p_name);
|
||||
const Map<StringName, Ref<GDScript>>::Element *E = subclasses.find(p_name);
|
||||
if (E) {
|
||||
|
||||
r_ret = E->get();
|
||||
|
@ -831,7 +831,7 @@ Error GDScript::load_byte_code(const String &p_path) {
|
|||
|
||||
valid = true;
|
||||
|
||||
for (Map<StringName, Ref<GDScript> >::Element *E = subclasses.front(); E; E = E->next()) {
|
||||
for (Map<StringName, Ref<GDScript>>::Element *E = subclasses.front(); E; E = E->next()) {
|
||||
|
||||
_set_subclass_path(E->get(), path);
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ bool GDScript::has_script_signal(const StringName &p_signal) const {
|
|||
}
|
||||
void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
|
||||
|
||||
for (const Map<StringName, Vector<StringName> >::Element *E = _signals.front(); E; E = E->next()) {
|
||||
for (const Map<StringName, Vector<StringName>>::Element *E = _signals.front(); E; E = E->next()) {
|
||||
|
||||
MethodInfo mi;
|
||||
mi.name = E->key();
|
||||
|
@ -963,7 +963,7 @@ void GDScript::_save_orphaned_subclasses() {
|
|||
};
|
||||
Vector<ClassRefWithName> weak_subclasses;
|
||||
// collect subclasses ObjectID and name
|
||||
for (Map<StringName, Ref<GDScript> >::Element *E = subclasses.front(); E; E = E->next()) {
|
||||
for (Map<StringName, Ref<GDScript>>::Element *E = subclasses.front(); E; E = E->next()) {
|
||||
E->get()->_owner = NULL; //bye, you are no longer owned cause I died
|
||||
ClassRefWithName subclass;
|
||||
subclass.id = E->get()->get_instance_id();
|
||||
|
@ -997,7 +997,7 @@ void GDScript::_init_rpc_methods_properties() {
|
|||
}
|
||||
|
||||
GDScript *cscript = this;
|
||||
Map<StringName, Ref<GDScript> >::Element *sub_E = subclasses.front();
|
||||
Map<StringName, Ref<GDScript>>::Element *sub_E = subclasses.front();
|
||||
while (cscript) {
|
||||
// RPC Methods
|
||||
for (Map<StringName, GDScriptFunction *>::Element *E = cscript->member_functions.front(); E; E = E->next()) {
|
||||
|
@ -1661,7 +1661,7 @@ void GDScriptLanguage::reload_all_scripts() {
|
|||
|
||||
#ifdef DEBUG_ENABLED
|
||||
print_verbose("GDScript: Reloading all scripts");
|
||||
List<Ref<GDScript> > scripts;
|
||||
List<Ref<GDScript>> scripts;
|
||||
{
|
||||
MutexLock lock(this->lock);
|
||||
|
||||
|
@ -1679,7 +1679,7 @@ void GDScriptLanguage::reload_all_scripts() {
|
|||
|
||||
scripts.sort_custom<GDScriptDepSort>(); //update in inheritance dependency order
|
||||
|
||||
for (List<Ref<GDScript> >::Element *E = scripts.front(); E; E = E->next()) {
|
||||
for (List<Ref<GDScript>>::Element *E = scripts.front(); E; E = E->next()) {
|
||||
|
||||
print_verbose("GDScript: Reloading: " + E->get()->get_path());
|
||||
E->get()->load_source_code(E->get()->get_path());
|
||||
|
@ -1692,7 +1692,7 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||
|
||||
#ifdef DEBUG_ENABLED
|
||||
|
||||
List<Ref<GDScript> > scripts;
|
||||
List<Ref<GDScript>> scripts;
|
||||
{
|
||||
MutexLock lock(this->lock);
|
||||
|
||||
|
@ -1708,30 +1708,30 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||
|
||||
//when someone asks you why dynamically typed languages are easier to write....
|
||||
|
||||
Map<Ref<GDScript>, Map<ObjectID, List<Pair<StringName, Variant> > > > to_reload;
|
||||
Map<Ref<GDScript>, Map<ObjectID, List<Pair<StringName, Variant>>>> to_reload;
|
||||
|
||||
//as scripts are going to be reloaded, must proceed without locking here
|
||||
|
||||
scripts.sort_custom<GDScriptDepSort>(); //update in inheritance dependency order
|
||||
|
||||
for (List<Ref<GDScript> >::Element *E = scripts.front(); E; E = E->next()) {
|
||||
for (List<Ref<GDScript>>::Element *E = scripts.front(); E; E = E->next()) {
|
||||
|
||||
bool reload = E->get() == p_script || to_reload.has(E->get()->get_base());
|
||||
|
||||
if (!reload)
|
||||
continue;
|
||||
|
||||
to_reload.insert(E->get(), Map<ObjectID, List<Pair<StringName, Variant> > >());
|
||||
to_reload.insert(E->get(), Map<ObjectID, List<Pair<StringName, Variant>>>());
|
||||
|
||||
if (!p_soft_reload) {
|
||||
|
||||
//save state and remove script from instances
|
||||
Map<ObjectID, List<Pair<StringName, Variant> > > &map = to_reload[E->get()];
|
||||
Map<ObjectID, List<Pair<StringName, Variant>>> &map = to_reload[E->get()];
|
||||
|
||||
while (E->get()->instances.front()) {
|
||||
Object *obj = E->get()->instances.front()->get();
|
||||
//save instance info
|
||||
List<Pair<StringName, Variant> > state;
|
||||
List<Pair<StringName, Variant>> state;
|
||||
if (obj->get_script_instance()) {
|
||||
|
||||
obj->get_script_instance()->get_property_state(state);
|
||||
|
@ -1749,8 +1749,8 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||
//save instance info
|
||||
if (obj->get_script_instance()) {
|
||||
|
||||
map.insert(obj->get_instance_id(), List<Pair<StringName, Variant> >());
|
||||
List<Pair<StringName, Variant> > &state = map[obj->get_instance_id()];
|
||||
map.insert(obj->get_instance_id(), List<Pair<StringName, Variant>>());
|
||||
List<Pair<StringName, Variant>> &state = map[obj->get_instance_id()];
|
||||
obj->get_script_instance()->get_property_state(state);
|
||||
obj->set_script(Variant());
|
||||
} else {
|
||||
|
@ -1761,21 +1761,21 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||
|
||||
#endif
|
||||
|
||||
for (Map<ObjectID, List<Pair<StringName, Variant> > >::Element *F = E->get()->pending_reload_state.front(); F; F = F->next()) {
|
||||
for (Map<ObjectID, List<Pair<StringName, Variant>>>::Element *F = E->get()->pending_reload_state.front(); F; F = F->next()) {
|
||||
map[F->key()] = F->get(); //pending to reload, use this one instead
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Map<Ref<GDScript>, Map<ObjectID, List<Pair<StringName, Variant> > > >::Element *E = to_reload.front(); E; E = E->next()) {
|
||||
for (Map<Ref<GDScript>, Map<ObjectID, List<Pair<StringName, Variant>>>>::Element *E = to_reload.front(); E; E = E->next()) {
|
||||
|
||||
Ref<GDScript> scr = E->key();
|
||||
scr->reload(p_soft_reload);
|
||||
|
||||
//restore state if saved
|
||||
for (Map<ObjectID, List<Pair<StringName, Variant> > >::Element *F = E->get().front(); F; F = F->next()) {
|
||||
for (Map<ObjectID, List<Pair<StringName, Variant>>>::Element *F = E->get().front(); F; F = F->next()) {
|
||||
|
||||
List<Pair<StringName, Variant> > &saved_state = F->get();
|
||||
List<Pair<StringName, Variant>> &saved_state = F->get();
|
||||
|
||||
Object *obj = ObjectDB::get_instance(F->key());
|
||||
if (!obj)
|
||||
|
@ -1799,11 +1799,11 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
|||
|
||||
if (script_instance->is_placeholder() && scr->is_placeholder_fallback_enabled()) {
|
||||
PlaceHolderScriptInstance *placeholder = static_cast<PlaceHolderScriptInstance *>(script_instance);
|
||||
for (List<Pair<StringName, Variant> >::Element *G = saved_state.front(); G; G = G->next()) {
|
||||
for (List<Pair<StringName, Variant>>::Element *G = saved_state.front(); G; G = G->next()) {
|
||||
placeholder->property_set_fallback(G->get().first, G->get().second);
|
||||
}
|
||||
} else {
|
||||
for (List<Pair<StringName, Variant> >::Element *G = saved_state.front(); G; G = G->next()) {
|
||||
for (List<Pair<StringName, Variant>>::Element *G = saved_state.front(); G; G = G->next()) {
|
||||
script_instance->set(G->get().first, G->get().second);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue