* varobj.c (update_dynamic_varobj_children): Make 'name' const.

* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
	* python/python.c (gdbpy_parameter): Make 'arg' const.
	(execute_gdb_command): Likewise.
	(gdbpy_decode_line): Likewise.  Copy it.
	(gdbpy_parse_and_eval): Make 'expr_string' const.  Copy it.
	(gdbpy_write): Make 'arg' const.
	* python/py-type.c (typy_lookup_typename): Make 'type_name'
	const.
	(gdbpy_lookup_type): Likewise.
	* python/py-prettyprint.c (print_children): Make 'name' const.
	* python/py-param.c (parmpy_init): Make 'name' const.  Copy it.
	* python/py-inferior.c (infpy_write_memory): Make 'buf_len' a
	Py_ssize_t.
	* python/py-function.c (fnpy_init): Make 'name' const.
	* python/py-cmd.c (cmdpy_init): Make 'name' const.  Copy it.
	(gdbpy_string_to_argv): Make 'input' const.
	* python/py-breakpoint.c (bppy_init): Make 'spec' const.  Copy
	it.
	* gdbtypes.h (lookup_typename): Update.
	* gdbtypes.c (lookup_typename): Make 'name' const.
	(lookup_struct): Likewise.
	(lookup_union): Likewise.
	(lookup_enum): Likewise.
This commit is contained in:
Tom Tromey 2011-06-24 19:47:37 +00:00
parent 5998129b54
commit ddd49eeec4
13 changed files with 82 additions and 35 deletions

View file

@ -405,7 +405,8 @@ static int
cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
{
cmdpy_object *obj = (cmdpy_object *) self;
char *name;
const char *name;
char *copy;
int cmdtype;
int completetype = -1;
char *docstring = NULL;
@ -449,7 +450,9 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
return -1;
}
cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
copy = xstrdup (name);
cmd_name = gdbpy_parse_command_name (copy, &cmd_list, &cmdlist);
xfree (copy);
if (! cmd_name)
return -1;
@ -659,7 +662,7 @@ PyObject *
gdbpy_string_to_argv (PyObject *self, PyObject *args)
{
PyObject *py_argv;
char *input;
const char *input;
if (!PyArg_ParseTuple (args, "s", &input))
return NULL;