Initialize gdb::optional empty payload to quiet false -Wmaybe-uninitialized warnings
[deliverable/binutils-gdb.git] / gdb / varobj.c
index 3b2771f5cf54e40df788814e2367f3d5dea268e9..f5d1cbf011ebbe91df755bf653fe1735a28f4e81 100644 (file)
@@ -724,7 +724,7 @@ varobj_clear_saved_item (struct varobj_dynamic *var)
   if (var->saved_item != NULL)
     {
       value_free (var->saved_item->value);
-      xfree (var->saved_item);
+      delete var->saved_item;
       var->saved_item = NULL;
     }
 }
@@ -799,7 +799,7 @@ update_dynamic_varobj_children (struct varobj *var,
                                 can_mention ? cchanged : NULL, i,
                                 item);
 
-         xfree (item);
+         delete item;
        }
       else
        {
@@ -1478,11 +1478,11 @@ varobj_set_visualizer (struct varobj *var, const char *visualizer)
   gdbpy_enter_varobj enter_py (var);
 
   mainmod = PyImport_AddModule ("__main__");
-  gdbpy_ref globals (PyModule_GetDict (mainmod));
+  gdbpy_ref<> globals (PyModule_GetDict (mainmod));
   Py_INCREF (globals.get ());
 
-  gdbpy_ref constructor (PyRun_String (visualizer, Py_eval_input,
-                                      globals.get (), globals.get ()));
+  gdbpy_ref<> constructor (PyRun_String (visualizer, Py_eval_input,
+                                        globals.get (), globals.get ()));
 
   if (constructor == NULL)
     {
@@ -2136,7 +2136,7 @@ varobj_get_value_type (const struct varobj *var)
 
   type = check_typedef (type);
 
-  if (TYPE_CODE (type) == TYPE_CODE_REF)
+  if (TYPE_IS_REFERENCE (type))
     type = get_target_type (type);
 
   type = check_typedef (type);
@@ -2432,9 +2432,9 @@ varobj_value_get_print_value (struct value *value,
            {
              struct value *replacement;
 
-             gdbpy_ref output (apply_varobj_pretty_printer (value_formatter,
-                                                            &replacement,
-                                                            &stb));
+             gdbpy_ref<> output (apply_varobj_pretty_printer (value_formatter,
+                                                              &replacement,
+                                                              &stb));
 
              /* If we have string like output ...  */
              if (output != NULL)
This page took 0.025808 seconds and 4 git commands to generate.