diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-06-10 00:22:41 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-06-10 00:22:41 +0000 |
commit | e2e11a41954b154b64ea31a53aca4a7973019749 (patch) | |
tree | 51e2fd7d4e79fc95a163810fbe8568d939766100 | |
parent | f38fc537cbcfb1f2220c6237ec22a5082ee621b5 (diff) | |
download | gdb-e2e11a41954b154b64ea31a53aca4a7973019749.zip gdb-e2e11a41954b154b64ea31a53aca4a7973019749.tar.gz gdb-e2e11a41954b154b64ea31a53aca4a7973019749.tar.bz2 |
Make char *, const char *.
-rw-r--r-- | gdb/ChangeLog | 28 | ||||
-rw-r--r-- | gdb/cli-out.c | 53 | ||||
-rw-r--r-- | gdb/mi/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/mi/mi-out.c | 43 | ||||
-rw-r--r-- | gdb/ui-out.c | 44 | ||||
-rw-r--r-- | gdb/ui-out.h | 25 |
6 files changed, 141 insertions, 63 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c2b2d2c..6a33912 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,31 @@ +2001-06-09 Andrew Cagney <ac131313@redhat.com> + + * ui-out.h (table_begin_ftype): Make string parameters constant. + (table_header_ftype): Ditto. + (field_int_ftype): Ditto. + (field_skip_ftype): Ditto. + (field_string_ftype): Ditto. + (field_fmt_ftype): Ditto. + (text_ftype): Ditto. + (message_ftype): Ditto. + * cli-out.c (cli_table_begin): Ditto. + (cli_table_header): Ditto. + (cli_field_int): Ditto. + (cli_field_skip): Ditto. + (cli_field_string): Ditto. + (cli_field_fmt): Ditto. + (cli_text): Ditto. + (cli_message): Ditto. + (out_field_fmt): Ditto. + * ui-out.c (default_table_begin): Ditto. + (default_table_header): Ditto. + (default_field_int): Ditto. + (default_field_skip): Ditto. + (default_field_string): Ditto. + (default_field_fmt): Ditto. + (default_text): Ditto. + (default_message): Ditto. + 2001-06-08 Michael Snyder <msnyder@redhat.com> * breakpoint.c (delete_breakpoint): Pass mark_inserted to diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 8d68e03..172356a 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -38,28 +38,31 @@ struct ui_out_data /* These are the CLI output functions */ -static void cli_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid); +static void cli_table_begin (struct ui_out *uiout, int nbrofcols, + const char *tblid); static void cli_table_body (struct ui_out *uiout); static void cli_table_end (struct ui_out *uiout); static void cli_table_header (struct ui_out *uiout, int width, - enum ui_align alig, char *colhdr); + enum ui_align alig, + const char *colhdr); static void cli_begin (struct ui_out *uiout, enum ui_out_type type, int level, const char *lstid); static void cli_end (struct ui_out *uiout, enum ui_out_type type, int level); static void cli_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname, int value); + enum ui_align alig, const char *fldname, int value); static void cli_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname); + enum ui_align alig, const char *fldname); static void cli_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname, + enum ui_align alig, const char *fldname, const char *string); static void cli_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, char *format, va_list args); + const char *fldname, const char *format, + va_list args); static void cli_spaces (struct ui_out *uiout, int numspaces); -static void cli_text (struct ui_out *uiout, char *string); -static void cli_message (struct ui_out *uiout, int verbosity, char *format, - va_list args); +static void cli_text (struct ui_out *uiout, const char *string); +static void cli_message (struct ui_out *uiout, int verbosity, + const char *format, va_list args); static void cli_wrap_hint (struct ui_out *uiout, char *identstring); static void cli_flush (struct ui_out *uiout); @@ -93,8 +96,9 @@ extern void _initialize_cli_out (void); static void field_separator (void); -static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, - char *format,...); +static void out_field_fmt (struct ui_out *uiout, int fldno, + const char *fldname, + const char *format,...); /* local variables */ @@ -103,7 +107,8 @@ static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, /* Mark beginning of a table */ void -cli_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) +cli_table_begin (struct ui_out *uiout, int nbrofcols, + const char *tblid) { } @@ -127,7 +132,7 @@ cli_table_end (struct ui_out *uiout) void cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment, - char *colhdr) + const char *colhdr) { cli_field_string (uiout, 0, width, alignment, 0, colhdr); } @@ -155,7 +160,8 @@ cli_end (struct ui_out *uiout, void cli_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alignment, char *fldname, int value) + enum ui_align alignment, + const char *fldname, int value) { char buffer[20]; /* FIXME: how many chars long a %d can become? */ @@ -167,7 +173,8 @@ cli_field_int (struct ui_out *uiout, int fldno, int width, void cli_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alignment, char *fldname) + enum ui_align alignment, + const char *fldname) { cli_field_string (uiout, fldno, width, alignment, fldname, ""); } @@ -180,7 +187,7 @@ cli_field_string (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, + const char *fldname, const char *string) { int before = 0; @@ -225,7 +232,9 @@ cli_field_string (struct ui_out *uiout, void cli_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, char *format, va_list args) + const char *fldname, + const char *format, + va_list args) { struct ui_out_data *data = ui_out_data (uiout); vfprintf_filtered (data->stream, format, args); @@ -242,14 +251,15 @@ cli_spaces (struct ui_out *uiout, int numspaces) } void -cli_text (struct ui_out *uiout, char *string) +cli_text (struct ui_out *uiout, const char *string) { struct ui_out_data *data = ui_out_data (uiout); fputs_filtered (string, data->stream); } void -cli_message (struct ui_out *uiout, int verbosity, char *format, va_list args) +cli_message (struct ui_out *uiout, int verbosity, + const char *format, va_list args) { struct ui_out_data *data = ui_out_data (uiout); if (ui_out_get_verblvl (uiout) >= verbosity) @@ -276,8 +286,9 @@ cli_flush (struct ui_out *uiout) /* VARARGS */ static void -out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, - char *format,...) +out_field_fmt (struct ui_out *uiout, int fldno, + const char *fldname, + const char *format,...) { struct ui_out_data *data = ui_out_data (uiout); va_list args; diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 3398252..1326484 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,14 @@ +2001-06-09 Andrew Cagney <ac131313@redhat.com> + + * mi-out.c (mi_table_begin): + (mi_table_header): + (mi_field_int): + (mi_field_skip): + (mi_field_string): + (mi_field_fmt): + (mi_text): + (mi_message): + 2001-05-12 Andrew Cagney <ac131313@redhat.com> * mi-out.c (mi_close, mi_open): Output ``[]'' when a list. diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index b2bfaed..1063d57 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -38,28 +38,31 @@ struct ui_out_data /* These are the MI output functions */ -static void mi_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid); +static void mi_table_begin (struct ui_out *uiout, int nbrofcols, + const char *tblid); static void mi_table_body (struct ui_out *uiout); static void mi_table_end (struct ui_out *uiout); static void mi_table_header (struct ui_out *uiout, int width, - enum ui_align alig, char *colhdr); + enum ui_align alig, + const char *colhdr); static void mi_begin (struct ui_out *uiout, enum ui_out_type type, int level, const char *id); static void mi_end (struct ui_out *uiout, enum ui_out_type type, int level); static void mi_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname, int value); + enum ui_align alig, const char *fldname, int value); static void mi_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname); + enum ui_align alig, const char *fldname); static void mi_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname, + enum ui_align alig, const char *fldname, const char *string); static void mi_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, char *format, va_list args); + const char *fldname, const char *format, + va_list args); static void mi_spaces (struct ui_out *uiout, int numspaces); -static void mi_text (struct ui_out *uiout, char *string); -static void mi_message (struct ui_out *uiout, int verbosity, char *format, - va_list args); +static void mi_text (struct ui_out *uiout, const char *string); +static void mi_message (struct ui_out *uiout, int verbosity, + const char *format, va_list args); static void mi_wrap_hint (struct ui_out *uiout, char *identstring); static void mi_flush (struct ui_out *uiout); @@ -100,7 +103,8 @@ static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, /* Mark beginning of a table */ void -mi_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) +mi_table_begin (struct ui_out *uiout, int nbrofcols, + const char *tblid) { struct ui_out_data *data = ui_out_data (uiout); field_separator (uiout); @@ -136,7 +140,8 @@ mi_table_end (struct ui_out *uiout) /* Specify table header */ void -mi_table_header (struct ui_out *uiout, int width, int alignment, char *colhdr) +mi_table_header (struct ui_out *uiout, int width, int alignment, + const char *colhdr) { struct ui_out_data *data = ui_out_data (uiout); if (!data->first_header++) @@ -180,7 +185,7 @@ mi_end (struct ui_out *uiout, void mi_field_int (struct ui_out *uiout, int fldno, int width, int alignment, - char *fldname, int value) + const char *fldname, int value) { char buffer[20]; /* FIXME: how many chars long a %d can become? */ @@ -192,7 +197,7 @@ mi_field_int (struct ui_out *uiout, int fldno, int width, int alignment, void mi_field_skip (struct ui_out *uiout, int fldno, int width, int alignment, - char *fldname) + const char *fldname) { mi_field_string (uiout, fldno, width, alignment, fldname, ""); } @@ -205,7 +210,7 @@ mi_field_string (struct ui_out *uiout, int fldno, int width, int align, - char *fldname, + const char *fldname, const char *string) { struct ui_out_data *data = ui_out_data (uiout); @@ -223,7 +228,9 @@ mi_field_string (struct ui_out *uiout, void mi_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, char *format, va_list args) + const char *fldname, + const char *format, + va_list args) { struct ui_out_data *data = ui_out_data (uiout); field_separator (uiout); @@ -241,12 +248,14 @@ mi_spaces (struct ui_out *uiout, int numspaces) } void -mi_text (struct ui_out *uiout, char *string) +mi_text (struct ui_out *uiout, const char *string) { } void -mi_message (struct ui_out *uiout, int verbosity, char *format, va_list args) +mi_message (struct ui_out *uiout, int verbosity, + const char *format, + va_list args) { } diff --git a/gdb/ui-out.c b/gdb/ui-out.c index b5c1006..2b2837a 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -135,11 +135,12 @@ pop_level (struct ui_out *uiout, /* These are the default implementation functions */ static void default_table_begin (struct ui_out *uiout, int nbrofcols, - char *tblid); + const char *tblid); static void default_table_body (struct ui_out *uiout); static void default_table_end (struct ui_out *uiout); static void default_table_header (struct ui_out *uiout, int width, - enum ui_align alig, char *colhdr); + enum ui_align alig, + const char *colhdr); static void default_begin (struct ui_out *uiout, enum ui_out_type type, int level, const char *id); @@ -147,18 +148,25 @@ static void default_end (struct ui_out *uiout, enum ui_out_type type, int level); static void default_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname, int value); + enum ui_align alig, + const char *fldname, + int value); static void default_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, char *fldname); + enum ui_align alig, + const char *fldname); static void default_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align align, char *fldname, + enum ui_align align, + const char *fldname, const char *string); static void default_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, char *format, va_list args); + const char *fldname, + const char *format, + va_list args); static void default_spaces (struct ui_out *uiout, int numspaces); -static void default_text (struct ui_out *uiout, char *string); -static void default_message (struct ui_out *uiout, int verbosity, char *format, +static void default_text (struct ui_out *uiout, const char *string); +static void default_message (struct ui_out *uiout, int verbosity, + const char *format, va_list args); static void default_wrap_hint (struct ui_out *uiout, char *identstring); static void default_flush (struct ui_out *uiout); @@ -684,7 +692,7 @@ gdb_query (struct ui_out *uiout, int qflags, char *qprompt) /* default gdb-out hook functions */ static void -default_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) +default_table_begin (struct ui_out *uiout, int nbrofcols, const char *tblid) { } @@ -700,7 +708,7 @@ default_table_end (struct ui_out *uiout) static void default_table_header (struct ui_out *uiout, int width, enum ui_align alignment, - char *colhdr) + const char *colhdr) { } @@ -721,13 +729,14 @@ default_end (struct ui_out *uiout, static void default_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align align, char *fldname, int value) + enum ui_align align, + const char *fldname, int value) { } static void default_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align align, char *fldname) + enum ui_align align, const char *fldname) { } @@ -736,14 +745,16 @@ default_field_string (struct ui_out *uiout, int fldno, int width, enum ui_align align, - char *fldname, + const char *fldname, const char *string) { } static void default_field_fmt (struct ui_out *uiout, int fldno, int width, - enum ui_align align, char *fldname, char *format, + enum ui_align align, + const char *fldname, + const char *format, va_list args) { } @@ -754,12 +765,13 @@ default_spaces (struct ui_out *uiout, int numspaces) } static void -default_text (struct ui_out *uiout, char *string) +default_text (struct ui_out *uiout, const char *string) { } static void -default_message (struct ui_out *uiout, int verbosity, char *format, +default_message (struct ui_out *uiout, int verbosity, + const char *format, va_list args) { } diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 9fe0be7..3cc24c6 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -190,11 +190,12 @@ extern void gdb_query (struct ui_out *uiout, int qflags, char *qprompt); /* Type definition of all implementation functions. */ typedef void (table_begin_ftype) (struct ui_out * uiout, - int nbrofcols, char *tblid); + int nbrofcols, const char *tblid); typedef void (table_body_ftype) (struct ui_out * uiout); typedef void (table_end_ftype) (struct ui_out * uiout); typedef void (table_header_ftype) (struct ui_out * uiout, int width, - enum ui_align align, char *colhdr); + enum ui_align align, + const char *colhdr); /* Note: level 0 is the top-level so LEVEL is always greater than zero. */ typedef void (ui_out_begin_ftype) (struct ui_out *uiout, @@ -204,19 +205,25 @@ typedef void (ui_out_end_ftype) (struct ui_out *uiout, enum ui_out_type type, int level); typedef void (field_int_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, char *fldname, int value); + enum ui_align align, + const char *fldname, int value); typedef void (field_skip_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, char *fldname); + enum ui_align align, + const char *fldname); typedef void (field_string_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, char *fldname, + enum ui_align align, + const char *fldname, const char *string); typedef void (field_fmt_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, char *fldname, - char *format, va_list args); + enum ui_align align, + const char *fldname, + const char *format, + va_list args); typedef void (spaces_ftype) (struct ui_out * uiout, int numspaces); -typedef void (text_ftype) (struct ui_out * uiout, char *string); +typedef void (text_ftype) (struct ui_out * uiout, + const char *string); typedef void (message_ftype) (struct ui_out * uiout, int verbosity, - char *format, va_list args); + const char *format, va_list args); typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring); typedef void (flush_ftype) (struct ui_out * uiout); |