[gtk+/gtk-3-14] inspector: be careful about gsize vs guint64



commit 0691f8f011efebbc1c3a9e7ca76a65d23f58c1e2
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 10 21:36:52 2015 -0500

    inspector: be careful about gsize vs guint64
    
    Since gsize doesn't work as a typename in a ui file,
    we have to be careful not to pass pointers to wrongly
    sized variables when getting the guint64 values out
    of the model.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742664

 gtk/inspector/resource-list.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/resource-list.c b/gtk/inspector/resource-list.c
index 44fb34c..a9b6a0d 100644
--- a/gtk/inspector/resource-list.c
+++ b/gtk/inspector/resource-list.c
@@ -60,6 +60,7 @@ load_resources_recurse (GtkInspectorResourceList *sl,
   gchar **names;
   gint i;
   GtkTreeIter iter;
+  guint64 stored_size;
 
   names = g_resources_enumerate_children (path, 0, NULL);
   for (i = 0; names[i]; i++)
@@ -97,9 +98,10 @@ load_resources_recurse (GtkInspectorResourceList *sl,
           g_resources_get_info (p, 0, &size, NULL, NULL);
         }
 
+      stored_size = size;
       gtk_tree_store_set (sl->priv->model, &iter,
                           COLUMN_COUNT, count,
-                          COLUMN_SIZE, size,
+                          COLUMN_SIZE, stored_size,
                           -1);
       *count_out += count;
       *size_out += size;
@@ -125,6 +127,7 @@ selection_changed (GtkTreeSelection         *selection,
       gconstpointer data;
       gint count;
       gsize size;
+      guint64 stored_size;
       GError *error = NULL;
 
       gtk_widget_hide (rl->priv->info_grid);
@@ -133,8 +136,9 @@ selection_changed (GtkTreeSelection         *selection,
                           COLUMN_PATH, &path,
                           COLUMN_NAME, &name,
                           COLUMN_COUNT, &count,
-                          COLUMN_SIZE, &size,
+                          COLUMN_SIZE, &stored_size,
                           -1);
+      size = stored_size;
 
       if (g_str_has_suffix (path, "/"))
         {


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