From bde581776ee3d20d2fcd52c8bbc943abf3e4ca89 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 9 Jan 2003 18:30:32 +0000 Subject: [PATCH] 2003-01-09 Andrew Cagney * somsolib.h: Fix function indentation. * disasm.c, buildsym.c, buildsym.h: Eliminate PTR. * gnu-v2-abi.c, f-typeprint.c, x86-64-linux-tdep.c: Eliminate STREQ. * demangle.c, ax-gdb.c, c-valprint.c: Eliminate STREQ. * alpha-osf1-tdep.c, corefile.c: Eliminate STREQ. * somsolib.c, inftarg.c: Remove assignment in if conditional. --- gdb/ChangeLog | 7 +++++++ gdb/alpha-osf1-tdep.c | 2 +- gdb/ax-gdb.c | 2 +- gdb/buildsym.c | 2 +- gdb/buildsym.h | 2 +- gdb/c-valprint.c | 2 +- gdb/corefile.c | 2 +- gdb/demangle.c | 4 ++-- gdb/disasm.c | 2 +- gdb/f-typeprint.c | 2 +- gdb/gnu-v2-abi.c | 4 ++-- gdb/inftarg.c | 3 ++- gdb/somsolib.c | 3 ++- gdb/somsolib.h | 4 ++-- gdb/x86-64-linux-tdep.c | 2 +- 15 files changed, 26 insertions(+), 17 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 721e18fc96a..8ca99a8d0c2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2003-01-09 Andrew Cagney + * somsolib.h: Fix function indentation. + * disasm.c, buildsym.c, buildsym.h: Eliminate PTR. + * gnu-v2-abi.c, f-typeprint.c, x86-64-linux-tdep.c: Eliminate STREQ. + * demangle.c, ax-gdb.c, c-valprint.c: Eliminate STREQ. + * alpha-osf1-tdep.c, corefile.c: Eliminate STREQ. + * somsolib.c, inftarg.c: Remove assignment in if conditional. + * infrun.c (follow_fork): Use ISO C definition. * expprint.c (print_subexp): Use xfree instead of free. * charset.c: Include "gdb_string.h" instead of . diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c index 9a027d45b5c..fa5bc5e41d0 100644 --- a/gdb/alpha-osf1-tdep.c +++ b/gdb/alpha-osf1-tdep.c @@ -42,7 +42,7 @@ alpha_osf1_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc) static int alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name) { - return (func_name != NULL && STREQ ("__sigtramp", func_name)); + return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0); } static CORE_ADDR diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index fa7066c7f96..f2255f56498 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -1157,7 +1157,7 @@ find_field (struct type *type, char *name) { char *this_name = TYPE_FIELD_NAME (type, i); - if (this_name && STREQ (name, this_name)) + if (this_name && strcmp (name, this_name) == 0) return i; if (this_name[0] == '\0') diff --git a/gdb/buildsym.c b/gdb/buildsym.c index ffabe00eb84..eabf8a83670 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -152,7 +152,7 @@ find_symbol_in_list (struct pending *list, char *name, int length) /* ARGSUSED */ void -really_free_pendings (PTR dummy) +really_free_pendings (void *dummy) { struct pending *next, *next1; diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 51aeee75638..b2a249c5574 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -233,7 +233,7 @@ extern void finish_block (struct symbol *symbol, CORE_ADDR start, CORE_ADDR end, struct objfile *objfile); -extern void really_free_pendings (PTR dummy); +extern void really_free_pendings (void *dummy); extern void start_subfile (char *name, char *dirname); diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 925d9c5469c..e7c02cc061d 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -515,7 +515,7 @@ c_value_print (struct value *val, struct ui_file *stream, int format, if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_NAME (type) == NULL && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL && - STREQ (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char")) + strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0) { /* Print nothing */ } diff --git a/gdb/corefile.c b/gdb/corefile.c index be0ecf0e3b0..b5256569a1e 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -439,7 +439,7 @@ static void set_gnutarget_command (char *, int, struct cmd_list_element *); static void set_gnutarget_command (char *ignore, int from_tty, struct cmd_list_element *c) { - if (STREQ (gnutarget_string, "auto")) + if (strcmp (gnutarget_string, "auto") == 0) gnutarget = NULL; else gnutarget = gnutarget_string; diff --git a/gdb/demangle.c b/gdb/demangle.c index 2b9579bc59c..3df9684fe89 100644 --- a/gdb/demangle.c +++ b/gdb/demangle.c @@ -87,8 +87,8 @@ set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c) dem->demangling_style != unknown_demangling; dem++) { - if (STREQ (current_demangling_style_string, - dem->demangling_style_name)) + if (strcmp (current_demangling_style_string, + dem->demangling_style_name) == 0) { current_demangling_style = dem->demangling_style; break; diff --git a/gdb/disasm.c b/gdb/disasm.c index 8ce9a155166..e69458d6e56 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -66,7 +66,7 @@ gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr, } static int -compare_lines (const PTR mle1p, const PTR mle2p) +compare_lines (const void *mle1p, const void *mle2p) { struct dis_line_entry *mle1, *mle2; int val; diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index 2eba3912401..bd34b93b5ec 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -355,7 +355,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, through as TYPE_CODE_INT since dbxstclass.h is so C-oriented, we must change these to "character" from "char". */ - if (STREQ (TYPE_NAME (type), "char")) + if (strcmp (TYPE_NAME (type), "char") == 0) fprintf_filtered (stream, "character"); else goto default_case; diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index fb31c44529f..8ac78111fe2 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -329,8 +329,8 @@ vb_match (struct type *type, int index, struct type *basetype) if (TYPE_NAME (basetype) != NULL && TYPE_NAME (TYPE_TARGET_TYPE (fieldtype)) != NULL - && STREQ (TYPE_NAME (basetype), - TYPE_NAME (TYPE_TARGET_TYPE (fieldtype)))) + && strcmp (TYPE_NAME (basetype), + TYPE_NAME (TYPE_TARGET_TYPE (fieldtype))) == 0) return 1; return 0; } diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 471eb3cc7b5..e12e8bd529a 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -649,7 +649,8 @@ _initialize_inftarg (void) #define PROC_NAME_FMT "/proc/%05d" #endif sprintf (procname, PROC_NAME_FMT, getpid ()); - if ((fd = open (procname, O_RDONLY)) >= 0) + fd = open (procname, O_RDONLY); + if (fd >= 0) { close (fd); return; diff --git a/gdb/somsolib.c b/gdb/somsolib.c index 6cc9f451657..3f74dce0a0c 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -418,7 +418,8 @@ som_solib_add (char *arg_string, int from_tty, struct target_ops *target, int re int threshold_warning_given = 0; /* First validate our arguments. */ - if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL) + re_err = re_comp (arg_string ? arg_string : "."); + if (re_err != NULL) { error ("Invalid regexp: %s", re_err); } diff --git a/gdb/somsolib.h b/gdb/somsolib.h index 4b23760199c..60118b28bf7 100644 --- a/gdb/somsolib.h +++ b/gdb/somsolib.h @@ -36,8 +36,8 @@ extern void som_solib_add (char *, int, struct target_ops *, int); extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR); -extern int -som_solib_section_offsets (struct objfile *, struct section_offsets *); +extern int som_solib_section_offsets (struct objfile *, + struct section_offsets *); /* Function to be called when the inferior starts up, to discover the names of shared libraries that are dynamically linked, the base addresses to diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c index bb127e0f46c..c593abe88da 100644 --- a/gdb/x86-64-linux-tdep.c +++ b/gdb/x86-64-linux-tdep.c @@ -147,7 +147,7 @@ int x86_64_linux_in_sigtramp (CORE_ADDR pc, char *name) { if (name) - return STREQ ("__restore_rt", name); + return strcmp ("__restore_rt", name) == 0; return (x86_64_linux_sigtramp_start (pc) != 0); } -- 2.30.2