From dcd1151d77cd5579bdd003a933bca86690ed4f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 11:00:19 +0200 Subject: Enforce use of bool literals instead of integers Using clang-tidy's `modernize-use-bool-literals`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html --- .clang-tidy | 6 ++++-- core/image.cpp | 14 +++++++------- core/io/http_client.cpp | 2 +- core/oa_hash_map.h | 4 ++-- drivers/png/png_driver_common.cpp | 2 +- drivers/unix/net_socket_posix.h | 2 +- editor/animation_track_editor.cpp | 2 +- editor/debugger/editor_profiler.cpp | 2 +- editor/debugger/editor_visual_profiler.cpp | 2 +- editor/editor_export.cpp | 2 +- editor/editor_help.cpp | 8 ++++---- editor/plugins/curve_editor_plugin.cpp | 2 +- editor/plugins/editor_preview_plugins.cpp | 4 ++-- editor/plugins/mesh_library_editor_plugin.cpp | 2 +- editor/plugins/node_3d_editor_plugin.cpp | 2 +- modules/bmp/image_loader_bmp.cpp | 4 ++-- modules/bullet/space_bullet.cpp | 6 +++--- modules/glslang/register_types.cpp | 18 +++++++++--------- modules/gridmap/grid_map_editor_plugin.cpp | 4 ++-- modules/jpg/image_loader_jpegd.cpp | 2 +- modules/pvr/texture_loader_pvr.cpp | 4 ++-- modules/tga/image_loader_tga.cpp | 2 +- .../visual_script/visual_script_property_selector.cpp | 6 +++--- modules/webp/image_loader_webp.cpp | 2 +- scene/2d/polygon_2d.cpp | 2 +- scene/resources/material.cpp | 2 +- servers/physics_2d/space_2d_sw.cpp | 2 +- servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp | 2 +- servers/physics_3d/physics_server_3d_sw.h | 2 +- servers/physics_3d/space_3d_sw.cpp | 2 +- .../rendering/rasterizer_rd/rasterizer_storage_rd.cpp | 2 +- 31 files changed, 60 insertions(+), 58 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index e99b105335..16fe7d2ca0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,modernize-use-default-member-init,modernize-use-nullptr' +Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-nullptr' WarningsAsErrors: '' HeaderFilterRegex: '.*' AnalyzeTemporaryDtors: false @@ -32,8 +32,10 @@ CheckOptions: value: llvm - key: modernize-replace-auto-ptr.IncludeStyle value: llvm + - key: modernize-use-bool-literals.IgnoreMacros + value: '0' - key: modernize-use-default-member-init.IgnoreMacros - value: '1' + value: '0' - key: modernize-use-default-member-init.UseAssignment value: '1' - key: modernize-use-nullptr.NullMacros diff --git a/core/image.cpp b/core/image.cpp index 277f6e9bf0..c88ed7e3cb 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -474,7 +474,7 @@ void Image::convert(Format p_new_format) { } else if (format > FORMAT_RGBA8 || p_new_format > FORMAT_RGBA8) { //use put/set pixel which is slower but works with non byte formats - Image new_img(width, height, 0, p_new_format); + Image new_img(width, height, false, p_new_format); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { @@ -492,7 +492,7 @@ void Image::convert(Format p_new_format) { return; } - Image new_img(width, height, 0, p_new_format); + Image new_img(width, height, false, p_new_format); const uint8_t *rptr = data.ptr(); uint8_t *wptr = new_img.data.ptrw(); @@ -991,7 +991,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) { if (p_width == width && p_height == height) return; - Image dst(p_width, p_height, 0, format); + Image dst(p_width, p_height, false, format); // Setup mipmap-aware scaling Image dst2; @@ -1011,7 +1011,7 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) { } bool interpolate_mipmaps = mipmap_aware && mip1 != mip2; if (interpolate_mipmaps) { - dst2.create(p_width, p_height, 0, format); + dst2.create(p_width, p_height, false, format); } bool had_mipmaps = mipmaps; @@ -1304,7 +1304,7 @@ void Image::crop_from_point(int p_x, int p_y, int p_width, int p_height) { uint8_t pdata[16]; //largest is 16 uint32_t pixel_size = get_format_pixel_size(format); - Image dst(p_width, p_height, 0, format); + Image dst(p_width, p_height, false, format); { const uint8_t *r = data.ptr(); @@ -2157,7 +2157,7 @@ void Image::create(const char **p_xpm) { if (line == colormap_size) { status = READING_PIXELS; - create(size_width, size_height, 0, has_alpha ? FORMAT_RGBA8 : FORMAT_RGB8); + create(size_width, size_height, false, has_alpha ? FORMAT_RGBA8 : FORMAT_RGB8); w = data.ptrw(); pixel_size = has_alpha ? 4 : 3; } @@ -3329,7 +3329,7 @@ Ref Image::rgbe_to_srgb() { Ref new_image; new_image.instance(); - new_image->create(width, height, 0, Image::FORMAT_RGB8); + new_image->create(width, height, false, Image::FORMAT_RGB8); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 672569c5db..940bac0009 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -283,7 +283,7 @@ void HTTPClient::close() { body_size = -1; body_left = 0; chunk_left = 0; - chunk_trailer_part = 0; + chunk_trailer_part = false; read_until_eof = false; response_num = 0; handshaking = false; diff --git a/core/oa_hash_map.h b/core/oa_hash_map.h index f7c31f8aae..b4d9ce4d51 100644 --- a/core/oa_hash_map.h +++ b/core/oa_hash_map.h @@ -90,7 +90,7 @@ private: uint32_t pos = hash % capacity; uint32_t distance = 0; - while (42) { + while (true) { if (hashes[pos] == EMPTY_HASH) { return false; } @@ -118,7 +118,7 @@ private: TKey key = p_key; TValue value = p_value; - while (42) { + while (true) { if (hashes[pos] == EMPTY_HASH) { _construct(pos, hash, key, value); diff --git a/drivers/png/png_driver_common.cpp b/drivers/png/png_driver_common.cpp index f17abcb54c..3f9c824e93 100644 --- a/drivers/png/png_driver_common.cpp +++ b/drivers/png/png_driver_common.cpp @@ -115,7 +115,7 @@ Error png_to_image(const uint8_t *p_source, size_t p_size, Ref p_image) { ERR_FAIL_COND_V(!success, ERR_FILE_CORRUPT); //print_line("png width: "+itos(png_img.width)+" height: "+itos(png_img.height)); - p_image->create(png_img.width, png_img.height, 0, dest_format, buffer); + p_image->create(png_img.width, png_img.height, false, dest_format, buffer); return OK; } diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index 2e767eef92..4e1fedfcb0 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -47,7 +47,7 @@ class NetSocketPosix : public NetSocket { private: - SOCKET_TYPE _sock; + SOCKET_TYPE _sock; // NOLINT - the default value is defined in the .cpp IP::Type _ip_type = IP::TYPE_NONE; bool _is_stream = false; diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index da81732a01..4a43cb0c18 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5955,7 +5955,7 @@ AnimationTrackEditor::AnimationTrackEditor() { insert_confirm_bezier->set_text(TTR("Use Bezier Curves")); icvb->add_child(insert_confirm_bezier); keying = false; - moving_selection = 0; + moving_selection = false; key_edit = nullptr; multi_key_edit = nullptr; diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index c7d4e9128a..347de2470b 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -344,7 +344,7 @@ void EditorProfiler::_update_plot() { Ref img; img.instance(); - img->create(w, h, 0, Image::FORMAT_RGBA8, graph_image); + img->create(w, h, false, Image::FORMAT_RGBA8, graph_image); if (reset_texture) { diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 7d2822b1c9..589ef0d64e 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -307,7 +307,7 @@ void EditorVisualProfiler::_update_plot() { Ref img; img.instance(); - img->create(w, h, 0, Image::FORMAT_RGBA8, graph_image); + img->create(w, h, false, Image::FORMAT_RGBA8, graph_image); if (reset_texture) { diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 62996caa3d..abfd8e5484 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -864,7 +864,7 @@ Error EditorExportPlatform::export_project_files(const Ref & ProjectSettings::CustomMap custom_map; if (path_remaps.size()) { - if (1) { //new remap mode, use always as it's friendlier with multiple .pck exports + if (true) { //new remap mode, use always as it's friendlier with multiple .pck exports for (int i = 0; i < path_remaps.size(); i += 2) { String from = path_remaps[i]; String to = path_remaps[i + 1]; diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index b2bcab4717..6c5e8e17e4 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -526,7 +526,7 @@ void EditorHelp::_update_doc() { class_desc->push_font(doc_code_font); class_desc->push_indent(1); class_desc->push_table(2); - class_desc->set_table_column_expand(1, 1); + class_desc->set_table_column_expand(1, true); for (int i = 0; i < cd.properties.size(); i++) { property_line[cd.properties[i].name] = class_desc->get_line_count() - 2; //gets overridden if description @@ -629,7 +629,7 @@ void EditorHelp::_update_doc() { class_desc->push_font(doc_code_font); class_desc->push_indent(1); class_desc->push_table(2); - class_desc->set_table_column_expand(1, 1); + class_desc->set_table_column_expand(1, true); bool any_previous = false; for (int pass = 0; pass < 2; pass++) { @@ -698,7 +698,7 @@ void EditorHelp::_update_doc() { class_desc->push_indent(1); class_desc->push_table(2); - class_desc->set_table_column_expand(1, 1); + class_desc->set_table_column_expand(1, true); for (int i = 0; i < cd.theme_properties.size(); i++) { @@ -1005,7 +1005,7 @@ void EditorHelp::_update_doc() { property_line[cd.properties[i].name] = class_desc->get_line_count() - 2; class_desc->push_table(2); - class_desc->set_table_column_expand(1, 1); + class_desc->set_table_column_expand(1, true); class_desc->push_cell(); class_desc->push_font(doc_code_font); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 9b5c6bae3b..fc8eef52c0 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -797,7 +797,7 @@ Ref CurvePreviewGenerator::generate(const Ref &p_from, cons img_ref.instance(); Image &im = **img_ref; - im.create(thumbnail_size, thumbnail_size / 2, 0, Image::FORMAT_RGBA8); + im.create(thumbnail_size, thumbnail_size / 2, false, Image::FORMAT_RGBA8); Color bg_color(0.1, 0.1, 0.1, 1.0); for (int i = 0; i < thumbnail_size; i++) { diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index a8c4bddccf..2db0903f04 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -223,7 +223,7 @@ Ref EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size Ref img; img.instance(); - img->create(bm->get_size().width, bm->get_size().height, 0, Image::FORMAT_L8, data); + img->create(bm->get_size().width, bm->get_size().height, false, Image::FORMAT_L8, data); if (img->is_compressed()) { if (img->decompress() != OK) @@ -511,7 +511,7 @@ Ref EditorScriptPreviewPlugin::generate(const RES &p_from, const Size Ref img; img.instance(); int thumbnail_size = MAX(p_size.x, p_size.y); - img->create(thumbnail_size, thumbnail_size, 0, Image::FORMAT_RGBA8); + img->create(thumbnail_size, thumbnail_size, false, Image::FORMAT_RGBA8); Color bg_color = EditorSettings::get_singleton()->get("text_editor/highlighting/background_color"); Color keyword_color = EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"); diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index a3e3d88ae2..1ca8be528f 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -168,7 +168,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref p_library, //generate previews! - if (1) { + if (true) { Vector> meshes; Vector transforms; diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 69f8efa86e..1614f3f073 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3885,7 +3885,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito _edit.mode = TRANSFORM_NONE; _edit.plane = TRANSFORM_VIEW; _edit.edited_gizmo = 0; - _edit.snap = 1; + _edit.snap = true; _edit.gizmo_handle = 0; index = p_index; diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index ea2b2b548f..f69f3a43a4 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -153,7 +153,7 @@ Error ImageLoaderBMP::convert_to_image(Ref p_image, if (p_color_buffer == nullptr || color_table_size == 0) { // regular pixels - p_image->create(width, height, 0, Image::FORMAT_RGBA8, data); + p_image->create(width, height, false, Image::FORMAT_RGBA8, data); } else { // data is in indexed format, extend it @@ -193,7 +193,7 @@ Error ImageLoaderBMP::convert_to_image(Ref p_image, dest += 4; } - p_image->create(width, height, 0, Image::FORMAT_RGBA8, extended_data); + p_image->create(width, height, false, Image::FORMAT_RGBA8, extended_data); } } return err; diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index cc6ecbed07..aff203d7b4 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -205,7 +205,7 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf /// Returns the list of contacts pairs in this order: Local contact, other body contact bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &p_shape_xform, float p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) { if (p_result_max <= 0) - return 0; + return false; ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); @@ -213,7 +213,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform & if (!btShape->isConvex()) { bulletdelete(btShape); ERR_PRINT("The shape is not a convex shape, then is not supported: shape type: " + itos(shape->get_type())); - return 0; + return false; } btConvexShape *btConvex = static_cast(btShape); @@ -245,7 +245,7 @@ bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform &p_sh if (!btShape->isConvex()) { bulletdelete(btShape); ERR_PRINT("The shape is not a convex shape, then is not supported: shape type: " + itos(shape->get_type())); - return 0; + return false; } btConvexShape *btConvex = static_cast(btShape); diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp index 2540ba476c..5203460830 100644 --- a/modules/glslang/register_types.cpp +++ b/modules/glslang/register_types.cpp @@ -130,15 +130,15 @@ static const TBuiltInResource default_builtin_resource = { /*maxTaskWorkGroupSizeZ_NV*/ 0, /*maxMeshViewCountNV*/ 0, /*limits*/ { - /*nonInductiveForLoops*/ 1, - /*whileLoops*/ 1, - /*doWhileLoops*/ 1, - /*generalUniformIndexing*/ 1, - /*generalAttributeMatrixVectorIndexing*/ 1, - /*generalVaryingIndexing*/ 1, - /*generalSamplerIndexing*/ 1, - /*generalVariableIndexing*/ 1, - /*generalConstantMatrixVectorIndexing*/ 1, + /*nonInductiveForLoops*/ true, + /*whileLoops*/ true, + /*doWhileLoops*/ true, + /*generalUniformIndexing*/ true, + /*generalAttributeMatrixVectorIndexing*/ true, + /*generalVaryingIndexing*/ true, + /*generalSamplerIndexing*/ true, + /*generalVariableIndexing*/ true, + /*generalConstantMatrixVectorIndexing*/ true, } }; diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 9abbac6a0b..fc545430f5 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1405,8 +1405,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { Vector3 points[4]; for (int j = 0; j < 4; j++) { - static const bool orderx[4] = { 0, 1, 1, 0 }; - static const bool ordery[4] = { 0, 0, 1, 1 }; + static const bool orderx[4] = { false, true, true, false }; + static const bool ordery[4] = { false, false, true, true }; Vector3 sp; if (orderx[j]) { diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index 9e87d11ac1..1a2afeb5b9 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -96,7 +96,7 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p else fmt = Image::FORMAT_RGB8; - p_image->create(image_width, image_height, 0, fmt, data); + p_image->create(image_width, image_height, false, fmt, data); return OK; } diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index d28199420d..d498c6d858 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -261,9 +261,9 @@ struct PVRTCBlock { _FORCE_INLINE_ bool is_po2(uint32_t p_input) { if (p_input == 0) - return 0; + return false; uint32_t minus1 = p_input - 1; - return ((p_input | minus1) == (p_input ^ minus1)) ? 1 : 0; + return ((p_input | minus1) == (p_input ^ minus1)) ? true : false; } static void unpack_5554(const PVRTCBlock *p_block, int p_ab_colors[2][4]) { diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index fc9d727bb0..eb9f23d894 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -199,7 +199,7 @@ Error ImageLoaderTGA::convert_to_image(Ref p_image, const uint8_t *p_buff } } - p_image->create(width, height, 0, Image::FORMAT_RGBA8, image_data); + p_image->create(width, height, false, Image::FORMAT_RGBA8, image_data); return OK; } diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index f57853078d..b06cf513ba 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -172,7 +172,7 @@ void VisualScriptPropertySelector::_update_search() { item->set_metadata(0, F->get().name); item->set_icon(0, type_icons[F->get().type]); item->set_metadata(1, "get"); - item->set_collapsed(1); + item->set_collapsed(true); item->set_selectable(0, true); item->set_selectable(1, false); item->set_selectable(2, false); @@ -257,7 +257,7 @@ void VisualScriptPropertySelector::_update_search() { item->set_selectable(0, true); item->set_metadata(1, "method"); - item->set_collapsed(1); + item->set_collapsed(true); item->set_selectable(1, false); item->set_selectable(2, false); @@ -320,7 +320,7 @@ void VisualScriptPropertySelector::create_visualscript_item(const String &name, item->set_metadata(0, name); item->set_metadata(1, "action"); item->set_selectable(0, true); - item->set_collapsed(1); + item->set_collapsed(true); item->set_selectable(1, false); item->set_selectable(2, false); item->set_metadata(2, connecting); diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 0998977bb4..6c778d2809 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -135,7 +135,7 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p ERR_FAIL_COND_V_MSG(errdec, ERR_FILE_CORRUPT, "Failed decoding WebP image."); - p_image->create(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image); + p_image->create(features.width, features.height, false, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image); return OK; } diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 84c1828b47..cec598774e 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -723,7 +723,7 @@ void Polygon2D::_bind_methods() { Polygon2D::Polygon2D() { - invert = 0; + invert = false; invert_border = 100; antialiased = false; tex_rot = 0; diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index e3bed171b0..137657d239 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2690,7 +2690,7 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) : depth_draw_mode = DEPTH_DRAW_OPAQUE_ONLY; cull_mode = CULL_BACK; for (int i = 0; i < FLAG_MAX; i++) { - flags[i] = 0; + flags[i] = false; } flags[FLAG_USE_TEXTURE_REPEAT] = true; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 6bf6c4e3ad..46fe0afda6 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -311,7 +311,7 @@ bool PhysicsDirectSpaceState2DSW::cast_motion(const RID &p_shape, const Transfor bool PhysicsDirectSpaceState2DSW::collide_shape(RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, real_t p_margin, Vector2 *r_results, int p_result_max, int &r_result_count, const Set &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) { if (p_result_max <= 0) - return 0; + return false; Shape2DSW *shape = PhysicsServer2DSW::singletonsw->shape_owner.getornull(p_shape); ERR_FAIL_COND_V(!shape, 0); diff --git a/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp index ae5cffdfa8..d5a45e217a 100644 --- a/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp +++ b/servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp @@ -688,5 +688,5 @@ bool Generic6DOFJoint3DSW::get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOF break; // Can't happen, but silences warning } - return 0; + return false; } diff --git a/servers/physics_3d/physics_server_3d_sw.h b/servers/physics_3d/physics_server_3d_sw.h index 6e79d9eceb..481cb667c3 100644 --- a/servers/physics_3d/physics_server_3d_sw.h +++ b/servers/physics_3d/physics_server_3d_sw.h @@ -307,7 +307,7 @@ public: virtual void soft_body_remove_all_pinned_points(RID p_body) {} virtual void soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) {} - virtual bool soft_body_is_point_pinned(RID p_body, int p_point_index) { return 0; } + virtual bool soft_body_is_point_pinned(RID p_body, int p_point_index) { return false; } /* JOINT API */ diff --git a/servers/physics_3d/space_3d_sw.cpp b/servers/physics_3d/space_3d_sw.cpp index 66d17b3182..6b31e0e094 100644 --- a/servers/physics_3d/space_3d_sw.cpp +++ b/servers/physics_3d/space_3d_sw.cpp @@ -331,7 +331,7 @@ bool PhysicsDirectSpaceState3DSW::cast_motion(const RID &p_shape, const Transfor bool PhysicsDirectSpaceState3DSW::collide_shape(RID p_shape, const Transform &p_shape_xform, real_t p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) { if (p_result_max <= 0) - return 0; + return false; Shape3DSW *shape = static_cast(PhysicsServer3D::get_singleton())->shape_owner.getornull(p_shape); ERR_FAIL_COND_V(!shape, 0); diff --git a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp index 8a2073dc43..5f3803e8be 100644 --- a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp +++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp @@ -2732,7 +2732,7 @@ void RasterizerStorageRD::_multimesh_make_local(MultiMesh *multimesh) const { uint32_t data_cache_dirty_region_count = (multimesh->instances - 1) / MULTIMESH_DIRTY_REGION_SIZE + 1; multimesh->data_cache_dirty_regions = memnew_arr(bool, data_cache_dirty_region_count); for (uint32_t i = 0; i < data_cache_dirty_region_count; i++) { - multimesh->data_cache_dirty_regions[i] = 0; + multimesh->data_cache_dirty_regions[i] = false; } multimesh->data_cache_used_dirty_regions = 0; } -- cgit v1.2.3