From 4e4e16f9a94d4fb7e25cc21952845f2ab69a6ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 10 Oct 2022 12:57:35 +0200 Subject: [PATCH 1/2] SCons: Cleanup GCC warnings configuration - Outright disable spammy warnings due to past or present GCC bugs: * `-Wno-strict-overflow` for GCC 7. * `-Wno-type-limits` for GCC before 11 (regressed in 9/10, might work in earlier releases but at this stage we don't care). * `-Wno-return-type` for GCC 12/13 (regression, still not fixed). - Enable extra warnings conditionally when broken on earlier GCC: * `-Wnoexcept` was removed due to an upstream regression in GCC 9, could be re-enabled (but commented out for now as we actually have `-Wnoexcept` warnings to fix. * `-Wlogical-op` was broken on our variadic templates before GCC 11, now seems fine. --- SConstruct | 20 +++++++++---- core/object/method_bind.h | 48 ------------------------------- drivers/unix/net_socket_posix.cpp | 4 +-- 3 files changed, 16 insertions(+), 56 deletions(-) diff --git a/SConstruct b/SConstruct index 1eb6bdcbfd0..77172d4d4cb 100644 --- a/SConstruct +++ b/SConstruct @@ -687,6 +687,14 @@ if selected_platform in platform_list: if methods.using_gcc(env): common_warnings += ["-Wshadow-local", "-Wno-misleading-indentation"] + if cc_version_major == 7: # Bogus warning fixed in 8+. + common_warnings += ["-Wno-strict-overflow"] + if cc_version_major < 11: + # Regression in GCC 9/10, spams so much in our variadic templates + # that we need to outright disable it. + common_warnings += ["-Wno-type-limits"] + if cc_version_major >= 12: # False positives in our error macros, see GH-58747. + common_warnings += ["-Wno-return-type"] elif methods.using_clang(env) or methods.using_emcc(env): # We often implement `operator<` for structs of pointers as a requirement # for putting them in `Set` or `Map`. We don't mind about unreliable ordering. @@ -702,13 +710,16 @@ if selected_platform in platform_list: "-Wduplicated-branches", "-Wduplicated-cond", "-Wstringop-overflow=4", - "-Wlogical-op", ] ) - # -Wnoexcept was removed temporarily due to GH-36325. env.Append(CXXFLAGS=["-Wplacement-new=1"]) + # Need to fix a warning with AudioServer lambdas before enabling. + # if cc_version_major != 9: # GCC 9 had a regression (GH-36325). + # env.Append(CXXFLAGS=["-Wnoexcept"]) if cc_version_major >= 9: env.Append(CCFLAGS=["-Wattribute-alias=2"]) + if cc_version_major >= 11: # Broke on MethodBind templates before GCC 11. + env.Append(CCFLAGS=["-Wlogical-op"]) elif methods.using_clang(env) or methods.using_emcc(env): env.Append(CCFLAGS=["-Wimplicit-fallthrough"]) elif env["warnings"] == "all": @@ -720,13 +731,10 @@ if selected_platform in platform_list: if env["werror"]: env.Append(CCFLAGS=["-Werror"]) + # FIXME: Temporary workaround after the Vulkan merge, remove once warnings are fixed. if methods.using_gcc(env): env.Append(CXXFLAGS=["-Wno-error=cpp"]) - if cc_version_major == 7: # Bogus warning fixed in 8+. - env.Append(CCFLAGS=["-Wno-error=strict-overflow"]) - if cc_version_major >= 12: # False positives in our error macros, see GH-58747. - env.Append(CCFLAGS=["-Wno-error=return-type"]) elif methods.using_clang(env) or methods.using_emcc(env): env.Append(CXXFLAGS=["-Wno-error=#warnings"]) diff --git a/core/object/method_bind.h b/core/object/method_bind.h index 0d3e40f7094..598e8a224df 100644 --- a/core/object/method_bind.h +++ b/core/object/method_bind.h @@ -292,11 +292,6 @@ class MethodBindT : public MethodBind { void (MB_T::*method)(P...); protected: -// GCC raises warnings in the case P = {} as the comparison is always false... -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlogical-op" -#endif virtual Variant::Type _gen_argument_type(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { return call_get_argument_type(p_arg); @@ -304,9 +299,6 @@ protected: return Variant::NIL; } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif virtual PropertyInfo _gen_argument_type_info(int p_arg) const override { PropertyInfo pi; @@ -367,11 +359,6 @@ class MethodBindTC : public MethodBind { void (MB_T::*method)(P...) const; protected: -// GCC raises warnings in the case P = {} as the comparison is always false... -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlogical-op" -#endif virtual Variant::Type _gen_argument_type(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { return call_get_argument_type(p_arg); @@ -379,9 +366,6 @@ protected: return Variant::NIL; } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif virtual PropertyInfo _gen_argument_type_info(int p_arg) const override { PropertyInfo pi; @@ -444,11 +428,6 @@ class MethodBindTR : public MethodBind { (P...); protected: -// GCC raises warnings in the case P = {} as the comparison is always false... -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlogical-op" -#endif virtual Variant::Type _gen_argument_type(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { return call_get_argument_type(p_arg); @@ -466,9 +445,6 @@ protected: return GetTypeInfo::get_class_info(); } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif public: #ifdef DEBUG_METHODS_ENABLED @@ -531,11 +507,6 @@ class MethodBindTRC : public MethodBind { (P...) const; protected: -// GCC raises warnings in the case P = {} as the comparison is always false... -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlogical-op" -#endif virtual Variant::Type _gen_argument_type(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { return call_get_argument_type(p_arg); @@ -553,9 +524,6 @@ protected: return GetTypeInfo::get_class_info(); } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif public: #ifdef DEBUG_METHODS_ENABLED @@ -615,11 +583,6 @@ class MethodBindTS : public MethodBind { void (*function)(P...); protected: -// GCC raises warnings in the case P = {} as the comparison is always false... -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlogical-op" -#endif virtual Variant::Type _gen_argument_type(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { return call_get_argument_type(p_arg); @@ -627,9 +590,6 @@ protected: return Variant::NIL; } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif virtual PropertyInfo _gen_argument_type_info(int p_arg) const override { PropertyInfo pi; @@ -678,11 +638,6 @@ class MethodBindTRS : public MethodBind { (P...); protected: -// GCC raises warnings in the case P = {} as the comparison is always false... -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlogical-op" -#endif virtual Variant::Type _gen_argument_type(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { return call_get_argument_type(p_arg); @@ -690,9 +645,6 @@ protected: return GetTypeInfo::VARIANT_TYPE; } } -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif virtual PropertyInfo _gen_argument_type_info(int p_arg) const override { if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index 72ae609fb40..c6b327eeeec 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -179,8 +179,8 @@ NetSocketPosix::~NetSocketPosix() { close(); } -// Silent a warning reported in #27594 - +// Silence a warning reported in GH-27594. +// EAGAIN and EWOULDBLOCK have the same value on most platforms, but it's not guaranteed. #if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wlogical-op" From 80178271447455efb7d12ef52f09e8408c042d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 10 Oct 2022 13:04:01 +0200 Subject: [PATCH 2/2] SCons: Re-enable treating `#warning` as error with `werror` Replace all TODO uses of `#warning` by proper TODO comments, and will open matching bug reports to keep track of them. We don't have a great track record fixing TODOs, but I'd wager we're even worse for fixing these "TODO #warning" so we should prohibit this usage. --- SConstruct | 6 ------ core/object/script_language_extension.h | 4 +--- drivers/vulkan/rendering_device_vulkan.cpp | 4 +--- editor/create_dialog.cpp | 4 +--- editor/export/project_export.cpp | 4 +--- editor/plugins/node_3d_editor_plugin.cpp | 5 ++--- modules/gltf/gltf_document.cpp | 5 +---- platform/android/api/jni_singleton.h | 5 ++--- platform/android/jni_utils.cpp | 5 ++--- platform/linuxbsd/display_server_x11.cpp | 10 ---------- platform/linuxbsd/display_server_x11.h | 1 - platform/windows/display_server_windows.cpp | 14 -------------- platform/windows/display_server_windows.h | 4 ---- scene/2d/skeleton_2d.cpp | 6 ++---- scene/2d/sprite_2d.cpp | 4 +--- scene/gui/color_picker.cpp | 4 +--- scene/resources/animation.cpp | 16 ++++------------ scene/resources/mesh.cpp | 5 ++--- scene/resources/visual_shader.cpp | 5 ++--- .../rendering/renderer_rd/pipeline_cache_rd.cpp | 5 ++--- .../renderer_rd/renderer_canvas_render_rd.cpp | 5 +---- .../renderer_rd/renderer_compositor_rd.cpp | 6 ++---- .../renderer_rd/storage_rd/particles_storage.cpp | 6 ++---- .../renderer_rd/storage_rd/texture_storage.cpp | 5 ++--- 24 files changed, 32 insertions(+), 106 deletions(-) diff --git a/SConstruct b/SConstruct index 77172d4d4cb..2c5b34854e7 100644 --- a/SConstruct +++ b/SConstruct @@ -732,12 +732,6 @@ if selected_platform in platform_list: if env["werror"]: env.Append(CCFLAGS=["-Werror"]) - # FIXME: Temporary workaround after the Vulkan merge, remove once warnings are fixed. - if methods.using_gcc(env): - env.Append(CXXFLAGS=["-Wno-error=cpp"]) - elif methods.using_clang(env) or methods.using_emcc(env): - env.Append(CXXFLAGS=["-Wno-error=#warnings"]) - if hasattr(detect, "get_program_suffix"): suffix = "." + detect.get_program_suffix() else: diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h index 7e74f6a2be8..15e2d57a3aa 100644 --- a/core/object/script_language_extension.h +++ b/core/object/script_language_extension.h @@ -82,9 +82,7 @@ public: GDVIRTUAL_REQUIRED_CALL(_get_documentation, doc); Vector class_doc; -#ifndef _MSC_VER -#warning missing conversion from documentation to ClassDoc -#endif + // TODO: Missing conversion from documentation to ClassDoc. return class_doc; } #endif // TOOLS_ENABLED diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 9b193056c2b..74bcc7cbff5 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -1655,9 +1655,7 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T image_create_info.pNext = nullptr; image_create_info.flags = 0; -#ifndef _MSC_VER -#warning TODO check for support via RenderingDevice to enable on mobile when possible -#endif + // TODO: Check for support via RenderingDevice to enable on mobile when possible. #ifndef ANDROID_ENABLED diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index ceca4283066..7a4e58c6f96 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -752,9 +752,7 @@ CreateDialog::CreateDialog() { favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected)); favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated)); favorites->add_theme_constant_override("draw_guides", 1); -#ifndef _MSC_VER -#warning cannot forward drag data to a non control, must be fixed -#endif + // Cannot forward drag data to a non control, must be fixed. //favorites->set_drag_forwarding(this); fav_vb->add_margin_child(TTR("Favorites:"), favorites, true); diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 05a17c9951e..9b5e76bcd7e 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -1015,9 +1015,7 @@ ProjectExportDialog::ProjectExportDialog() { preset_vb->add_child(mc); mc->set_v_size_flags(Control::SIZE_EXPAND_FILL); presets = memnew(ItemList); -#ifndef _MSC_VER -#warning must reimplement drag forward -#endif + // TODO: Must reimplement drag forwarding. //presets->set_drag_forwarding(this); mc->add_child(presets); presets->connect("item_selected", callable_mp(this, &ProjectExportDialog::_edit_preset)); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 4430877b8a8..7a213979105 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4773,9 +4773,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p view_menu->get_popup()->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_menu_option)); display_submenu->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_menu_option)); view_menu->set_disable_shortcuts(true); -#ifndef _MSC_VER -#warning this needs to be fixed -#endif + + // TODO: Re-evaluate with new OpenGL3 renderer, and implement. //if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { if (false) { // Alternate display modes only work when using the Vulkan renderer; make this explicit. diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 8272db9018e..6700b6de0ad 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -2590,10 +2590,7 @@ Error GLTFDocument::_parse_meshes(Ref state) { Mesh::PRIMITIVE_TRIANGLES, // 4 TRIANGLES Mesh::PRIMITIVE_TRIANGLE_STRIP, // 5 TRIANGLE_STRIP Mesh::PRIMITIVE_TRIANGLES, // 6 TRIANGLE_FAN fan not supported, should be converted -#ifndef _MSC_VER -#warning line loop and triangle fan are not supported and need to be converted to lines and triangles -#endif - + // TODO: Line loop and triangle fan are not supported and need to be converted to lines and triangles. }; primitive = primitives2[mode]; diff --git a/platform/android/api/jni_singleton.h b/platform/android/api/jni_singleton.h index 690fddae215..895bc701036 100644 --- a/platform/android/api/jni_singleton.h +++ b/platform/android/api/jni_singleton.h @@ -150,9 +150,8 @@ public: env->DeleteLocalRef(arr); } break; -#ifndef _MSC_VER -#warning This is missing 64 bits arrays, I have no idea how to do it in JNI -#endif + // TODO: This is missing 64 bits arrays, I have no idea how to do it in JNI. + case Variant::DICTIONARY: { jobject obj = env->CallObjectMethodA(instance, E->get().method, v); ret = _jobject_to_variant(env, obj); diff --git a/platform/android/jni_utils.cpp b/platform/android/jni_utils.cpp index 193ef61264b..d46b4f39de2 100644 --- a/platform/android/jni_utils.cpp +++ b/platform/android/jni_utils.cpp @@ -167,9 +167,8 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a v.obj = arr; } break; -#ifndef _MSC_VER -#warning This is missing 64 bits arrays, I have no idea how to do it in JNI -#endif + + // TODO: This is missing 64 bits arrays, I have no idea how to do it in JNI. default: { v.val.i = 0; diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 5256d91a804..e0963f42ce1 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -1202,16 +1202,6 @@ float DisplayServerX11::screen_get_refresh_rate(int p_screen) const { return SCREEN_REFRESH_RATE_FALLBACK; } -bool DisplayServerX11::screen_is_touchscreen(int p_screen) const { - _THREAD_SAFE_METHOD_ - -#ifndef _MSC_VER -#warning Need to get from proper window -#endif - - return DisplayServer::screen_is_touchscreen(p_screen); -} - #ifdef DBUS_ENABLED void DisplayServerX11::screen_set_keep_on(bool p_enable) { if (screen_is_kept_on() == p_enable) { diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index a5fa7613bc7..5723abc7510 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -349,7 +349,6 @@ public: virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; - virtual bool screen_is_touchscreen(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; #if defined(DBUS_ENABLED) virtual void screen_set_keep_on(bool p_enable) override; diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 16853a0be7a..3b773685c38 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -561,20 +561,6 @@ float DisplayServerWindows::screen_get_refresh_rate(int p_screen) const { return data.rate; } -bool DisplayServerWindows::screen_is_touchscreen(int p_screen) const { -#ifndef _MSC_VER -#warning touchscreen not working -#endif - return DisplayServer::screen_is_touchscreen(p_screen); -} - -void DisplayServerWindows::screen_set_orientation(ScreenOrientation p_orientation, int p_screen) { -} - -DisplayServer::ScreenOrientation DisplayServerWindows::screen_get_orientation(int p_screen) const { - return SCREEN_LANDSCAPE; -} - void DisplayServerWindows::screen_set_keep_on(bool p_enable) { if (keep_screen_on == p_enable) { return; diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 3523e8b3d17..6403b57d8d4 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -516,10 +516,6 @@ public: virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; - virtual bool screen_is_touchscreen(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; - - virtual void screen_set_orientation(ScreenOrientation p_orientation, int p_screen = SCREEN_OF_MAIN_WINDOW) override; - virtual ScreenOrientation screen_get_orientation(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual void screen_set_keep_on(bool p_enable) override; //disable screensaver virtual bool screen_is_kept_on() const override; diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp index dd016d5e92c..f80b2a07c90 100644 --- a/scene/2d/skeleton_2d.cpp +++ b/scene/2d/skeleton_2d.cpp @@ -192,10 +192,8 @@ void Bone2D::_notification(int p_what) { cache_transform = tmp_trans; } break; - // Bone2D Editor gizmo drawing: -#ifndef _MSC_VER -#warning TODO Bone2D gizmo drawing needs to be moved to an editor plugin -#endif + // Bone2D Editor gizmo drawing. + // TODO: Bone2D gizmo drawing needs to be moved to an editor plugin. case NOTIFICATION_DRAW: { // Only draw the gizmo in the editor! if (Engine::get_singleton()->is_editor_hint() == false) { diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp index 0ecf8333a04..08068acf7d3 100644 --- a/scene/2d/sprite_2d.cpp +++ b/scene/2d/sprite_2d.cpp @@ -309,9 +309,7 @@ bool Sprite2D::is_pixel_opaque(const Point2 &p_point) const { q.y = 1.0f - q.y; } q = q * src_rect.size + src_rect.position; -#ifndef _MSC_VER -#warning this need to be obtained from CanvasItem new repeat mode (but it needs to guess it from hierarchy, need to add a function for that) -#endif + // TODO: This need to be obtained from CanvasItem new repeat mode (but it needs to guess it from hierarchy, need to add a function for that). bool is_repeat = false; bool is_mirrored_repeat = false; if (is_repeat) { diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index f1e18640e60..a2c138c0b29 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -1403,9 +1403,7 @@ void ColorPicker::_screen_pick_pressed() { screen->show(); } screen->move_to_front(); -#ifndef _MSC_VER -#warning show modal no longer works, needs to be converted to a popup -#endif + // TODO: show modal no longer works, needs to be converted to a popup. //screen->show_modal(); } diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 2bcf569f4e6..dfd9c6eb2f4 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -5239,9 +5239,7 @@ bool Animation::_fetch_compressed(uint32_t p_compressed_track, double p_time, Ve double page_base_time = compression.pages[page_index].time_offset; const uint8_t *page_data = compression.pages[page_index].data.ptr(); -#ifndef _MSC_VER -#warning Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported -#endif + // Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported. const uint32_t *indices = (const uint32_t *)page_data; const uint16_t *time_keys = (const uint16_t *)&page_data[indices[p_compressed_track * 3 + 0]]; uint32_t time_key_count = indices[p_compressed_track * 3 + 1]; @@ -5384,9 +5382,7 @@ void Animation::_get_compressed_key_indices_in_range(uint32_t p_compressed_track double page_base_time = compression.pages[page_index].time_offset; const uint8_t *page_data = compression.pages[page_index].data.ptr(); -#ifndef _MSC_VER -#warning Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported -#endif + // Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported. const uint32_t *indices = (const uint32_t *)page_data; const uint16_t *time_keys = (const uint16_t *)&page_data[indices[p_compressed_track * 3 + 0]]; uint32_t time_key_count = indices[p_compressed_track * 3 + 1]; @@ -5456,9 +5452,7 @@ int Animation::_get_compressed_key_count(uint32_t p_compressed_track) const { for (uint32_t i = 0; i < compression.pages.size(); i++) { const uint8_t *page_data = compression.pages[i].data.ptr(); -#ifndef _MSC_VER -#warning Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported -#endif + // Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported. const uint32_t *indices = (const uint32_t *)page_data; const uint16_t *time_keys = (const uint16_t *)&page_data[indices[p_compressed_track * 3 + 0]]; uint32_t time_key_count = indices[p_compressed_track * 3 + 1]; @@ -5492,9 +5486,7 @@ bool Animation::_fetch_compressed_by_index(uint32_t p_compressed_track, int p_in for (uint32_t i = 0; i < compression.pages.size(); i++) { const uint8_t *page_data = compression.pages[i].data.ptr(); -#ifndef _MSC_VER -#warning Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported -#endif + // Little endian assumed. No major big endian hardware exists any longer, but in case it does it will need to be supported. const uint32_t *indices = (const uint32_t *)page_data; const uint16_t *time_keys = (const uint16_t *)&page_data[indices[p_compressed_track * 3 + 0]]; uint32_t time_key_count = indices[p_compressed_track * 3 + 1]; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 03ccae5b744..706db3af169 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -1576,9 +1576,8 @@ void ArrayMesh::_recompute_aabb() { } } } -#ifndef _MSC_VER -#warning need to add binding to add_surface using future MeshSurfaceData object -#endif + +// TODO: Need to add binding to add_surface using future MeshSurfaceData object. void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector &p_array, const Vector &p_attribute_array, const Vector &p_skin_array, int p_vertex_count, const Vector &p_index_array, int p_index_count, const AABB &p_aabb, const Vector &p_blend_shape_data, const Vector &p_bone_aabbs, const Vector &p_lods) { _create_if_empty(); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index df9addb6bb8..640f6dfcb7e 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -1509,11 +1509,10 @@ bool VisualShader::_get(const StringName &p_name, Variant &r_ret) const { } void VisualShader::reset_state() { -#ifndef _MSC_VER -#warning everything needs to be cleared here -#endif + // TODO: Everything needs to be cleared here. emit_changed(); } + void VisualShader::_get_property_list(List *p_list) const { //mode p_list->push_back(PropertyInfo(Variant::INT, PNAME("mode"), PROPERTY_HINT_ENUM, "Node3D,CanvasItem,Particles,Sky,Fog")); diff --git a/servers/rendering/renderer_rd/pipeline_cache_rd.cpp b/servers/rendering/renderer_rd/pipeline_cache_rd.cpp index 9151c53823a..7a2336970bd 100644 --- a/servers/rendering/renderer_rd/pipeline_cache_rd.cpp +++ b/servers/rendering/renderer_rd/pipeline_cache_rd.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "pipeline_cache_rd.h" + #include "core/os/memory.h" RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD::FramebufferFormatID p_framebuffer_format_id, bool p_wireframe, uint32_t p_render_pass, uint32_t p_bool_specializations) { @@ -70,9 +71,7 @@ RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD } void PipelineCacheRD::_clear() { -#ifndef _MSC_VER -#warning Clear should probably recompile all the variants already compiled instead to avoid stalls? needs discussion -#endif + // TODO: Clear should probably recompile all the variants already compiled instead to avoid stalls? Needs discussion. if (versions) { for (uint32_t i = 0; i < version_count; i++) { //shader may be gone, so this may not be valid diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index e5e82552f41..5728444312c 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -1075,10 +1075,7 @@ void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_co clear_colors.push_back(texture_storage->render_target_get_clear_request_color(p_to_render_target)); texture_storage->render_target_disable_clear_request(p_to_render_target); } -#ifndef _MSC_VER -#warning TODO obtain from framebuffer format eventually when this is implemented -#endif - + // TODO: Obtain from framebuffer format eventually when this is implemented. fb_uniform_set = texture_storage->render_target_get_framebuffer_uniform_set(p_to_render_target); } diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp index dd3f62e509f..3289bfb0ea9 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp @@ -102,10 +102,8 @@ void RendererCompositorRD::begin_frame(double frame_step) { } void RendererCompositorRD::end_frame(bool p_swap_buffers) { -#ifndef _MSC_VER -#warning TODO: likely pass a bool to swap buffers to avoid display? -#endif - RD::get_singleton()->swap_buffers(); //probably should pass some bool to avoid display? + // TODO: Likely pass a bool to swap buffers to avoid display? + RD::get_singleton()->swap_buffers(); } void RendererCompositorRD::initialize() { diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp index 78f4c410c35..240f7433872 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "particles_storage.h" + #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/rendering_server_globals.h" #include "texture_storage.h" @@ -1334,10 +1335,7 @@ void ParticlesStorage::update_particles() { } } -#ifndef _MSC_VER -#warning Should use display refresh rate for all this -#endif - + // TODO: Should use display refresh rate for all this. float screen_hz = 60; int fixed_fps = 0; diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index b3a7e05ff53..add3e033891 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "texture_storage.h" + #include "../effects/copy_effects.h" #include "../framebuffer_cache_rd.h" #include "material_storage.h" @@ -1496,9 +1497,7 @@ Ref TextureStorage::_validate_texture_format(const Ref &p_image, T } break; case Image::FORMAT_RGBE9995: { r_format.format = RD::DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32; -#ifndef _MSC_VER -#warning TODO need to make a function in Image to swap bits for this -#endif + // TODO: Need to make a function in Image to swap bits for this. r_format.swizzle_r = RD::TEXTURE_SWIZZLE_IDENTITY; r_format.swizzle_g = RD::TEXTURE_SWIZZLE_IDENTITY; r_format.swizzle_b = RD::TEXTURE_SWIZZLE_IDENTITY;