clutter/actor: Initialize out variable

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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1624>
This commit is contained in:
Carlos Garnacho 2020-12-04 16:01:52 +01:00 committed by Marge Bot
parent 517dc99dfd
commit 14ab90eeba

View File

@ -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;
}