Fix signature of add_set_enum_cmd. Change VAR parameter to char**.
authorAndrew Cagney <cagney@redhat.com>
Tue, 16 May 2000 03:03:13 +0000 (03:03 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 16 May 2000 03:03:13 +0000 (03:03 +0000)
Cleanup signature of add_set_cmd.  Change VAR parameter to void*.

gdb/ChangeLog
gdb/arm-tdep.c
gdb/command.c
gdb/command.h
gdb/i386-tdep.c
gdb/infrun.c
gdb/mips-tdep.c
gdb/remote.c
gdb/serial.c

index 5b191e3a9ddcbabc4a992f280be7e9a9f8da4e80..2903feb8fd9d503a2d566de6485a1c03ee418229 100644 (file)
@@ -1,3 +1,15 @@
+Mon May 15 09:32:31 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * command.h (add_set_cmd): Change VAR parameter to void pointer.
+       (add_set_enum_cmd): Change VAR parameter to char pointer pointer.
+       (struct command): Change member VAR to void pointer.
+       * command.c (add_set_cmd, add_set_enum_cmd): Update.
+       
+       * remote.c (add_packet_config_cmd), mips-tdep.c
+       (_initialize_mips_tdep), infrun.c (_initialize_infrun),
+       i386-tdep.c (_initialize_i386_tdep), arm-tdep.c
+       (_initialize_arm_tdep): Update VAR parameter to add_set_enum_cmd.
+
 Tue May 16 12:46:04 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * wrapper.h (wrap_value_subscript): Delete declaration.
index 7112c4caf71d00a877013222a6ec8241e4b72674..84a350af8c152449aa287dc8cf6f1665f4dcc535 100644 (file)
@@ -2083,7 +2083,7 @@ The valid values are:\n");
   /* Add the disassembly-flavor command */
   new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
                              valid_flavors,
-                             (char *) &disassembly_flavor,
+                             &disassembly_flavor,
                              helptext,
                              &setlist);
   new_cmd->function.sfunc = set_disassembly_flavor_sfunc;
index d753d77fef37307dd4b5a9710054d159b8ef936c..8c35ed429d9a2ae34249abd8df50ee9787dbd25d 100644 (file)
@@ -285,13 +285,12 @@ empty_sfunc (args, from_tty, c)
    DOC is the documentation string.  */
 
 struct cmd_list_element *
