From 13c2ff932089db24841bb971b645141218bd8586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 6 Dec 2017 21:36:34 +0100 Subject: [PATCH] Style: Apply new clang-format 5.0 style to all files --- core/class_db.h | 8 +- core/core_string_names.cpp | 28 +-- core/dvector.h | 2 +- core/engine.h | 6 +- core/global_constants.cpp | 14 +- core/hash_map.h | 6 +- core/helper/math_fieldwise.cpp | 9 +- core/io/file_access_pack.cpp | 6 +- core/io/marshalls.cpp | 4 +- core/io/resource_import.h | 6 +- core/math/a_star.h | 4 +- core/math/aabb.h | 6 +- core/math/bsp_tree.cpp | 10 +- core/math/face3.cpp | 3 +- core/math/math_2d.h | 30 ++-- core/math/math_funcs.h | 2 +- core/math/plane.h | 18 +- core/math/transform.cpp | 6 +- core/object.cpp | 168 +++++++++--------- core/object.h | 38 ++-- core/ordered_hash_map.h | 26 +-- core/pair.h | 6 +- core/project_settings.h | 22 +-- core/resource.cpp | 4 +- core/safe_refcount.cpp | 8 +- core/script_debugger_remote.cpp | 38 ++-- core/script_language.cpp | 8 +- core/translation.cpp | 10 +- core/typedefs.h | 6 +- core/variant.cpp | 6 +- core/variant_call.cpp | 6 +- drivers/convex_decomp/b2d_decompose.cpp | 2 +- drivers/gles3/rasterizer_scene_gles3.cpp | 12 -- drivers/gles3/rasterizer_storage_gles3.h | 22 +-- drivers/unix/ip_unix.cpp | 5 +- drivers/xaudio2/audio_driver_xaudio2.h | 4 +- editor/editor_export.h | 5 +- editor/filesystem_dock.h | 10 +- editor/import/editor_import_collada.cpp | 2 - editor/plugins/abstract_polygon_2d_editor.cpp | 25 +-- editor/plugins/canvas_item_editor_plugin.cpp | 4 +- .../collision_polygon_2d_editor_plugin.cpp | 8 +- editor/plugins/curve_editor_plugin.cpp | 6 +- editor/plugins/line_2d_editor_plugin.cpp | 8 +- .../navigation_polygon_editor_plugin.cpp | 8 +- editor/plugins/polygon_2d_editor_plugin.cpp | 8 +- editor/property_editor.cpp | 2 +- main/main.cpp | 1 - main/tests/test_gdscript.cpp | 4 +- main/tests/test_gdscript.h | 2 +- main/tests/test_image.cpp | 2 +- main/tests/test_io.cpp | 4 +- main/tests/test_math.cpp | 2 +- main/tests/test_physics.cpp | 2 +- main/tests/test_physics_2d.cpp | 2 +- main/tests/test_render.cpp | 2 +- main/tests/test_shader_lang.cpp | 2 +- main/tests/test_string.cpp | 2 +- modules/bullet/area_bullet.cpp | 26 +-- modules/bullet/area_bullet.h | 14 +- modules/bullet/btRayShape.cpp | 6 +- modules/bullet/bullet_physics_server.cpp | 8 +- modules/bullet/collision_object_bullet.cpp | 15 +- modules/bullet/collision_object_bullet.h | 18 +- modules/bullet/cone_twist_joint_bullet.cpp | 4 +- modules/bullet/constraint_bullet.cpp | 5 +- modules/bullet/generic_6dof_joint_bullet.cpp | 4 +- .../bullet/godot_collision_configuration.cpp | 4 +- modules/bullet/godot_collision_dispatcher.cpp | 4 +- modules/bullet/godot_motion_state.h | 8 +- modules/bullet/godot_ray_world_algorithm.cpp | 20 +-- modules/bullet/godot_result_callbacks.h | 60 ++++--- modules/bullet/hinge_joint_bullet.cpp | 8 +- modules/bullet/joint_bullet.cpp | 4 +- modules/bullet/pin_joint_bullet.cpp | 4 +- modules/bullet/rigid_body_bullet.cpp | 38 ++-- modules/bullet/rigid_body_bullet.h | 4 +- modules/bullet/shape_bullet.cpp | 34 ++-- modules/bullet/slider_joint_bullet.cpp | 4 +- modules/bullet/soft_body_bullet.cpp | 14 +- modules/bullet/space_bullet.cpp | 53 +++--- modules/bullet/space_bullet.h | 4 +- .../gdnative/arvr/arvr_interface_gdnative.cpp | 2 +- modules/gdnative/gdnative.h | 4 +- .../gdnative/nativescript/api_generator.cpp | 2 - .../gdnative/nativescript/nativescript.cpp | 10 +- modules/gdnative/nativescript/nativescript.h | 12 +- .../pluginscript/pluginscript_language.cpp | 4 +- .../pluginscript/pluginscript_script.cpp | 7 +- modules/gdscript/gdscript.cpp | 6 +- modules/gdscript/gdscript_compiler.cpp | 2 +- modules/gdscript/gdscript_editor.cpp | 2 +- modules/gdscript/gdscript_function.cpp | 6 +- modules/gdscript/gdscript_tokenizer.cpp | 8 +- modules/mobile_vr/mobile_interface.cpp | 2 + modules/mono/csharp_script.cpp | 4 +- modules/mono/editor/csharp_project.cpp | 2 +- modules/mono/editor/csharp_project.h | 2 +- modules/mono/godotsharp_dirs.cpp | 2 +- modules/mono/godotsharp_dirs.h | 2 +- modules/mono/mono_gc_handle.cpp | 4 +- modules/mono/mono_gd/gd_mono_internals.cpp | 2 +- modules/mono/signal_awaiter_utils.cpp | 6 +- modules/mono/utils/mono_reg_utils.h | 2 +- modules/mono/utils/string_utils.cpp | 2 +- modules/pvr/texture_loader_pvr.cpp | 6 +- .../visual_script_flow_control.cpp | 6 +- modules/webm/video_stream_webm.cpp | 40 +++-- platform/android/power_android.cpp | 6 +- platform/haiku/haiku_application.cpp | 4 +- platform/haiku/haiku_direct_window.cpp | 4 +- platform/haiku/haiku_gl_view.cpp | 4 +- platform/haiku/os_haiku.cpp | 4 +- platform/haiku/power_haiku.cpp | 6 +- platform/iphone/export/export.cpp | 10 +- platform/iphone/os_iphone.cpp | 12 +- platform/iphone/power_iphone.cpp | 6 +- platform/javascript/dom_keys.h | 12 +- platform/javascript/power_javascript.cpp | 6 +- platform/osx/os_osx.mm | 2 +- platform/osx/power_osx.cpp | 6 +- platform/uwp/app.cpp | 18 +- platform/uwp/gl_context_egl.cpp | 14 +- platform/uwp/joypad_uwp.cpp | 6 +- platform/uwp/power_uwp.cpp | 6 +- platform/windows/crash_handler_win.cpp | 8 +- platform/windows/power_windows.cpp | 6 +- platform/x11/context_gl_x11.cpp | 4 +- platform/x11/os_x11.cpp | 7 +- platform/x11/power_x11.cpp | 6 +- scene/2d/area_2d.cpp | 4 +- scene/2d/canvas_item.cpp | 8 +- scene/2d/line_2d.cpp | 4 +- scene/2d/navigation2d.h | 6 +- scene/2d/physics_body_2d.cpp | 16 +- scene/2d/tile_map.h | 8 +- scene/3d/area.cpp | 4 +- scene/3d/gi_probe.cpp | 2 +- scene/3d/light.cpp | 8 +- scene/3d/light.h | 4 +- scene/3d/navigation.h | 6 +- scene/3d/particles.cpp | 4 +- scene/3d/physics_body.cpp | 16 +- scene/3d/spatial.cpp | 4 +- scene/3d/vehicle_body.cpp | 20 +-- scene/animation/tween_interpolaters.cpp | 22 +-- scene/gui/box_container.h | 8 +- scene/gui/check_box.cpp | 4 +- scene/gui/color_picker.cpp | 4 +- scene/gui/scroll_bar.h | 8 +- scene/gui/slider.h | 8 +- scene/gui/split_container.h | 8 +- scene/main/scene_tree.cpp | 2 + scene/main/scene_tree.h | 4 +- scene/resources/box_shape.cpp | 4 +- scene/resources/capsule_shape.cpp | 4 +- scene/resources/capsule_shape_2d.cpp | 4 +- scene/resources/circle_shape_2d.cpp | 4 +- scene/resources/concave_polygon_shape.cpp | 4 +- scene/resources/concave_polygon_shape_2d.cpp | 4 +- scene/resources/convex_polygon_shape.cpp | 4 +- scene/resources/convex_polygon_shape_2d.cpp | 4 +- scene/resources/material.cpp | 4 +- scene/resources/plane_shape.cpp | 4 +- scene/resources/ray_shape.cpp | 4 +- scene/resources/rectangle_shape_2d.cpp | 4 +- scene/resources/segment_shape_2d.cpp | 8 +- scene/resources/shape_line_2d.cpp | 4 +- scene/resources/sphere_shape.cpp | 4 +- scene/resources/tile_set.h | 10 +- servers/audio/effects/audio_effect_eq.h | 12 +- servers/audio/effects/audio_effect_filter.h | 28 +-- servers/audio/reverb_sw.cpp | 8 +- servers/physics/area_sw.cpp | 6 +- servers/physics/body_pair_sw.cpp | 4 +- servers/physics/body_sw.cpp | 7 +- servers/physics/collision_object_sw.cpp | 4 +- servers/physics/collision_solver_sat.cpp | 3 +- .../physics/joints/cone_twist_joint_sw.cpp | 4 +- .../physics/joints/generic_6dof_joint_sw.cpp | 8 +- servers/physics/joints/hinge_joint_sw.cpp | 8 +- servers/physics/joints/jacobian_entry_sw.h | 18 +- servers/physics/joints/pin_joint_sw.cpp | 4 +- servers/physics/joints/slider_joint_sw.cpp | 6 +- servers/physics/joints_sw.h | 4 +- servers/physics_2d/area_2d_sw.cpp | 6 +- servers/physics_2d/body_2d_sw.cpp | 7 +- servers/physics_2d/body_pair_2d_sw.cpp | 6 +- servers/physics_2d/joints_2d_sw.cpp | 12 +- servers/physics_2d/joints_2d_sw.h | 4 +- .../physics_2d/physics_2d_server_wrap_mt.cpp | 4 +- servers/physics_2d_server.h | 15 +- servers/physics_server.h | 15 +- servers/visual/rasterizer.h | 4 +- servers/visual/visual_server_raster.h | 9 +- servers/visual/visual_server_scene.cpp | 11 +- servers/visual/visual_server_scene.h | 13 +- servers/visual/visual_server_wrap_mt.cpp | 4 +- servers/visual/visual_server_wrap_mt.h | 2 +- 199 files changed, 954 insertions(+), 875 deletions(-) mode change 100755 => 100644 main/main.cpp diff --git a/core/class_db.h b/core/class_db.h index 24db4c61bb8..b8b681301d3 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -49,10 +49,10 @@ struct MethodDefinition { StringName name; Vector args; MethodDefinition() {} - MethodDefinition(const char *p_name) - : name(p_name) {} - MethodDefinition(const StringName &p_name) - : name(p_name) {} + MethodDefinition(const char *p_name) : + name(p_name) {} + MethodDefinition(const StringName &p_name) : + name(p_name) {} }; MethodDefinition D_METHOD(const char *p_name); diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index feee39225ff..3091c806071 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -31,22 +31,22 @@ CoreStringNames *CoreStringNames::singleton = NULL; -CoreStringNames::CoreStringNames() - : _free(StaticCString::create("free")), - changed(StaticCString::create("changed")), - _meta(StaticCString::create("__meta__")), - _script(StaticCString::create("script")), - script_changed(StaticCString::create("script_changed")), - ___pdcdata(StaticCString::create("___pdcdata")), - __getvar(StaticCString::create("__getvar")), - _iter_init(StaticCString::create("_iter_init")), - _iter_next(StaticCString::create("_iter_next")), - _iter_get(StaticCString::create("_iter_get")), - get_rid(StaticCString::create("get_rid")), +CoreStringNames::CoreStringNames() : + _free(StaticCString::create("free")), + changed(StaticCString::create("changed")), + _meta(StaticCString::create("__meta__")), + _script(StaticCString::create("script")), + script_changed(StaticCString::create("script_changed")), + ___pdcdata(StaticCString::create("___pdcdata")), + __getvar(StaticCString::create("__getvar")), + _iter_init(StaticCString::create("_iter_init")), + _iter_next(StaticCString::create("_iter_next")), + _iter_get(StaticCString::create("_iter_get")), + get_rid(StaticCString::create("get_rid")), #ifdef TOOLS_ENABLED - _sections_unfolded(StaticCString::create("_sections_unfolded")), + _sections_unfolded(StaticCString::create("_sections_unfolded")), #endif - _custom_features(StaticCString::create("_custom_features")) { + _custom_features(StaticCString::create("_custom_features")) { x = StaticCString::create("x"); y = StaticCString::create("y"); diff --git a/core/dvector.h b/core/dvector.h index 1b81ceec5e5..66bf0e78620 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -149,7 +149,7 @@ class PoolVector { } if (old_alloc->refcount.unref() == true) { -//this should never happen but.. + //this should never happen but.. #ifdef DEBUG_ENABLED MemoryPool::alloc_mutex->lock(); diff --git a/core/engine.h b/core/engine.h index 4a573c15398..1becebe34ac 100644 --- a/core/engine.h +++ b/core/engine.h @@ -41,9 +41,9 @@ public: struct Singleton { StringName name; Object *ptr; - Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) - : name(p_name), - ptr(p_ptr) { + Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) : + name(p_name), + ptr(p_ptr) { } }; diff --git a/core/global_constants.cpp b/core/global_constants.cpp index fb432b85db0..a8f6e4da6ce 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -45,15 +45,15 @@ struct _GlobalConstant { _GlobalConstant() {} #ifdef DEBUG_METHODS_ENABLED - _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) - : enum_name(p_enum_name), - name(p_name), - value(p_value) { + _GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) : + enum_name(p_enum_name), + name(p_name), + value(p_value) { } #else - _GlobalConstant(const char *p_name, int p_value) - : name(p_name), - value(p_value) { + _GlobalConstant(const char *p_name, int p_value) : + name(p_name), + value(p_value) { } #endif }; diff --git a/core/hash_map.h b/core/hash_map.h index e100d7a9044..a53cb53c84c 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -63,9 +63,9 @@ public: TData data; Pair() {} - Pair(const TKey &p_key, const TData &p_data) - : key(p_key), - data(p_data) { + Pair(const TKey &p_key, const TData &p_data) : + key(p_key), + data(p_data) { } }; diff --git a/core/helper/math_fieldwise.cpp b/core/helper/math_fieldwise.cpp index 27acd40cd8b..9e5eab2ee82 100644 --- a/core/helper/math_fieldwise.cpp +++ b/core/helper/math_fieldwise.cpp @@ -44,10 +44,10 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const ERR_FAIL_COND_V(p_target.get_type() != p_source.get_type(), p_target); - switch (p_source.get_type()) { + /* clang-format makes a mess of this macro usage */ + /* clang-format off */ - /* clang-format makes a mess of this macro usage */ - /* clang-format off */ + switch (p_source.get_type()) { case Variant::VECTOR2: { @@ -174,9 +174,8 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const default: { ERR_FAIL_V(p_target); } - - /* clang-format on */ } + /* clang-format on */ } #endif // TOOLS_ENABLED diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index a7eb8ce6a92..c46e645ed8d 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -313,9 +313,9 @@ bool FileAccessPack::file_exists(const String &p_name) { return false; } -FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) - : pf(p_file), - f(FileAccess::open(pf.pack, FileAccess::READ)) { +FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) : + pf(p_file), + f(FileAccess::open(pf.pack, FileAccess::READ)) { if (!f) { ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack)); ERR_FAIL_COND(!f); diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index be49e05be0d..7dd3468c48e 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -159,8 +159,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int r_variant = str; } break; - // math types + // math types case Variant::VECTOR2: { ERR_FAIL_COND_V(len < (int)4 * 2, ERR_INVALID_DATA); @@ -959,8 +959,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo _encode_string(p_variant, buf, r_len); } break; - // math types + // math types case Variant::VECTOR2: { if (buf) { diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 28489b5d34c..166fff85cfd 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -90,9 +90,9 @@ public: PropertyInfo option; Variant default_value; - ImportOption(const PropertyInfo &p_info, const Variant &p_default) - : option(p_info), - default_value(p_default) { + ImportOption(const PropertyInfo &p_info, const Variant &p_default) : + option(p_info), + default_value(p_default) { } ImportOption() {} }; diff --git a/core/math/a_star.h b/core/math/a_star.h index b7b7e541255..1f13f4fae86 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -59,8 +59,8 @@ class AStar : public Reference { Point *prev_point; real_t distance; - Point() - : list(this) {} + Point() : + list(this) {} }; Map points; diff --git a/core/math/aabb.h b/core/math/aabb.h index c60213496a5..c5ba79e1720 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -101,9 +101,9 @@ public: operator String() const; _FORCE_INLINE_ AABB() {} - inline AABB(const Vector3 &p_pos, const Vector3 &p_size) - : position(p_pos), - size(p_size) { + inline AABB(const Vector3 &p_pos, const Vector3 &p_size) : + position(p_pos), + size(p_size) { } }; diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index bdc040160f9..ecda7775837 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -577,11 +577,11 @@ BSP_Tree::BSP_Tree(const PoolVector &p_faces, real_t p_error_radius) { error_radius = p_error_radius; } -BSP_Tree::BSP_Tree(const Vector &p_nodes, const Vector &p_planes, const AABB &p_aabb, real_t p_error_radius) - : nodes(p_nodes), - planes(p_planes), - aabb(p_aabb), - error_radius(p_error_radius) { +BSP_Tree::BSP_Tree(const Vector &p_nodes, const Vector &p_planes, const AABB &p_aabb, real_t p_error_radius) : + nodes(p_nodes), + planes(p_planes), + aabb(p_aabb), + error_radius(p_error_radius) { } BSP_Tree::~BSP_Tree() { diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 2335b458bff..7e586a1fd26 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -195,9 +195,8 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const { if (!p_aabb.intersects_plane(get_plane())) return false; -/** TEST FACE AXIS */ - #define TEST_AXIS(m_ax) \ + /** TEST FACE AXIS */ \ { \ real_t aabb_min = p_aabb.position.m_ax; \ real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \ diff --git a/core/math/math_2d.h b/core/math/math_2d.h index d215df8a435..d788318f5e5 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -385,13 +385,13 @@ struct Rect2 { operator String() const { return String(position) + ", " + String(size); } Rect2() {} - Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) - : position(Point2(p_x, p_y)), - size(Size2(p_width, p_height)) { + Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) : + position(Point2(p_x, p_y)), + size(Size2(p_width, p_height)) { } - Rect2(const Point2 &p_pos, const Size2 &p_size) - : position(p_pos), - size(p_size) { + Rect2(const Point2 &p_pos, const Size2 &p_size) : + position(p_pos), + size(p_size) { } }; @@ -578,18 +578,18 @@ struct Rect2i { operator String() const { return String(position) + ", " + String(size); } operator Rect2() const { return Rect2(position, size); } - Rect2i(const Rect2 &p_r2) - : position(p_r2.position), - size(p_r2.size) { + Rect2i(const Rect2 &p_r2) : + position(p_r2.position), + size(p_r2.size) { } Rect2i() {} - Rect2i(int p_x, int p_y, int p_width, int p_height) - : position(Point2(p_x, p_y)), - size(Size2(p_width, p_height)) { + Rect2i(int p_x, int p_y, int p_width, int p_height) : + position(Point2(p_x, p_y)), + size(Size2(p_width, p_height)) { } - Rect2i(const Point2 &p_pos, const Size2 &p_size) - : position(p_pos), - size(p_size) { + Rect2i(const Point2 &p_pos, const Size2 &p_size) : + position(p_pos), + size(p_size) { } }; diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index bc0b3717ed2..80e5805451a 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -272,7 +272,7 @@ public: #elif defined(_MSC_VER) && _MSC_VER < 1800 __asm fld a __asm fistp b -/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) + /*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) // use AT&T inline assembly style, document that // we use memory as output (=m) and input (m) __asm__ __volatile__ ( diff --git a/core/math/plane.h b/core/math/plane.h index 559a735817c..1d02b5d523b 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -74,9 +74,9 @@ public: operator String() const; _FORCE_INLINE_ Plane() { d = 0; } - _FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) - : normal(p_a, p_b, p_c), - d(p_d){}; + _FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) : + normal(p_a, p_b, p_c), + d(p_d){}; _FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d); _FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal); @@ -100,14 +100,14 @@ bool Plane::has_point(const Vector3 &p_point, real_t _epsilon) const { return (dist <= _epsilon); } -Plane::Plane(const Vector3 &p_normal, real_t p_d) - : normal(p_normal), - d(p_d) { +Plane::Plane(const Vector3 &p_normal, real_t p_d) : + normal(p_normal), + d(p_d) { } -Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) - : normal(p_normal), - d(p_normal.dot(p_point)) { +Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) : + normal(p_normal), + d(p_normal.dot(p_point)) { } Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir) { diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 638a39ab731..fb4ca16565b 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -208,7 +208,7 @@ Transform::operator String() const { return basis.operator String() + " - " + origin.operator String(); } -Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) - : basis(p_basis), - origin(p_origin) { +Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) : + basis(p_basis), + origin(p_origin) { } diff --git a/core/object.cpp b/core/object.cpp index 1be7337d96d..cf1472243ba 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -126,9 +126,9 @@ MethodInfo::operator Dictionary() const { return d; } -MethodInfo::MethodInfo() - : flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo() : + flags(METHOD_FLAG_NORMAL), + id(0) { } MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) { @@ -164,48 +164,48 @@ MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) { return mi; } -MethodInfo::MethodInfo(const String &p_name) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); arguments.push_back(p_param4); } -MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); @@ -213,48 +213,48 @@ MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const arguments.push_back(p_param5); } -MethodInfo::MethodInfo(Variant::Type ret) - : flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret) : + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); @@ -262,10 +262,10 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn arguments.push_back(p_param4); } -MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + id(0) { return_val.type = ret; arguments.push_back(p_param1); arguments.push_back(p_param2); @@ -274,56 +274,56 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn arguments.push_back(p_param5); } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) - : name(p_name), - flags(METHOD_FLAG_NORMAL), - return_val(p_ret), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) : + name(p_name), + flags(METHOD_FLAG_NORMAL), + return_val(p_ret), + id(0) { } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1) - : name(p_name), - return_val(p_ret), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1) : + name(p_name), + return_val(p_ret), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) - : name(p_name), - return_val(p_ret), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : + name(p_name), + return_val(p_ret), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) - : name(p_name), - return_val(p_ret), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) : + name(p_name), + return_val(p_ret), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) - : name(p_name), - return_val(p_ret), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) : + name(p_name), + return_val(p_ret), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); arguments.push_back(p_param4); } -MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) - : name(p_name), - return_val(p_ret), - flags(METHOD_FLAG_NORMAL), - id(0) { +MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) : + name(p_name), + return_val(p_ret), + flags(METHOD_FLAG_NORMAL), + id(0) { arguments.push_back(p_param1); arguments.push_back(p_param2); arguments.push_back(p_param3); diff --git a/core/object.h b/core/object.h index 0a0c781649a..3d939532275 100644 --- a/core/object.h +++ b/core/object.h @@ -1,4 +1,4 @@ -/*************************************************************************/ +/*************************************************************************/ /* object.h */ /*************************************************************************/ /* This file is part of: */ @@ -144,18 +144,18 @@ struct PropertyInfo { static PropertyInfo from_dict(const Dictionary &p_dict); - PropertyInfo() - : type(Variant::NIL), - hint(PROPERTY_HINT_NONE), - usage(PROPERTY_USAGE_DEFAULT) { + PropertyInfo() : + type(Variant::NIL), + hint(PROPERTY_HINT_NONE), + usage(PROPERTY_USAGE_DEFAULT) { } - PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) - : type(p_type), - name(p_name), - hint(p_hint), - hint_string(p_hint_string), - usage(p_usage) { + PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) : + type(p_type), + name(p_name), + hint(p_hint), + hint_string(p_hint_string), + usage(p_usage) { if (hint == PROPERTY_HINT_RESOURCE_TYPE) { class_name = hint_string; @@ -164,11 +164,11 @@ struct PropertyInfo { } } - PropertyInfo(const StringName &p_class_name) - : type(Variant::OBJECT), - class_name(p_class_name), - hint(PROPERTY_HINT_NONE), - usage(PROPERTY_USAGE_DEFAULT) { + PropertyInfo(const StringName &p_class_name) : + type(Variant::OBJECT), + class_name(p_class_name), + hint(PROPERTY_HINT_NONE), + usage(PROPERTY_USAGE_DEFAULT) { } bool operator<(const PropertyInfo &p_info) const { @@ -428,9 +428,9 @@ private: _FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); } - Target(const ObjectID &p_id, const StringName &p_method) - : _id(p_id), - method(p_method) { + Target(const ObjectID &p_id, const StringName &p_method) : + _id(p_id), + method(p_method) { } Target() { _id = 0; } }; diff --git a/core/ordered_hash_map.h b/core/ordered_hash_map.h index 1ed5a5d3693..fed16809e68 100644 --- a/core/ordered_hash_map.h +++ b/core/ordered_hash_map.h @@ -68,8 +68,10 @@ public: } public: - _FORCE_INLINE_ Element() - : list_element(NULL), prev_element(NULL), next_element(NULL) { + _FORCE_INLINE_ Element() : + list_element(NULL), + prev_element(NULL), + next_element(NULL) { } Element next() const { @@ -80,10 +82,10 @@ public: return Element(prev_element); } - Element(const Element &other) - : list_element(other.list_element), - prev_element(other.prev_element), - next_element(other.next_element) { + Element(const Element &other) : + list_element(other.list_element), + prev_element(other.prev_element), + next_element(other.next_element) { } Element &operator=(const Element &other) { @@ -135,17 +137,17 @@ public: const typename InternalList::Element *list_element; - ConstElement(const typename InternalList::Element *p_element) - : list_element(p_element) { + ConstElement(const typename InternalList::Element *p_element) : + list_element(p_element) { } public: - _FORCE_INLINE_ ConstElement() - : list_element(NULL) { + _FORCE_INLINE_ ConstElement() : + list_element(NULL) { } - ConstElement(const ConstElement &other) - : list_element(other.list_element) { + ConstElement(const ConstElement &other) : + list_element(other.list_element) { } ConstElement &operator=(const ConstElement &other) { diff --git a/core/pair.h b/core/pair.h index 535c3355b65..aa51b77a4f0 100644 --- a/core/pair.h +++ b/core/pair.h @@ -37,9 +37,9 @@ struct Pair { S second; Pair() {} - Pair(F p_first, const S &p_second) - : first(p_first), - second(p_second) { + Pair(F p_first, const S &p_second) : + first(p_first), + second(p_second) { } }; diff --git a/core/project_settings.h b/core/project_settings.h index 1c4078cebb4..d8a1ea1f7a7 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -58,18 +58,18 @@ protected: Variant initial; bool hide_from_editor; bool overrided; - VariantContainer() - : order(0), - persist(false), - hide_from_editor(false), - overrided(false) { + VariantContainer() : + order(0), + persist(false), + hide_from_editor(false), + overrided(false) { } - VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) - : order(p_order), - persist(p_persist), - variant(p_variant), - hide_from_editor(false), - overrided(false) { + VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) : + order(p_order), + persist(p_persist), + variant(p_variant), + hide_from_editor(false), + overrided(false) { } }; diff --git a/core/resource.cpp b/core/resource.cpp index d339eb78ad6..be6da792ad9 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -378,8 +378,8 @@ void Resource::_bind_methods() { BIND_VMETHOD(MethodInfo("_setup_local_to_scene")); } -Resource::Resource() - : remapped_list(this) { +Resource::Resource() : + remapped_list(this) { #ifdef TOOLS_ENABLED last_modified_time = 0; diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index c9acdb79706..908c8a34b5c 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -57,7 +57,7 @@ return m_val; \ } -_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw) { +_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw){ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t) } @@ -82,12 +82,12 @@ _ALWAYS_INLINE_ uint32_t _atomic_add_impl(register uint32_t *pw, register uint32 return InterlockedAdd((LONG volatile *)pw, val); } -_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val) { +_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val){ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t) } -_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw) { +_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw){ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t) } @@ -112,7 +112,7 @@ _ALWAYS_INLINE_ uint64_t _atomic_add_impl(register uint64_t *pw, register uint64 return InterlockedAdd64((LONGLONG volatile *)pw, val); } -_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val) { +_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val){ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t) } diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 495c99c122d..658b72b47ad 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -989,25 +989,25 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL; -ScriptDebuggerRemote::ScriptDebuggerRemote() - : profiling(false), - max_frame_functions(16), - skip_profile_frame(false), - reload_all_scripts(false), - tcp_client(StreamPeerTCP::create_ref()), - packet_peer_stream(Ref(memnew(PacketPeerStream))), - last_perf_time(0), - performance(Engine::get_singleton()->get_singleton_object("Performance")), - requested_quit(false), - mutex(Mutex::create()), - max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), - char_count(0), - last_msec(0), - msec_count(0), - locking(false), - poll_every(0), - request_scene_tree(NULL), - live_edit_funcs(NULL) { +ScriptDebuggerRemote::ScriptDebuggerRemote() : + profiling(false), + max_frame_functions(16), + skip_profile_frame(false), + reload_all_scripts(false), + tcp_client(StreamPeerTCP::create_ref()), + packet_peer_stream(Ref(memnew(PacketPeerStream))), + last_perf_time(0), + performance(Engine::get_singleton()->get_singleton_object("Performance")), + requested_quit(false), + mutex(Mutex::create()), + max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), + char_count(0), + last_msec(0), + msec_count(0), + locking(false), + poll_every(0), + request_scene_tree(NULL), + live_edit_funcs(NULL) { packet_peer_stream->set_stream_peer(tcp_client); packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough diff --git a/core/script_language.cpp b/core/script_language.cpp index 384e41e4bd7..c1e9d558726 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -387,10 +387,10 @@ void PlaceHolderScriptInstance::update(const List &p_properties, c //change notify } -PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref