Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame^] | 1 | From d8f8859369b228d86aeeb043d732b9c60fdce289 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 24 Mar 2023 15:29:04 -0700 |
| 4 | Subject: [PATCH] initialize GdkDragAction action to 0 |
| 5 | |
| 6 | This helps in silencing clang found warning |
| 7 | |
| 8 | autilus-pathbar.c:759:9: error: variable 'action' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] |
| 9 | if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST)) |
| 10 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 11 | |
| 12 | Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1158] |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | src/nautilus-pathbar.c | 2 +- |
| 16 | src/nautilus-window.c | 2 +- |
| 17 | 2 files changed, 2 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c |
| 20 | index 1b6ea6a..a5ab780 100644 |
| 21 | --- a/src/nautilus-pathbar.c |
| 22 | +++ b/src/nautilus-pathbar.c |
| 23 | @@ -746,7 +746,7 @@ on_drag_motion (GtkDropTarget *target, |
| 24 | gpointer user_data) |
| 25 | { |
| 26 | ButtonData *button_data = user_data; |
| 27 | - GdkDragAction action; |
| 28 | + GdkDragAction action = 0; |
| 29 | const GValue *value; |
| 30 | graphene_point_t start; |
| 31 | |
| 32 | diff --git a/src/nautilus-window.c b/src/nautilus-window.c |
| 33 | index 30299b1..74c548f 100644 |
| 34 | --- a/src/nautilus-window.c |
| 35 | +++ b/src/nautilus-window.c |
| 36 | @@ -1476,7 +1476,7 @@ extra_drag_value_cb (AdwTabBar *self, |
| 37 | { |
| 38 | NautilusWindowSlot *slot = NAUTILUS_WINDOW_SLOT (adw_tab_page_get_child (page)); |
| 39 | g_autoptr (NautilusFile) file = nautilus_file_get (nautilus_window_slot_get_location (slot)); |
| 40 | - GdkDragAction action; |
| 41 | + GdkDragAction action = 0; |
| 42 | |
| 43 | if (value == NULL) |
| 44 | { |
| 45 | -- |
| 46 | 2.40.0 |
| 47 | |