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
This commit is contained in:
Matthias Clasen
2015-01-10 21:36:52 -05:00
parent 2f20fffbae
commit 0691f8f011

View File

@@ -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, "/"))
{