[mutter/wip/carlosg/maybe-uninitialized: 1/3] clutter/actor: Initialize out variable




commit cea011e3291b819a9a750642b126569ffb31576b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Dec 4 16:01:52 2020 +0100

    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.

 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 0d5eae7824..c77cd3eef8 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;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]