From patchwork Mon Aug 5 18:58:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 33968 Received: (qmail 11279 invoked by alias); 5 Aug 2019 18:58:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11271 invoked by uid 89); 5 Aug 2019 18:58:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:google X-HELO: mail-qk1-f201.google.com Received: from mail-qk1-f201.google.com (HELO mail-qk1-f201.google.com) (209.85.222.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Aug 2019 18:58:37 +0000 Received: by mail-qk1-f201.google.com with SMTP id e18so73323890qkl.17 for ; Mon, 05 Aug 2019 11:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=PvNOeRHDhZ3CJQiVpjet4nMz7SRFDPNaaqy9mVDEDNc=; b=DS9SL7dMwlRDBrn2N3Bu3v4smV5iawKAOdDAUETx58uYZj+6tJzf10S62Yp7In0Ic8 WtKzH3VVDCGW1NEsPJGd375/SlUrk7I28La9K5T/R++AOl8GSSODnyFrdHgfbWXWkOXf L15NHmnxkKjrN/jbBzL0X2JAxQlHRQn5q6NDFRdc3KqyFgyDajqUZLXT0E36TQ/0ZiHY dpBow6GgT/Ydgld2PpERo8XHIKTK11y7uOE90tDkmSUMqdmdLzJzGNk9uWg2R/clUaF5 D+NhEo0CIW/Iwnbd1DQ1VfYiP5C+sd4gM4CuWgDkBESFPmDunHFWoOxfNrbl+OkR4fRE Vbbw== Date: Mon, 5 Aug 2019 13:58:33 -0500 Message-Id: <20190805185833.236434-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Replace int with enum block_enum where appropriate. X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger For better readability and type safety. gdb/ChangeLog: 2019-08-05 Christian Biesinger * symtab.c (symbol_cache_lookup): Change int to enum block_enum. (error_in_psymtab_expansion): Likewise. (lookup_symbol_via_quick_fns): Likewise. (basic_lookup_transparent_type_quick): Likewise. (basic_lookup_transparent_type_1): Likewise. --- gdb/symtab.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gdb/symtab.c b/gdb/symtab.c index 95008a5bd2..347e58ccf3 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1303,7 +1303,7 @@ set_symbol_cache_size_handler (const char *args, int from_tty, static struct block_symbol symbol_cache_lookup (struct symbol_cache *cache, - struct objfile *objfile_context, int block, + struct objfile *objfile_context, enum block_enum block, const char *name, domain_enum domain, struct block_symbol_cache **bsc_ptr, struct symbol_cache_slot **slot_ptr) @@ -2338,7 +2338,7 @@ lookup_symbol_in_objfile_from_linkage_name (struct objfile *objfile, in a psymtab but not in a symtab. */ static void ATTRIBUTE_NORETURN -error_in_psymtab_expansion (int block_index, const char *name, +error_in_psymtab_expansion (enum block_enum block_index, const char *name, struct compunit_symtab *cust) { error (_("\ @@ -2355,8 +2355,9 @@ Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n\ the "quick" symbol table functions. */ static struct block_symbol -lookup_symbol_via_quick_fns (struct objfile *objfile, int block_index, - const char *name, const domain_enum domain) +lookup_symbol_via_quick_fns (struct objfile *objfile, + enum block_enum block_index, const char *name, + const domain_enum domain) { struct compunit_symtab *cust; const struct blockvector *bv; @@ -2725,7 +2726,8 @@ lookup_transparent_type (const char *name) "quick" symbol table functions. */ static struct type * -basic_lookup_transparent_type_quick (struct objfile *objfile, int block_index, +basic_lookup_transparent_type_quick (struct objfile *objfile, + enum block_enum block_index, const char *name) { struct compunit_symtab *cust; @@ -2755,7 +2757,8 @@ basic_lookup_transparent_type_quick (struct objfile *objfile, int block_index, BLOCK_INDEX is either GLOBAL_BLOCK or STATIC_BLOCK. */ static struct type * -basic_lookup_transparent_type_1 (struct objfile *objfile, int block_index, +basic_lookup_transparent_type_1 (struct objfile *objfile, + enum block_enum block_index, const char *name) { const struct blockvector *bv;