-add_set_cmd (name, class, var_type, var, doc, list)
-     char *name;
-     enum command_class class;
-     var_types var_type;
-     char *var;
-     char *doc;
-     struct cmd_list_element **list;
+add_set_cmd (char *name,
+            enum command_class class,
+            var_types var_type,
+            void *var,
+            char *doc,
+            struct cmd_list_element **list)
 {
   struct cmd_list_element *c
   = add_cmd (name, class, NO_FUNCTION, doc, list);
@@ -314,13 +313,12 @@ add_set_cmd (name, class, var_type, var, doc, list)
    DOC is the documentation string.  */
 
 struct cmd_list_element *
-add_set_enum_cmd (name, class, enumlist, var, doc, list)
-     char *name;
-     enum command_class class;
-     char *enumlist[];
-     char *var;
-     char *doc;
-     struct cmd_list_element **list;
+add_set_enum_cmd (char *name,
+                 enum command_class class,
+                 char *enumlist[],
+                 char **var,
+                 char *doc,
+                 struct cmd_list_element **list)
 {
   struct cmd_list_element *c
   = add_set_cmd (name, class, var_enum, var, doc, list);
index 20e4fd50ed61cdd7a51b8703f03844d16cb6d97e..4cff582a20ce2d739966f50bac895a5c16f676fa 100644 (file)
@@ -194,7 +194,7 @@ struct cmd_list_element
 
     /* Pointer to variable affected by "set" and "show".  Doesn't matter
        if type is not_set.  */
-    char *var;
+    void *var;
 
     /* What kind of variable is *VAR?  */
     var_types var_type;
@@ -284,13 +284,18 @@ extern void help_list (struct cmd_list_element *, char *,
 extern void help_cmd_list (struct cmd_list_element *, enum command_class,
                           char *, int, struct ui_file *);
 
-extern struct cmd_list_element *
-  add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
-                      struct cmd_list_element **));
-
-extern struct cmd_list_element *
-  add_set_enum_cmd PARAMS ((char *name, enum command_class, char *list[],
-                      char *var, char *doc, struct cmd_list_element ** c));
+extern struct cmd_list_element *add_set_cmd (char *name, enum
+                                            command_class class,
+                                            var_types var_type, void *var,
+                                            char *doc,
+                                            struct cmd_list_element **list);
+
+extern struct cmd_list_element *add_set_enum_cmd (char *name,
+                                                 enum command_class class,
+                                                 char *enumlist[],
+                                                 char **var,
+                                                 char *doc,
+                                                 struct cmd_list_element **list);
 
 extern struct cmd_list_element *
   add_show_from_set PARAMS ((struct cmd_list_element *,
index 39990db0688838c6b98658e1ca37b56b505d54eb..03c4cf3bd5f367b82b735904987f0c0c34da02eb 100644 (file)
@@ -938,7 +938,7 @@ _initialize_i386_tdep ()
 
     new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
                                valid_flavors,
-                               (char *) &disassembly_flavor,
+                               &disassembly_flavor,
                                "Set the disassembly flavor, the valid values are \"att\" and \"intel\", \
 and the default value is \"att\".",
                                &setlist);
index 75cdf731aa3840247b5276fd9f679cf5c2ce3264..0e84a6d02504bdb859b35b8072f274374826652a 100644 (file)
@@ -4267,7 +4267,7 @@ to the user would be loading/unloading of a new library.\n",
   c = add_set_enum_cmd ("follow-fork-mode",
                        class_run,
                        follow_fork_mode_kind_names,
-                       (char *) &follow_fork_mode_string,
+                       &follow_fork_mode_string,
 /* ??rehrauer:  The "both" option is broken, by what may be a 10.20
    kernel problem.  It's also not terribly useful without a GUI to
    help the user drive two debuggers.  So for now, I'm disabling
@@ -4302,7 +4302,7 @@ By default, the debugger will follow the parent process.",
 
   c = add_set_enum_cmd ("scheduler-locking", class_run,
                        scheduler_enums,        /* array of string names */
-                       (char *) &scheduler_mode,       /* current mode  */
+                       &scheduler_mode,        /* current mode  */
                        "Set mode for locking scheduler during execution.\n\
 off  == no locking (threads may preempt at any time)\n\
 on   == full locking (no thread except the current thread may run)\n\
index cb790b2095f8340791d0bb4b03427530e1d54542..964b3667220c33b1788b0f91eda7c80acf329fd9 100644 (file)
@@ -4153,9 +4153,9 @@ _initialize_mips_tdep ()
 
   /* Allow the user to override the saved register size. */
   add_show_from_set (add_set_enum_cmd ("saved-gpreg-size",
-                                 class_obscure,
-                                 size_enums,
-                                 (char *) &mips_saved_regsize_string, "\
+                                      class_obscure,
+                                      size_enums,
+                                      &mips_saved_regsize_string, "\
 Set size of general purpose registers saved on the stack.\n\
 This option can be set to one of:\n\
   32    - Force GDB to treat saved GP registers as 32-bit\n\
@@ -4163,14 +4163,14 @@ This option can be set to one of:\n\
   auto  - Allow GDB to use the target's default setting or autodetect the\n\
           saved GP register size from information contained in the executable.\n\
           (default: auto)",
-                                 &setmipscmdlist),
+                                      &setmipscmdlist),
                     &showmipscmdlist);
 
   /* Allow the user to override the argument stack size. */
   add_show_from_set (add_set_enum_cmd ("stack-arg-size",
                                       class_obscure,
                                       size_enums,
-                                      (char *) &mips_stack_argsize_string, "\
+                                      &mips_stack_argsize_string, "\
 Set the amount of stack space reserved for each argument.\n\
 This option can be set to one of:\n\
   32    - Force GDB to allocate 32-bit chunks per argument\n\
index 1087d9f014a2fc6029458795373daa157e08e241..ea3c24f239a4d37829d6765fa8ec5a4bf435c984 100644 (file)
@@ -624,7 +624,7 @@ add_packet_config_cmd (config, name, title, set_func, show_func,
   asprintf (&full_name, "%s-packet", name);
   c = add_set_enum_cmd (full_name,
                        class_obscure, packet_support_enums,
-                       (char *) &config->state,
+                       &config->state,
                        set_doc, setlist);
   c->function.sfunc = set_func;
   add_cmd (full_name, class_obscure, show_func, show_doc, showlist);
index e843e0e0bbfd8525b1ed78b5a5a7d168acaf6b74..0914e39b33f057b0b4f81c6bd4e05006bd03df8b 100644 (file)
@@ -667,7 +667,7 @@ by gdbserver.",
 
   add_show_from_set
     (add_set_enum_cmd ("remotelogbase", no_class,
-                      logbase_enums, (char *) &serial_logbase,
+                      logbase_enums, &serial_logbase,
                       "Set numerical base for remote session logging",
                       &setlist),
      &showlist);