From d83761ba80b90e17aaefaa83c7ece0fa89511266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 5 Apr 2021 14:09:59 +0200 Subject: Style: Apply clang-tidy's `readability-braces-around-statements` --- servers/physics_3d/step_3d_sw.cpp | 3 ++- .../renderer_rd/renderer_scene_render_forward_clustered.cpp | 3 ++- servers/rendering/renderer_rd/renderer_storage_rd.cpp | 10 ++++++---- servers/rendering/shader_language.cpp | 8 +++++--- 4 files changed, 15 insertions(+), 9 deletions(-) (limited to 'servers') diff --git a/servers/physics_3d/step_3d_sw.cpp b/servers/physics_3d/step_3d_sw.cpp index c517ec9d3d..2133a38670 100644 --- a/servers/physics_3d/step_3d_sw.cpp +++ b/servers/physics_3d/step_3d_sw.cpp @@ -229,8 +229,9 @@ void Step3DSW::step(Space3DSW *p_space, real_t p_delta, int p_iterations) { while (sb) { for (const Set::Element *E = sb->self()->get_constraints().front(); E; E = E->next()) { Constraint3DSW *c = E->get(); - if (c->get_island_step() == _step) + if (c->get_island_step() == _step) { continue; + } c->set_island_step(_step); c->set_island_next(nullptr); c->set_island_list_next(constraint_island_list); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp index 7a19495f48..b98aee611a 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp @@ -3022,8 +3022,9 @@ void RendererSceneRenderForwardClustered::_geometry_instance_update(GeometryInst for (int j = 0; j < draw_passes; j++) { RID mesh = storage->particles_get_draw_pass_mesh(ginstance->data->base, j); - if (!mesh.is_valid()) + if (!mesh.is_valid()) { continue; + } const RID *materials = nullptr; uint32_t surface_count; diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index ba5ace8f31..b984f850a0 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -4692,10 +4692,11 @@ void RendererStorageRD::update_particles() { if (particles->clear && particles->pre_process_time > 0.0) { float frame_time; - if (particles->fixed_fps > 0) + if (particles->fixed_fps > 0) { frame_time = 1.0 / particles->fixed_fps; - else + } else { frame_time = 1.0 / 30.0; + } float todo = particles->pre_process_time; @@ -4731,10 +4732,11 @@ void RendererStorageRD::update_particles() { particles->frame_remainder = todo; } else { - if (zero_time_scale) + if (zero_time_scale) { _particles_process(particles, 0.0); - else + } else { _particles_process(particles, RendererCompositorRD::singleton->get_frame_delta_time()); + } } //copy particles to instance buffer diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index bab251beb2..4ae0eda232 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -6932,10 +6932,11 @@ Error ShaderLanguage::_parse_shader(const Map &p_funct decl.initializer.push_back(n); break; } else { - if (curly) + if (curly) { _set_error("Expected '}' or ','"); - else + } else { _set_error("Expected ')' or ','"); + } return ERR_PARSE_ERROR; } } @@ -6962,8 +6963,9 @@ Error ShaderLanguage::_parse_shader(const Map &p_funct } else { //variable created with assignment! must parse an expression Node *expr = _parse_and_reduce_expression(nullptr, FunctionInfo()); - if (!expr) + if (!expr) { return ERR_PARSE_ERROR; + } if (expr->type == Node::TYPE_OPERATOR && ((OperatorNode *)expr)->op == OP_CALL) { _set_error("Expected constant expression after '='"); return ERR_PARSE_ERROR; -- cgit v1.2.3