This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[ob] Fix -Werror problems
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: insight at sources dot redhat dot com
- Date: Tue, 11 Feb 2003 17:08:09 +0100
- Subject: [ob] Fix -Werror problems
FYI,
The attached fixes the -Werror problems.
Committed,
Andrew
2003-02-10 Andrew Cagney <ac131313@redhat.com>
* generic/gdbtk-varobj.c (gdb_variable_command): Ditto for
`commands'.
(variable_type): Ditto for `first'.
(variable_obj_command): Ditto.
(variable_create): Ditto for create_options.
(variable_type): Ditto for `last'. Use `string' and not `first'
when modifying the buffer.
(struct disassembly_client_data ): Ditto for `asm_argv'
* generic/gdbtk-register.c (gdb_register_info): Ditto for
`commands'.
* generic/gdbtk-hooks.c (tk_command_loop): Ditto for `msg'.
* generic/gdbtk-cmds.c (gdb_search): Ditto for `switches'.
(gdbtk_load_source): Ditto for `text_argv'.
(struct disassembly_client_data ): Ditto for `source_argv'.
(gdbtk_load_asm): Ditto for `text_argv'.
(struct disassembly_client_data ): Ditto for `asm_argv'
(gdb_loadfile): Ditto for `text_argv'.
* generic/gdbtk.c (TclDebug): Make `v' a constant pointer.
(gdbtk_init): Ditto for `old_chain', `src_path', `msg', and
`lib_path'.
Index: generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.65
diff -u -r1.65 gdbtk-cmds.c
--- generic/gdbtk-cmds.c 6 Dec 2002 16:26:40 -0000 1.65
+++ generic/gdbtk-cmds.c 11 Feb 2003 16:06:12 -0000
@@ -100,8 +100,8 @@
Tcl_Interp *interp;
char *widget;
Tcl_Obj *result_obj[3];
- char *asm_argv[14];
- char *source_argv[7];
+ const char *asm_argv[14];
+ const char *source_argv[7];
char *map_arr;
Tcl_DString src_to_line_prefix;
Tcl_DString pc_to_line_prefix;
@@ -1226,9 +1226,9 @@
int static_only, nfiles;
Tcl_Obj **file_list;
char **files;
- static char *search_options[] =
+ static const char *search_options[] =
{"functions", "variables", "types", (char *) NULL};
- static char *switches[] =
+ static const char *switches[] =
{"-files", "-filename", "-static", (char *) NULL};
enum search_opts
{
@@ -1784,7 +1784,7 @@
if (client_data->file_opened_p == 1)
{
- char **text_argv;
+ const char **text_argv;
char line[10000], line_number[18];
int found_carriage_return = 1;
@@ -1910,7 +1910,7 @@
{
struct disassembly_client_data * client_data
= (struct disassembly_client_data *) clientData;
- char **text_argv;
+ const char **text_argv;
int i, pc_to_line_len, line_to_pc_len;
gdbtk_result new_result;
struct cleanup *old_chain = NULL;
@@ -2745,7 +2745,7 @@
long mtime = 0;
struct stat st;
char line[10000], line_num_buf[18];
- char *text_argv[9];
+ const char *text_argv[9];
Tcl_CmdInfo text_cmd;
Index: generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.29
diff -u -r1.29 gdbtk-hooks.c
--- generic/gdbtk-hooks.c 4 Dec 2002 16:21:21 -0000 1.29
+++ generic/gdbtk-hooks.c 11 Feb 2003 16:06:13 -0000
@@ -374,7 +374,7 @@
if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_preloop") != TCL_OK)
{
- char *msg;
+ const char *msg;
/* Force errorInfo to be set up propertly. */
Tcl_AddErrorInfo (gdbtk_interp, "");
Index: generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.13
diff -u -r1.13 gdbtk-register.c
--- generic/gdbtk-register.c 17 Dec 2002 20:29:11 -0000 1.13
+++ generic/gdbtk-register.c 11 Feb 2003 16:06:13 -0000
@@ -121,7 +121,7 @@
int index;
void *argp;
void (*func)(int, void *);
- static char *commands[] = {"changed", "name", "size", "value", "type",
+ static const char *commands[] = {"changed", "name", "size", "value", "type",
"format", "group", "grouplist", NULL};
enum commands_enum { REGINFO_CHANGED, REGINFO_NAME, REGINFO_SIZE, REGINFO_VALUE,
REGINFO_TYPE, REGINFO_FORMAT, REGINFO_GROUP, REGINFO_GROUPLIST };
Index: generic/gdbtk-varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-varobj.c,v
retrieving revision 1.15
diff -u -r1.15 gdbtk-varobj.c
--- generic/gdbtk-varobj.c 6 Nov 2002 20:29:14 -0000 1.15
+++ generic/gdbtk-varobj.c 11 Feb 2003 16:06:13 -0000
@@ -114,7 +114,7 @@
gdb_variable_command (ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[])
{
- static char *commands[] =
+ static const char *commands[] =
{"create", "list", NULL};
enum commands_enum
{
@@ -177,7 +177,7 @@
VARIABLE_EDITABLE,
VARIABLE_UPDATE
};
- static char *commands[] =
+ static const char *commands[] =
{
"delete",
"numChildren",
@@ -292,7 +292,7 @@
{
CREATE_EXPR, CREATE_FRAME
};
- static char *create_options[] =
+ static const char *create_options[] =
{"-expr", "-frame", NULL};
struct varobj *var;
char *name;
@@ -512,7 +512,9 @@
variable_type (Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[], struct varobj *var)
{
- char *first, *last, *string;
+ const char *first;
+ const char *last;
+ char *string;
Tcl_RegExp regexp;
/* For the "fake" variables, do not return a type.
@@ -536,7 +538,7 @@
Tcl_RegExpRange (regexp, 0, &first, &last);
if (*(first - 1) == ' ')
first--;
- *first = '\0';
+ string[first - string] = '\0';
}
Tcl_SetObjResult (interp, Tcl_NewStringObj (string, -1));
Index: generic/gdbtk.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v
retrieving revision 1.31
diff -u -r1.31 gdbtk.c
--- generic/gdbtk.c 21 Jan 2003 21:45:39 -0000 1.31
+++ generic/gdbtk.c 11 Feb 2003 16:06:13 -0000
@@ -185,7 +185,10 @@
TclDebug (char level, const char *fmt,...)
{
va_list args;
- char *buf, *v[3], *merge, *priority;
+ char *buf;
+ const char *v[3];
+ char *merge;
+ char *priority;
switch (level)
{
@@ -348,7 +351,7 @@
struct cleanup *old_chain;
char *s;
int element_count;
- char **exec_path;
+ const char **exec_path;
CONST char *internal_exec_name;
/* If there is no DISPLAY environment variable, Tk_Init below will fail,
@@ -439,8 +442,8 @@
{
int i, count;
char *src_dir = SRC_DIR;
- char **src_path;
- char **lib_path;
+ const char **src_path;
+ const char **lib_path;
Tcl_DString lib_dstring;
Tcl_DStringInit (&lib_dstring);
@@ -454,7 +457,7 @@
Tcl_SplitPath (src_dir, &count, &src_path);
/* Append tcl/library to src_dir (src_dir=/foo/bar/gdb) */
- lib_path = (char **) alloca ((count + 2) * sizeof (char *));
+ lib_path = (const char **) alloca ((count + 2) * sizeof (char *));
for (i = 0; i < count - 1; i++)
lib_path[i] = src_path[i];
lib_path[i++] = "tcl";
@@ -629,7 +632,7 @@
if (Tcl_GlobalEval (gdbtk_interp, (char *) script) != TCL_OK)
{
- char *msg;
+ const char *msg;
/* Force errorInfo to be set up propertly. */
Tcl_AddErrorInfo (gdbtk_interp, "");