sim: constify watchpoint interrupt names
GCC issues warnings because const strings like "foo" are passed as char*. sim-watch.c: In function 'watchpoint_type_to_str': sim-watch.c:120: warning: return discards qualifiers from pointer target type
This commit is contained in:
parent
6bf91687eb
commit
ff398ee4f3
@ -1,3 +1,11 @@
|
|||||||
|
2010-03-30 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* sim-watch.c (watchpoint_type_to_str): Add const to return.
|
||||||
|
(interrupt_nr_to_str): Likewise.
|
||||||
|
(default_interrupt_names): Add const to pointer type.
|
||||||
|
(sim_watchpoint_install): Add const to prefix.
|
||||||
|
* sim-watch.h (struct _sim_watchpoints): Add const to interrupt_names.
|
||||||
|
|
||||||
2010-03-30 Mike Frysinger <vapier@gentoo.org>
|
2010-03-30 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* sim-core.c (sim_core_read_buffer): Change raddr to address_word.
|
* sim-core.c (sim_core_read_buffer): Change raddr to address_word.
|
||||||
|
@ -109,7 +109,7 @@ do_watchpoint_delete (SIM_DESC sd,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
watchpoint_type_to_str (SIM_DESC sd,
|
watchpoint_type_to_str (SIM_DESC sd,
|
||||||
watchpoint_type type)
|
watchpoint_type type)
|
||||||
{
|
{
|
||||||
@ -128,7 +128,7 @@ watchpoint_type_to_str (SIM_DESC sd,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
interrupt_nr_to_str (SIM_DESC sd,
|
interrupt_nr_to_str (SIM_DESC sd,
|
||||||
int interrupt_nr)
|
int interrupt_nr)
|
||||||
{
|
{
|
||||||
@ -381,7 +381,7 @@ static const OPTION watchpoint_options[] =
|
|||||||
{ {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
|
{ {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *default_interrupt_names[] = { "int", 0, };
|
static const char *default_interrupt_names[] = { "int", 0, };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ sim_watchpoint_install (SIM_DESC sd)
|
|||||||
/* adjust first few entries so that they contain real
|
/* adjust first few entries so that they contain real
|
||||||
documentation, the first entry includes a list of actions. */
|
documentation, the first entry includes a list of actions. */
|
||||||
{
|
{
|
||||||
char *prefix =
|
const char *prefix =
|
||||||
"Watch the simulator, take ACTION in COUNT cycles (`+' for every COUNT cycles), ACTION is";
|
"Watch the simulator, take ACTION in COUNT cycles (`+' for every COUNT cycles), ACTION is";
|
||||||
char *doc;
|
char *doc;
|
||||||
int len = strlen (prefix) + 1;
|
int len = strlen (prefix) + 1;
|
||||||
|
@ -63,7 +63,7 @@ typedef struct _sim_watchpoints {
|
|||||||
/* FIXME: can this be done better? Look at the PPC's interrupt
|
/* FIXME: can this be done better? Look at the PPC's interrupt
|
||||||
mechanism and table for a rough idea of where it will go next */
|
mechanism and table for a rough idea of where it will go next */
|
||||||
int nr_interrupts;
|
int nr_interrupts;
|
||||||
char **interrupt_names;
|
const char **interrupt_names;
|
||||||
|
|
||||||
/* active watchpoints */
|
/* active watchpoints */
|
||||||
int last_point_nr;
|
int last_point_nr;
|
||||||
|
Loading…
Reference in New Issue
Block a user