[gtk+] a11y: Change function declaration



commit ac29108586f46e8c4a30871c9c2053b9206271d6
Author: Benjamin Otte <otte redhat com>
Date:   Fri Nov 11 01:35:50 2011 +0100

    a11y: Change function declaration
    
    Returning an int seems way easier than having an int out argument to a
    void function. Also, it doesn't lead to uninitialized memory, what a
    concept!

 gtk/a11y/gtktreeviewaccessible.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 846a4a3..8366794 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -3160,21 +3160,23 @@ cell_destroyed (gpointer data)
     }
 }
 
-static void
+static int
 cell_info_get_index (GtkTreeView                     *tree_view,
-                     GtkTreeViewAccessibleCellInfo   *info,
-                     gint                            *index)
+                     GtkTreeViewAccessibleCellInfo   *info)
 {
   GtkTreePath *path;
   gint column_number;
+  int index;
 
   path = gtk_tree_row_reference_get_path (info->cell_row_ref);
   if (!path)
-    return;
+    return -1;
 
   column_number = get_column_number (tree_view, info->cell_col_ref, FALSE);
-  *index = get_index (tree_view, path, column_number);
+  index = get_index (tree_view, path, column_number);
   gtk_tree_path_free (path);
+
+  return index;
 }
 
 static void
@@ -3234,7 +3236,7 @@ refresh_cell_index (GtkCellAccessible *cell)
   if (!info)
     return;
 
-  cell_info_get_index (tree_view, info, &index);
+  index = cell_info_get_index (tree_view, info);
   cell->index = index;
   g_hash_table_insert (accessible->cell_info_by_index, &index, info);
 }



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