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.
This commit is contained in:
Jan Kratochvil 2011-08-28 20:39:29 +00:00
parent 78662a6e67
commit 9117472339
9 changed files with 37 additions and 17 deletions

View File

@ -1,3 +1,23 @@
2011-08-28 Jan Kratochvil <jan.kratochvil@redhat.com>
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 <ratmice@gmail.com>
* solib-sunos.c (allocate_rt_common_objfile): Add missing arguments to

View File

@ -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},

View File

@ -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},

View File

@ -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 }

View File

@ -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 }
};

View File

@ -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 }

View File

@ -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 }
};

View File

@ -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. */

View File

@ -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 }