From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4057 invoked by alias); 3 Aug 2010 22:39:24 -0000 Received: (qmail 4043 invoked by uid 22791); 3 Aug 2010 22:39:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Aug 2010 22:39:16 +0000 Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by smtp-out.google.com with ESMTP id o73MdDFD025260 for ; Tue, 3 Aug 2010 15:39:13 -0700 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by wpaz9.hot.corp.google.com with ESMTP id o73MdC7g029744 for ; Tue, 3 Aug 2010 15:39:12 -0700 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id BA5C784561; Tue, 3 Aug 2010 15:39:11 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [commit] misc const cleanup Message-Id: <20100803223911.BA5C784561@ruffy.mtv.corp.google.com> Date: Tue, 03 Aug 2010 22:39:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00014.txt.bz2 Hi. fyi, I committed this. 2010-08-03 Doug Evans * breakpoint.c (bpdisp_text): Constify bpdisps. * solib-svr4.c (solib_break_names): Constify. (bkpt_names, main_name_list): Constify. (match_main): Constify soname arg. (bfd_lookup_symbol): Remove unnecessary forward decl. Constify symname arg. (enable_break): Constify bkpt_namep. * symtab.c (search_symbols): Constify types, types2, types3, types4. (symtab_symbol_info): Constify classnames. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.505 diff -u -p -r1.505 breakpoint.c --- breakpoint.c 28 Jul 2010 17:57:54 -0000 1.505 +++ breakpoint.c 3 Aug 2010 22:28:43 -0000 @@ -262,7 +262,7 @@ bpdisp_text (enum bpdisp disp) { /* NOTE: the following values are a part of MI protocol and represent values of 'disp' field returned when inferior stops at a breakpoint. */ - static char *bpdisps[] = {"del", "dstp", "dis", "keep"}; + static const char * const bpdisps[] = {"del", "dstp", "dis", "keep"}; return bpdisps[(int) disp]; } Index: solib-svr4.c =================================================================== RCS file: /cvs/src/src/gdb/solib-svr4.c,v retrieving revision 1.137 diff -u -p -r1.137 solib-svr4.c --- solib-svr4.c 5 Jul 2010 18:04:33 -0000 1.137 +++ solib-svr4.c 3 Aug 2010 22:28:43 -0000 @@ -80,7 +80,7 @@ struct lm_info SVR4 systems will fall back to using a symbol as the "startup mapping complete" breakpoint address. */ -static char *solib_break_names[] = +static const char * const solib_break_names[] = { "r_debug_state", "_r_debug_state", @@ -92,7 +92,7 @@ static char *solib_break_names[] = NULL }; -static char *bkpt_names[] = +static const char * const bkpt_names[] = { "_start", "__start", @@ -100,7 +100,7 @@ static char *bkpt_names[] = NULL }; -static char *main_name_list[] = +static const char * const main_name_list[] = { "main_$main", NULL @@ -357,9 +357,7 @@ get_svr4_info (void) /* Local function prototypes */ -static int match_main (char *); - -static CORE_ADDR bfd_lookup_symbol (bfd *, char *); +static int match_main (const char *); /* @@ -387,7 +385,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd */ static CORE_ADDR -bfd_lookup_symbol (bfd *abfd, char *symname) +bfd_lookup_symbol (bfd *abfd, const char *symname) { long storage_needed; asymbol *sym; @@ -1253,9 +1251,9 @@ svr4_fetch_objfile_link_map (struct objf non-zero iff SONAME matches one of the known main executable names. */ static int -match_main (char *soname) +match_main (const char *soname) { - char **mainp; + const char * const *mainp; for (mainp = main_name_list; *mainp != NULL; mainp++) { @@ -1347,7 +1345,7 @@ static int enable_break (struct svr4_info *info, int from_tty) { struct minimal_symbol *msymbol; - char **bkpt_namep; + const char * const *bkpt_namep; asection *interp_sect; gdb_byte *interp_name; CORE_ADDR sym_addr; Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.247 diff -u -p -r1.247 symtab.c --- symtab.c 28 Jul 2010 16:23:59 -0000 1.247 +++ symtab.c 3 Aug 2010 22:28:43 -0000 @@ -2981,13 +2981,13 @@ search_symbols (char *regexp, domain_enu struct minimal_symbol *msymbol; char *val; int found_misc = 0; - static enum minimal_symbol_type types[] + static const enum minimal_symbol_type types[] = {mst_data, mst_text, mst_abs, mst_unknown}; - static enum minimal_symbol_type types2[] + static const enum minimal_symbol_type types2[] = {mst_bss, mst_file_text, mst_abs, mst_unknown}; - static enum minimal_symbol_type types3[] + static const enum minimal_symbol_type types3[] = {mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown}; - static enum minimal_symbol_type types4[] + static const enum minimal_symbol_type types4[] = {mst_file_bss, mst_text, mst_abs, mst_unknown}; enum minimal_symbol_type ourtype; enum minimal_symbol_type ourtype2; @@ -3293,7 +3293,8 @@ print_msymbol_info (struct minimal_symbo static void symtab_symbol_info (char *regexp, domain_enum kind, int from_tty) { - static char *classnames[] = {"variable", "function", "type", "method"}; + static const char * const classnames[] = + {"variable", "function", "type", "method"}; struct symbol_search *symbols; struct symbol_search *p; struct cleanup *old_chain;