[PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()

Masahiro Yamada posted 66 patches 3 months, 2 weeks ago
[PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()
Posted by Masahiro Yamada 3 months, 2 weeks ago
No all position parameters are used here. Passing NULL to
gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is
allowed. [1] [2]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638
[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index c78eded5c01b..ab2e0df21037 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -822,13 +822,10 @@ on_treeview2_button_press_event(GtkWidget * widget,
 	GtkTreeIter iter;
 	struct menu *menu;
 	gint col;
-
 	gint tx = (gint) event->x;
 	gint ty = (gint) event->y;
-	gint cx, cy;
 
-	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
-				      &cy);
+	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, NULL, NULL);
 	if (path == NULL)
 		return FALSE;
 
@@ -871,12 +868,11 @@ on_treeview2_key_press_event(GtkWidget * widget,
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
-	GtkTreeViewColumn *column;
 	GtkTreeIter iter;
 	struct menu *menu;
 	gint col;
 
-	gtk_tree_view_get_cursor(view, &path, &column);
+	gtk_tree_view_get_cursor(view, &path, NULL);
 	if (path == NULL)
 		return FALSE;
 
@@ -930,16 +926,12 @@ on_treeview1_button_press_event(GtkWidget * widget,
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
-	GtkTreeViewColumn *column;
 	GtkTreeIter iter;
 	struct menu *menu;
-
 	gint tx = (gint) event->x;
 	gint ty = (gint) event->y;
-	gint cx, cy;
 
-	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
-				      &cy);
+	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, NULL, NULL, NULL);
 	if (path == NULL)
 		return FALSE;
 
-- 
2.43.0
Re: [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()
Posted by Randy Dunlap 3 months, 1 week ago

On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> No all position parameters are used here. Passing NULL to

  Not all

> gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is
> allowed. [1] [2]
> 
> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638
> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/gconf.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)

-- 
~Randy
Re: [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()
Posted by Masahiro Yamada 3 months, 1 week ago
On Mon, Jun 30, 2025 at 11:40 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> > No all position parameters are used here. Passing NULL to
>
>   Not all
>
> > gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is
> > allowed. [1] [2]
> >
> > [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638
> > [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Thanks. I will locally fix it.


> >
> >  scripts/kconfig/gconf.c | 14 +++-----------
> >  1 file changed, 3 insertions(+), 11 deletions(-)
>
> --
> ~Randy



-- 
Best Regards
Masahiro Yamada