summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-01-10 21:36:52 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-01-10 21:36:52 -0500
commit0691f8f011efebbc1c3a9e7ca76a65d23f58c1e2 (patch)
treedd1ca2da50e9d00e228fb61c89d48f9642b594b8
parent2f20fffbae5367fba23530c1cc3aa60560e659c8 (diff)
downloadgtk+-0691f8f011efebbc1c3a9e7ca76a65d23f58c1e2.tar.gz
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
-rw-r--r--gtk/inspector/resource-list.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/inspector/resource-list.c b/gtk/inspector/resource-list.c
index 44fb34c586..a9b6a0deaa 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, "/"))
{