build: Fix some harmless compiler warnings

Some (newer?) GCC versions complain when a g_auto variable isn't
initialized when declared, even when the initialization is guaranteed
to happen before the variable is used or goes out of scope.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2298
This commit is contained in:
Florian Müllner
2020-03-02 18:16:25 +01:00
committed by Florian Müllner
parent 1de008f2d5
commit bf367daaba
3 changed files with 3 additions and 3 deletions

View File

@ -1295,7 +1295,7 @@ apply_discrete_gpu_env (GAppLaunchContext *context,
num_children = g_variant_n_children (variant);
for (i = 0; i < num_children; i++)
{
g_autoptr(GVariant) gpu;
g_autoptr(GVariant) gpu = NULL;
g_autoptr(GVariant) env = NULL;
g_autoptr(GVariant) default_variant = NULL;
g_autofree const char **env_s = NULL;

View File

@ -142,7 +142,7 @@ on_icon_theme_changed (StSettings *settings,
GParamSpec *pspec,
StTextureCache *cache)
{
g_autofree gchar *theme;
g_autofree gchar *theme = NULL;
st_texture_cache_evict_icons (cache);