From 19c1ef65d7309fbce692396866d54e7ede61e7dd Mon Sep 17 00:00:00 2001 From: "Paul N. Hilfinger" Date: Thu, 1 Jul 2004 10:11:11 +0000 Subject: [PATCH] Address complaints from gdb_ari.sh: * ada-exp.y: Include gdb_string.h rather than string.h. (convert_char_literal): Reformat declaration. * ada-lang.h: Include opaque struct declaration for struct frame_info. * ada-lex.l: Change use of free to xfree (the macro would do so anyway, but this is harmless). Include gdb_string.h rather than string.h. * ada-valprint.c (ada_val_print_stub): Change PTR => void*. * ada-lang.c (parse): Remove K&Rism in parameter list. (is_name_suffix): Correct Linux => GNU/Linux in comment. --- gdb/ChangeLog | 15 +++++++++++++++ gdb/ada-exp.y | 5 ++--- gdb/ada-lang.c | 11 ++++++----- gdb/ada-lang.h | 1 + gdb/ada-lex.l | 4 ++-- gdb/ada-valprint.c | 4 ++-- 6 files changed, 28 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3373483..8dd5a17 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +2004-07-01 Paul N. Hilfinger + + Address complaints from gdb_ari.sh: + + * ada-exp.y: Include gdb_string.h rather than string.h. + (convert_char_literal): Reformat declaration. + * ada-lang.h: Include opaque struct declaration for struct frame_info. + * ada-lex.l: Change use of free to xfree (the macro would do so + anyway, but this is harmless). + Include gdb_string.h rather than string.h. + * ada-valprint.c (ada_val_print_stub): Change PTR => void*. + + * ada-lang.c (parse): Remove K&Rism in parameter list. + (is_name_suffix): Correct Linux => GNU/Linux in comment. + 2004-06-30 Mark Kettenis * dbxread.c (process_one_symbol) [SUN_FIXED_LBRAC_BUG]: Remove diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 04a3950..a01eff4 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -38,7 +38,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ %{ #include "defs.h" -#include +#include "gdb_string.h" #include #include "expression.h" #include "value.h" @@ -125,8 +125,7 @@ static void write_object_renaming (struct block *, struct symbol *, int); static void write_var_from_name (struct block *, struct name_info); -static LONGEST -convert_char_literal (struct type *, LONGEST); +static LONGEST convert_char_literal (struct type *, LONGEST); %} %union diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6ec5044..2d9aa35 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2596,9 +2596,9 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, break; case OP_STRING: - (*pos) += 3 - + BYTES_TO_EXP_ELEM (longest_to_int (exp->elts[pc + 1].longconst) + - 1); + (*pos) += 3 + + BYTES_TO_EXP_ELEM (longest_to_int (exp->elts[pc + 1].longconst) + + 1); break; case TERNOP_SLICE: @@ -4755,7 +4755,8 @@ ada_lookup_symbol_nonlocal (const char *name, names (e.g., XVE) are not included here. Currently, the possible suffixes are given by either of the regular expression: - (__[0-9]+)?\.[0-9]+ [nested subprogram suffix, on platforms such as Linux] + (__[0-9]+)?\.[0-9]+ [nested subprogram suffix, on platforms such + as GNU/Linux] ___[0-9]+ [nested subprogram suffix, on platforms such as HP/UX] (X[nb]*)?((\$|__)[0-9](_?[0-9]+)|___(LJM|X([FDBUP].*|R[^T]?)))?$ */ @@ -10098,7 +10099,7 @@ emit_char (int c, struct ui_file *stream, int quoter) } static int -parse () +parse (void) { warnings_issued = 0; return ada_parse (); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 5f5a7f5..12eaf4b 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -22,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ADA_LANG_H 1 struct partial_symbol; +struct frame_info; #include "value.h" #include "gdbtypes.h" diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index ca0414c..a7ce816 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -331,7 +331,7 @@ xor { return XOR; } %% #include -#include +#include "gdb_string.h" /* Initialize the lexer for processing new expression */ void @@ -724,7 +724,7 @@ name_lookup (char *name0, char *err_name, int *token_type, int depth) strlen (renaming) + len0 - yylval.ssym.stoken.length + 1); strcpy (new_name, renaming); - free (renaming); + xfree (renaming); strcat (new_name, name0 + yylval.ssym.stoken.length); result = name_lookup (new_name, err_name, token_type, depth - 1); if (result > segments) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index a2aa382..c7440e6 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -69,7 +69,7 @@ static void val_print_packed_array_elements (struct type *, char *valaddr, static void adjust_type_signedness (struct type *); -static int ada_val_print_stub (PTR args0); +static int ada_val_print_stub (void *args0); static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR, struct ui_file *, int, int, int, @@ -563,7 +563,7 @@ ada_val_print (struct type *type, char *valaddr0, int embedded_offset, /* Helper for ada_val_print; used as argument to catch_errors to unmarshal the arguments to ada_val_print_1, which does the work. */ static int -ada_val_print_stub (PTR args0) +ada_val_print_stub (void *args0) { struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0; return ada_val_print_1 (argsp->type, argsp->valaddr0, -- 2.7.4