From cb282c6ef0bb91957f8a6f422705813bd47c788c Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Tue, 17 Mar 2020 07:33:00 +0100 Subject: Style: Set clang-format Standard to Cpp11 For us, it practically only changes the fact that `A>` is now used instead of the C++03 compatible `A >`. 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`. --- modules/assimp/editor_scene_importer_assimp.cpp | 2 +- modules/assimp/import_state.h | 6 +-- modules/assimp/import_utils.h | 2 +- modules/bullet/soft_body_bullet.h | 2 +- modules/csg/csg.cpp | 2 +- modules/csg/csg.h | 4 +- modules/csg/csg_shape.cpp | 14 +++---- modules/csg/csg_shape.h | 2 +- modules/gdnative/gdnative.cpp | 6 +-- modules/gdnative/gdnative.h | 2 +- modules/gdnative/nativescript/api_generator.cpp | 6 +-- modules/gdnative/nativescript/nativescript.cpp | 28 ++++++------- modules/gdnative/nativescript/nativescript.h | 14 +++---- .../pluginscript/pluginscript_language.cpp | 2 +- .../gdnative/pluginscript/pluginscript_language.h | 2 +- modules/gdnative/register_types.cpp | 2 +- modules/gdscript/gdscript.cpp | 46 +++++++++++----------- modules/gdscript/gdscript.h | 10 ++--- modules/gdscript/gdscript_compiler.cpp | 2 +- modules/gdscript/gdscript_compiler.h | 4 +- modules/gdscript/gdscript_editor.cpp | 12 +++--- modules/gdscript/gdscript_function.cpp | 2 +- modules/gdscript/gdscript_function.h | 2 +- modules/gdscript/gdscript_parser.cpp | 2 +- modules/gdscript/gdscript_tokenizer.h | 10 ++--- .../language_server/gdscript_language_protocol.h | 2 +- modules/gridmap/grid_map.cpp | 18 ++++----- modules/mbedtls/crypto_mbedtls.cpp | 2 +- modules/mono/csharp_script.cpp | 26 ++++++------ modules/mono/csharp_script.h | 8 ++-- modules/mono/editor/bindings_generator.cpp | 2 +- modules/mono/editor/bindings_generator.h | 2 +- modules/mono/mono_gd/gd_mono.h | 2 +- modules/upnp/upnp.h | 2 +- modules/vhacd/register_types.cpp | 4 +- modules/visual_script/visual_script.cpp | 8 ++-- modules/visual_script/visual_script.h | 4 +- modules/visual_script/visual_script_editor.cpp | 36 ++++++++--------- modules/visual_script/visual_script_editor.h | 6 +-- modules/visual_script/visual_script_nodes.cpp | 2 +- modules/webrtc/webrtc_multiplayer.cpp | 26 ++++++------ modules/webrtc/webrtc_multiplayer.h | 4 +- modules/websocket/emws_client.cpp | 2 +- modules/websocket/websocket_multiplayer_peer.cpp | 8 ++-- modules/websocket/websocket_multiplayer_peer.h | 2 +- modules/websocket/wsl_client.cpp | 2 +- modules/websocket/wsl_server.cpp | 12 +++--- modules/websocket/wsl_server.h | 2 +- 48 files changed, 184 insertions(+), 184 deletions(-) (limited to 'modules') diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 1881d0db33..682a7e33c8 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -872,7 +872,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat const unsigned int mesh_idx = p_surface_indices[i]; const aiMesh *ai_mesh = state.assimp_scene->mMeshes[mesh_idx]; - Map > vertex_weights; + Map> vertex_weights; if (ai_mesh->mNumBones > 0) { for (size_t b = 0; b < ai_mesh->mNumBones; b++) { diff --git a/modules/assimp/import_state.h b/modules/assimp/import_state.h index 26aad423cd..fbbbe23399 100644 --- a/modules/assimp/import_state.h +++ b/modules/assimp/import_state.h @@ -61,15 +61,15 @@ struct ImportState { const aiScene *assimp_scene; uint32_t max_bone_weights; - Map > mesh_cache; - Map > material_cache; + Map> mesh_cache; + Map> material_cache; Map light_cache; Map camera_cache; // very useful for when you need to ask assimp for the bone mesh Map assimp_node_map; - Map > path_to_image_cache; + Map> path_to_image_cache; // Generation 3 - determinisitic iteration // to lower potential recursion errors diff --git a/modules/assimp/import_utils.h b/modules/assimp/import_utils.h index 80b67b5453..30c00f8765 100644 --- a/modules/assimp/import_utils.h +++ b/modules/assimp/import_utils.h @@ -341,7 +341,7 @@ public: */ static Ref load_image(ImportState &state, const aiScene *p_scene, String p_path) { - Map >::Element *match = state.path_to_image_cache.find(p_path); + Map>::Element *match = state.path_to_image_cache.find(p_path); // if our cache contains this image then don't bother if (match) { diff --git a/modules/bullet/soft_body_bullet.h b/modules/bullet/soft_body_bullet.h index 2df8ce074f..05d7e6ce3f 100644 --- a/modules/bullet/soft_body_bullet.h +++ b/modules/bullet/soft_body_bullet.h @@ -59,7 +59,7 @@ class SoftBodyBullet : public CollisionObjectBullet { private: btSoftBody *bt_soft_body; - Vector > indices_table; + Vector> indices_table; btSoftBody::Material *mat0; // This is just a copy of pointer managed by btSoftBody bool isScratched; diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index 4e39cce4a5..3f61e2852f 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -179,7 +179,7 @@ void CSGBrush::_regen_face_aabbs() { } } -void CSGBrush::build_from_faces(const Vector &p_vertices, const Vector &p_uvs, const Vector &p_smooth, const Vector > &p_materials, const Vector &p_invert_faces) { +void CSGBrush::build_from_faces(const Vector &p_vertices, const Vector &p_uvs, const Vector &p_smooth, const Vector> &p_materials, const Vector &p_invert_faces) { faces.clear(); diff --git a/modules/csg/csg.h b/modules/csg/csg.h index bb83c84cb5..d389cbc283 100644 --- a/modules/csg/csg.h +++ b/modules/csg/csg.h @@ -55,12 +55,12 @@ struct CSGBrush { }; Vector faces; - Vector > materials; + Vector> materials; inline void _regen_face_aabbs(); // Create a brush from faces. - void build_from_faces(const Vector &p_vertices, const Vector &p_uvs, const Vector &p_smooth, const Vector > &p_materials, const Vector &p_invert_faces); + void build_from_faces(const Vector &p_vertices, const Vector &p_uvs, const Vector &p_smooth, const Vector> &p_materials, const Vector &p_invert_faces); void copy_from(const CSGBrush &p_brush, const Transform &p_xform); }; diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index a227d49892..54635ae320 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -665,7 +665,7 @@ CSGCombiner::CSGCombiner() { ///////////////////// -CSGBrush *CSGPrimitive::_create_brush_from_arrays(const Vector &p_vertices, const Vector &p_uv, const Vector &p_smooth, const Vector > &p_materials) { +CSGBrush *CSGPrimitive::_create_brush_from_arrays(const Vector &p_vertices, const Vector &p_uv, const Vector &p_smooth, const Vector> &p_materials) { CSGBrush *brush = memnew(CSGBrush); @@ -717,7 +717,7 @@ CSGBrush *CSGMesh::_build_brush() { Vector vertices; Vector smooth; - Vector > materials; + Vector> materials; Vector uvs; Ref material = get_material(); @@ -927,7 +927,7 @@ CSGBrush *CSGSphere::_build_brush() { Vector faces; Vector uvs; Vector smooth; - Vector > materials; + Vector> materials; Vector invert; faces.resize(face_count * 3); @@ -1130,7 +1130,7 @@ CSGBrush *CSGBox::_build_brush() { Vector faces; Vector uvs; Vector smooth; - Vector > materials; + Vector> materials; Vector invert; faces.resize(face_count * 3); @@ -1308,7 +1308,7 @@ CSGBrush *CSGCylinder::_build_brush() { Vector faces; Vector uvs; Vector smooth; - Vector > materials; + Vector> materials; Vector invert; faces.resize(face_count * 3); @@ -1557,7 +1557,7 @@ CSGBrush *CSGTorus::_build_brush() { Vector faces; Vector uvs; Vector smooth; - Vector > materials; + Vector> materials; Vector invert; faces.resize(face_count * 3); @@ -1851,7 +1851,7 @@ CSGBrush *CSGPolygon::_build_brush() { Vector faces; Vector uvs; Vector smooth; - Vector > materials; + Vector> materials; Vector invert; faces.resize(face_count * 3); diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h index 909437e39b..fdbf979fe7 100644 --- a/modules/csg/csg_shape.h +++ b/modules/csg/csg_shape.h @@ -172,7 +172,7 @@ private: bool invert_faces; protected: - CSGBrush *_create_brush_from_arrays(const Vector &p_vertices, const Vector &p_uv, const Vector &p_smooth, const Vector > &p_materials); + CSGBrush *_create_brush_from_arrays(const Vector &p_vertices, const Vector &p_uv, const Vector &p_smooth, const Vector> &p_materials); static void _bind_methods(); public: diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 33b734f672..0457a42f30 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -48,7 +48,7 @@ static const bool default_reloadable = true; // Defined in gdnative_api_struct.gen.cpp extern const godot_gdnative_core_api_struct api_struct; -Map > > GDNativeLibrary::loaded_libraries; +Map>> GDNativeLibrary::loaded_libraries; GDNativeLibrary::GDNativeLibrary() { config_file.instance(); @@ -373,7 +373,7 @@ bool GDNative::initialize() { initialized = true; if (library->should_load_once() && !GDNativeLibrary::loaded_libraries.has(lib_path)) { - Vector > gdnatives; + Vector> gdnatives; gdnatives.resize(1); gdnatives.write[0] = Ref(this); GDNativeLibrary::loaded_libraries.insert(lib_path, gdnatives); @@ -390,7 +390,7 @@ bool GDNative::terminate() { } if (library->should_load_once()) { - Vector > *gdnatives = &GDNativeLibrary::loaded_libraries[library->get_current_library_path()]; + Vector> *gdnatives = &GDNativeLibrary::loaded_libraries[library->get_current_library_path()]; if (gdnatives->size() > 1) { // there are other GDNative's still using this library, so we actually don't terminate gdnatives->erase(Ref(this)); diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index b4c5ec9d00..9ef9c706d1 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -47,7 +47,7 @@ class GDNative; class GDNativeLibrary : public Resource { GDCLASS(GDNativeLibrary, Resource); - static Map > > loaded_libraries; + static Map>> loaded_libraries; friend class GDNativeLibraryResourceLoader; friend class GDNative; diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 850871579b..11fe746e90 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -98,7 +98,7 @@ struct SignalAPI { struct EnumAPI { String name; - List > values; + List> values; }; struct ClassAPI { @@ -395,7 +395,7 @@ List generate_c_api_classes() { int int_val = ClassDB::get_integer_constant(class_name, val_e->get(), NULL); enum_api.values.push_back(Pair(int_val, val_e->get())); } - enum_api.values.sort_custom >(); + enum_api.values.sort_custom>(); class_api.enums.push_back(enum_api); } } @@ -497,7 +497,7 @@ static List generate_c_api_json(const List &p_api) { source.push_back("\t\t\t{\n"); source.push_back("\t\t\t\t\"name\": \"" + e->get().name + "\",\n"); source.push_back("\t\t\t\t\"values\": {\n"); - for (List >::Element *val_e = e->get().values.front(); val_e; val_e = val_e->next()) { + for (List>::Element *val_e = e->get().values.front(); val_e; val_e = val_e->next()) { source.push_back("\t\t\t\t\t\"" + val_e->get().second + "\": " + itos(val_e->get().first)); source.push_back(String((val_e->next() ? "," : "")) + "\n"); } diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index d0e196b3e6..fb88479ca3 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1139,16 +1139,16 @@ NativeScriptLanguage *NativeScriptLanguage::singleton; void NativeScriptLanguage::_unload_stuff(bool p_reload) { - Map > erase_and_unload; + Map> erase_and_unload; - for (Map >::Element *L = library_classes.front(); L; L = L->next()) { + for (Map>::Element *L = library_classes.front(); L; L = L->next()) { String lib_path = L->key(); Map classes = L->get(); if (p_reload) { - Map >::Element *E = library_gdnatives.find(lib_path); + Map>::Element *E = library_gdnatives.find(lib_path); Ref gdn; if (E) { @@ -1169,7 +1169,7 @@ void NativeScriptLanguage::_unload_stuff(bool p_reload) { } } - Map >::Element *E = library_gdnatives.find(lib_path); + Map>::Element *E = library_gdnatives.find(lib_path); Ref gdn; if (E) { @@ -1204,7 +1204,7 @@ void NativeScriptLanguage::_unload_stuff(bool p_reload) { erase_and_unload.insert(lib_path, gdn); } - for (Map >::Element *E = erase_and_unload.front(); E; E = E->next()) { + for (Map>::Element *E = erase_and_unload.front(); E; E = E->next()) { String lib_path = E->key(); Ref gdn = E->get(); @@ -1247,7 +1247,7 @@ NativeScriptLanguage::NativeScriptLanguage() { NativeScriptLanguage::~NativeScriptLanguage() { - for (Map >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { + for (Map>::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref lib = L->get(); // only shut down valid libs, duh! @@ -1385,7 +1385,7 @@ void NativeScriptLanguage::get_recognized_extensions(List *p_extensions) void NativeScriptLanguage::get_public_functions(List *p_functions) const { } -void NativeScriptLanguage::get_public_constants(List > *p_constants) const { +void NativeScriptLanguage::get_public_constants(List> *p_constants) const { } void NativeScriptLanguage::profiling_start() { @@ -1679,7 +1679,7 @@ void NativeScriptLanguage::init_library(const Ref &lib) { // See if this library was "registered" already. const String &lib_path = lib->get_current_library_path(); ERR_FAIL_COND_MSG(lib_path.length() == 0, lib->get_name() + " does not have a library for the current platform."); - Map >::Element *E = library_gdnatives.find(lib_path); + Map>::Element *E = library_gdnatives.find(lib_path); if (!E) { Ref gdn; @@ -1719,7 +1719,7 @@ void NativeScriptLanguage::register_script(NativeScript *script) { void NativeScriptLanguage::unregister_script(NativeScript *script) { MutexLock lock(mutex); - Map >::Element *S = library_script_users.find(script->lib_path); + Map>::Element *S = library_script_users.find(script->lib_path); if (S) { S->get().erase(script); if (S->get().size() == 0) { @@ -1733,7 +1733,7 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) { void NativeScriptLanguage::call_libraries_cb(const StringName &name) { // library_gdnatives is modified only from the main thread, so it's safe not to use mutex here - for (Map >::Element *L = library_gdnatives.front(); L; L = L->next()) { + for (Map>::Element *L = library_gdnatives.front(); L; L = L->next()) { if (L->get().is_null()) { continue; @@ -1755,7 +1755,7 @@ void NativeScriptLanguage::frame() { #ifndef NO_THREADS if (has_objects_to_register) { MutexLock lock(mutex); - for (Set >::Element *L = libs_to_init.front(); L; L = L->next()) { + for (Set>::Element *L = libs_to_init.front(); L; L = L->next()) { init_library(L->get()); } libs_to_init.clear(); @@ -1834,7 +1834,7 @@ void NativeReloadNode::_notification(int p_what) { MutexLock lock(NSL->mutex); NSL->_unload_stuff(true); - for (Map >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { + for (Map>::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref gdn = L->get(); @@ -1869,7 +1869,7 @@ void NativeReloadNode::_notification(int p_what) { MutexLock lock(NSL->mutex); Set libs_to_remove; - for (Map >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { + for (Map>::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref gdn = L->get(); @@ -1904,7 +1904,7 @@ void NativeReloadNode::_notification(int p_what) { ((void (*)(void *))proc_ptr)((void *)&L->key()); } - for (Map >::Element *U = NSL->library_script_users.front(); U; U = U->next()) { + for (Map>::Element *U = NSL->library_script_users.front(); U; U = U->next()) { for (Set::Element *S = U->get().front(); S; S = S->next()) { NativeScript *script = S->get(); diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 90542c96b7..aba3f6b2d0 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -263,7 +263,7 @@ private: Mutex mutex; #ifndef NO_THREADS - Set > libs_to_init; + Set> libs_to_init; Set scripts_to_register; volatile bool has_objects_to_register; // so that we don't lock mutex every frame - it's rarely needed void defer_init_library(Ref lib, NativeScript *script); @@ -275,10 +275,10 @@ private: void call_libraries_cb(const StringName &name); - Vector > binding_functions; + Vector> binding_functions; Set *> binding_instances; - Map > global_type_tags; + Map> global_type_tags; struct ProfileData { StringName signature; @@ -298,10 +298,10 @@ private: public: // These two maps must only be touched on the main thread - Map > library_classes; - Map > library_gdnatives; + Map> library_classes; + Map> library_gdnatives; - Map > library_script_users; + Map> library_script_users; StringName _init_call_type; StringName _init_call_name; @@ -362,7 +362,7 @@ public: virtual void reload_tool_script(const Ref