From: Jan Kratochvil Date: Sun, 28 Aug 2011 20:39:29 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91174723392cfb8acc1394c4d5e2bc35dd7980d0;p=binutils-gdb.git gdb/ Code cleanup - make mi_opt const. * mi/mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Make opts const. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise. * mi/mi-cmd-env.c (mi_cmd_env_path): Likewise. (mi_cmd_env_dir): Likewise. * mi/mi-cmd-target.c (mi_cmd_target_file_get): Likewise. (mi_cmd_target_file_put): Likewise. * mi/mi-cmd-target.c (mi_cmd_target_file_delete): Likewise. * mi/mi-cmd-var.c (mi_cmd_var_evaluate_expression): Likewise. * mi/mi-getopt.c (mi_getopt): Make opts and opt const. (mi_valid_noargs): Make opts const. * mi/mi-getopt.h (mi_getopt): Make opts and opt const. * mi/mi-main.c (mi_cmd_list_thread_groups): Make opts const. (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 896e16d5587..6e77fcc89f5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2011-08-28 Jan Kratochvil + + Code cleanup - make mi_opt const. + * mi/mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Make + opts const. + * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise. + * mi/mi-cmd-env.c (mi_cmd_env_path): Likewise. + (mi_cmd_env_dir): Likewise. + * mi/mi-cmd-target.c (mi_cmd_target_file_get): Likewise. + (mi_cmd_target_file_put): Likewise. + * mi/mi-cmd-target.c (mi_cmd_target_file_delete): Likewise. + * mi/mi-cmd-var.c (mi_cmd_var_evaluate_expression): Likewise. + * mi/mi-getopt.c (mi_getopt): Make opts and opt const. + (mi_valid_noargs): Make opts const. + * mi/mi-getopt.h (mi_getopt): Make opts and opt const. + * mi/mi-main.c (mi_cmd_list_thread_groups): Make opts const. + (mi_cmd_data_read_memory): Likewise. + (mi_cmd_data_read_memory_bytes): Likewise. + (mi_cmd_data_write_memory): Likewise. + 2011-08-26 Matt Rice * solib-sunos.c (allocate_rt_common_objfile): Add missing arguments to diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index 2c9d16b9c7c..b3bd5da4db9 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -84,7 +84,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc) IGNORE_COUNT_OPT, THREAD_OPT, PENDING_OPT, DISABLE_OPT, TRACEPOINT_OPT, }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"h", HARDWARE_OPT, 0}, {"t", TEMP_OPT, 0}, @@ -221,7 +221,7 @@ mi_cmd_break_watch (char *command, char **argv, int argc) { READ_OPT, ACCESS_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"r", READ_OPT, 0}, {"a", ACCESS_OPT, 0}, diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c index 6cc0a830993..c2e8265f31f 100644 --- a/gdb/mi/mi-cmd-disas.c +++ b/gdb/mi/mi-cmd-disas.c @@ -83,7 +83,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) { FILE_OPT, LINE_OPT, NUM_OPT, START_OPT, END_OPT }; - static struct mi_opt opts[] = { + static const struct mi_opt opts[] = { {"f", FILE_OPT, 1}, {"l", LINE_OPT, 1}, {"n", NUM_OPT, 1}, diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c index 9676e836d8f..d9e5088cdda 100644 --- a/gdb/mi/mi-cmd-env.c +++ b/gdb/mi/mi-cmd-env.c @@ -125,7 +125,7 @@ mi_cmd_env_path (char *command, char **argv, int argc) { RESET_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"r", RESET_OPT, 0}, { 0, 0, 0 } @@ -197,7 +197,7 @@ mi_cmd_env_dir (char *command, char **argv, int argc) { RESET_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"r", RESET_OPT, 0}, { 0, 0, 0 } diff --git a/gdb/mi/mi-cmd-target.c b/gdb/mi/mi-cmd-target.c index 295a38bd4b1..14b22deb24c 100644 --- a/gdb/mi/mi-cmd-target.c +++ b/gdb/mi/mi-cmd-target.c @@ -29,7 +29,7 @@ mi_cmd_target_file_get (char *command, char **argv, int argc) int optind = 0; char *optarg; const char *remote_file, *local_file; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { { 0, 0, 0 } }; @@ -53,7 +53,7 @@ mi_cmd_target_file_put (char *command, char **argv, int argc) int optind = 0; char *optarg; const char *remote_file, *local_file; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { { 0, 0, 0 } }; @@ -77,7 +77,7 @@ mi_cmd_target_file_delete (char *command, char **argv, int argc) int optind = 0; char *optarg; const char *remote_file; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { { 0, 0, 0 } }; diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index c50f8631ed4..16fbb853f61 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -561,7 +561,7 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) { OP_FORMAT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"f", OP_FORMAT, 1}, { 0, 0, 0 } diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c index 81b833a30be..1748688a757 100644 --- a/gdb/mi/mi-getopt.c +++ b/gdb/mi/mi-getopt.c @@ -25,11 +25,11 @@ int mi_getopt (const char *prefix, int argc, char **argv, - struct mi_opt *opts, + const struct mi_opt *opts, int *optind, char **optarg) { char *arg; - struct mi_opt *opt; + const struct mi_opt *opt; /* We assume that argv/argc are ok. */ if (*optind > argc || *optind < 0) @@ -80,7 +80,7 @@ mi_valid_noargs (const char *prefix, int argc, char **argv) { int optind = 0; char *optarg; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { { 0, 0, 0 } }; diff --git a/gdb/mi/mi-getopt.h b/gdb/mi/mi-getopt.h index a34a354e45d..10b290686d1 100644 --- a/gdb/mi/mi-getopt.h +++ b/gdb/mi/mi-getopt.h @@ -42,7 +42,7 @@ struct mi_opt; extern int mi_getopt (const char *prefix, int argc, char **argv, - struct mi_opt *opt, int *optind, char **optarg); + const struct mi_opt *opt, int *optind, char **optarg); /* The option list. Terminated by NAME==NULL. ARG_P that the option requires an argument. INDEX is returned to identify th option. */ diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 04a1c979103..7a9b4db80e2 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -799,7 +799,7 @@ mi_cmd_list_thread_groups (char *command, char **argv, int argc) { AVAILABLE_OPT, RECURSE_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"-available", AVAILABLE_OPT, 0}, {"-recurse", RECURSE_OPT, 1}, @@ -1307,7 +1307,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) { OFFSET_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"o", OFFSET_OPT, 1}, { 0, 0, 0 } @@ -1493,7 +1493,7 @@ mi_cmd_data_read_memory_bytes (char *command, char **argv, int argc) { OFFSET_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"o", OFFSET_OPT, 1}, { 0, 0, 0 } @@ -1594,7 +1594,7 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc) { OFFSET_OPT }; - static struct mi_opt opts[] = + static const struct mi_opt opts[] = { {"o", OFFSET_OPT, 1}, { 0, 0, 0 }