Fix indentation (and clang warning) in c-lang.c
[deliverable/binutils-gdb.git] / gdb / guile / scm-param.c
index a55deabf56cf2b7c245c0b1965fbeb5630a71767..6d24c2c37b7f8b29cd1cb5ca8d057dd11e528612 100644 (file)
 
 union pascm_variable
 {
-  /* Hold an integer value, for boolean and integer types.  */
+  /* Hold an boolean value.  */
+  bool boolval;
+
+  /* Hold an integer value.  */
   int intval;
 
   /* Hold an auto_boolean.  */
@@ -365,7 +368,7 @@ add_setshow_generic (enum var_types param_type, enum command_class cmd_class,
     {
     case var_boolean:
       add_setshow_boolean_cmd (cmd_name, cmd_class,
-                              &self->value.intval,
+                              &self->value.boolval,
                               set_doc, show_doc, help_doc,
                               set_func, show_func,
                               set_list, show_list);
@@ -606,7 +609,7 @@ pascm_param_value (enum var_types type, void *var,
 
     case var_boolean:
       {
-       if (* (int *) var)
+       if (* (bool *) var)
          return SCM_BOOL_T;
        else
          return SCM_BOOL_F;
@@ -717,7 +720,7 @@ pascm_set_param_value_x (enum var_types type, union pascm_variable *var,
     case var_boolean:
       SCM_ASSERT_TYPE (gdbscm_is_bool (value), value, arg_pos, func_name,
                       _("boolean"));
-      var->intval = gdbscm_is_true (value);
+      var->boolval = gdbscm_is_true (value);
       break;
 
     case var_auto_boolean:
@@ -1006,6 +1009,7 @@ gdbscm_register_parameter_x (SCM self)
                _("parameter exists, \"show\" command is already defined"));
     }
 
+  gdbscm_gdb_exception exc {};
   try
     {
       add_setshow_generic (p_smob->type, p_smob->cmd_class,
@@ -1020,9 +1024,10 @@ gdbscm_register_parameter_x (SCM self)
     }
   catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   /* Note: At this point the parameter exists in gdb.
      So no more errors after this point.  */
 
@@ -1056,7 +1061,7 @@ gdbscm_parameter_value (SCM self)
       struct cmd_list_element *alias, *prefix, *cmd;
       char *newarg;
       int found = -1;
-      struct gdb_exception except = exception_none;
+      gdbscm_gdb_exception except {};
 
       gdb::unique_xmalloc_ptr<char> name
        = gdbscm_scm_to_host_string (self, NULL, &except_scm);
@@ -1069,7 +1074,7 @@ gdbscm_parameter_value (SCM self)
        }
       catch (const gdb_exception &ex)
        {
-         except = ex;
+         except = unpack (ex);
        }
 
       xfree (newarg);
This page took 0.026934 seconds and 4 git commands to generate.