[nautilus/wip/antoniof/define-function-parameters-the-normal-way: 30/31] canvas-dnd: Define function type the usual way




commit 3d68a895f06179a5abeab6c8a2bb6c743210c357
Author: António Fernandes <antoniof gnome org>
Date:   Mon Sep 7 09:57:48 2020 +0100

    canvas-dnd: Define function type the usual way
    
    Defining an function type inline as a function parameter is a awkward
    syntax and not used in our codebase except for this one occurence.
    
    Although valid C, it confuses our style check tools, breaking the CI
    style check [1] and failing to align parameters.
    
    Instead, let's define a named function type to use as parameter type,
    and fix parameter misalignment.
    
    [1] 831203e9512b29900e8095c91332b49bbbf97047

 src/nautilus-canvas-dnd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-canvas-dnd.c b/src/nautilus-canvas-dnd.c
index 9d5a5c67b..1f86039c2 100644
--- a/src/nautilus-canvas-dnd.c
+++ b/src/nautilus-canvas-dnd.c
@@ -276,13 +276,16 @@ icon_get_data_binder (NautilusCanvasIcon *icon,
     return TRUE;
 }
 
+typedef gboolean (*CanvasContainerEachFunc)(NautilusCanvasIcon *,
+                                            gpointer);
+
 /* Iterate over each selected icon in a NautilusCanvasContainer,
  * calling each_function on each.
  */
 static void
 nautilus_canvas_container_each_selected_icon (NautilusCanvasContainer *container,
-                                              gboolean (*each_function)(NautilusCanvasIcon *, gpointer),
-                                              gpointer data)
+                                              CanvasContainerEachFunc  each_function,
+                                              gpointer                 data)
 {
     GList *p;
     NautilusCanvasIcon *icon;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]