Add g_type_ensure() and use it rather than playing games with volatile

https://bugzilla.gnome.org/show_bug.cgi?id=605976
This commit is contained in:
Dan Winship
2010-01-03 14:47:56 -05:00
parent 2a4235d0f3
commit e011d2c921
12 changed files with 72 additions and 55 deletions

View File

@@ -375,12 +375,10 @@ g_icon_new_from_tokens (char **tokens,
static void
ensure_builtin_icon_types (void)
{
static volatile GType t;
t = g_themed_icon_get_type ();
t = g_file_icon_get_type ();
t = g_emblemed_icon_get_type ();
t = g_emblem_get_type ();
(t); /* To avoid -Wunused-but-set-variable */
g_type_ensure (G_TYPE_THEMED_ICON);
g_type_ensure (G_TYPE_FILE_ICON);
g_type_ensure (G_TYPE_EMBLEMED_ICON);
g_type_ensure (G_TYPE_EMBLEM);
}
/**