[glib: 2/5] gobject/gobject.c: Tweak conditional to pacify static analysis



commit 7b0139b9f41ea524b1d92c5f123d95a2e9034f62
Author: Colin Walters <walters verbum org>
Date:   Mon Aug 19 23:05:49 2019 +0200

    gobject/gobject.c: Tweak conditional to pacify static analysis
    
    It can't easily see that value is always non-NULL here;
    this equivalent tweak will show that it is.

 gobject/gobject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 3a1fbdd87..e4ffa014a 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1729,7 +1729,7 @@ g_object_new_with_custom_constructor (GObjectClass          *class,
             break;
           }
 
-      if (j == n_params)
+      if (value == NULL)
         {
           value = &cvalues[cvals_used++];
           g_value_init (value, pspec->value_type);
@@ -1855,7 +1855,7 @@ g_object_new_internal (GObjectClass          *class,
                 break;
               }
 
-          if (j == n_params)
+          if (value == NULL)
             value = g_param_spec_get_default_value (pspec);
 
           object_set_property (object, pspec, value, nqueue);


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