Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix some warnings reported by recent versions of clang-tidy #52349

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
../../../flutter/shell/platform/glfw/client_wrapper/flutter_window_unittests.cc
../../../flutter/shell/platform/glfw/client_wrapper/plugin_registrar_glfw_unittests.cc
../../../flutter/shell/platform/glfw/client_wrapper/testing
../../../flutter/shell/platform/linux/.clang-tidy
../../../flutter/shell/platform/linux/testing
../../../flutter/shell/platform/windows/README.md
../../../flutter/shell/platform/windows/accessibility_bridge_windows_unittests.cc
Expand Down
3 changes: 2 additions & 1 deletion shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2457,7 +2457,8 @@ FlutterEngineResult FlutterEngineSendPointerEvent(
SAFE_ACCESS(current, signal_kind, kFlutterPointerSignalKindNone));
pointer_data.scroll_delta_x = SAFE_ACCESS(current, scroll_delta_x, 0.0);
pointer_data.scroll_delta_y = SAFE_ACCESS(current, scroll_delta_y, 0.0);
FlutterPointerDeviceKind device_kind = SAFE_ACCESS(current, device_kind, 0);
FlutterPointerDeviceKind device_kind =
SAFE_ACCESS(current, device_kind, kFlutterPointerDeviceKindMouse);
// For backwards compatibility with embedders written before the device
// kind and buttons were exposed, if the device kind is not set treat it
// as a mouse, with a synthesized primary button state based on the phase.
Expand Down
1 change: 1 addition & 0 deletions shell/platform/embedder/tests/embedder_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,7 @@ TEST_F(EmbedderTest, InvalidAOTDataSourcesMustReturnError) {
ASSERT_EQ(FlutterEngineCreateAOTData(&data_in, nullptr), kInvalidArguments);

// Invalid FlutterEngineAOTDataSourceType type specified.
// NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
data_in.type = static_cast<FlutterEngineAOTDataSourceType>(-1);
ASSERT_EQ(FlutterEngineCreateAOTData(&data_in, &data_out), kInvalidArguments);
ASSERT_EQ(data_out, nullptr);
Expand Down
5 changes: 5 additions & 0 deletions shell/platform/linux/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
InheritParentConfig: true

# EnumCastOutOfRange warns about some common usages of GTK macros
Checks: >-
-clang-analyzer-optin.core.EnumCastOutOfRange