From 14ab90eeba252da4d531a6ba78326556e46bf837 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 4 Dec 2020 16:01:52 +0100 Subject: [PATCH] clutter/actor: Initialize out variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a compiler warning with -Wmaybe-uninitialized enabled: ../../../../Source/gnome/mutter/clutter/clutter/clutter-actor.c: In function ‘clutter_actor_paint’: ../../../../Source/gnome/mutter/clutter/clutter/clutter-actor.c:3808:50: warning: ‘result’ may be used uninitialized in this function [-Wmaybe-uninitialized] 3808 | else if (result == CLUTTER_CULL_RESULT_OUT && success) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ Which might presumably happen in the unlikely case that there's no clip frusta. Part-of: --- clutter/clutter/clutter-actor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 0d5eae782..c77cd3eef 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -3309,7 +3309,7 @@ cull_actor (ClutterActor *self, { ClutterActorPrivate *priv = self->priv; const GArray *clip_frusta; - ClutterCullResult result; + ClutterCullResult result = CLUTTER_CULL_RESULT_IN; int i; if (!priv->last_paint_volume_valid) @@ -3334,7 +3334,7 @@ cull_actor (ClutterActor *self, clip_frusta = clutter_paint_context_get_clip_frusta (paint_context); if (!clip_frusta) { - *result_out = CLUTTER_CULL_RESULT_IN; + *result_out = result; return TRUE; }