From patchwork Sun Dec 16 17:21:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 10732561 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7002313AD for ; Sun, 16 Dec 2018 17:22:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E7C729985 for ; Sun, 16 Dec 2018 17:22:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52D1A29995; Sun, 16 Dec 2018 17:22:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB99229985 for ; Sun, 16 Dec 2018 17:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730773AbeLPRWK (ORCPT ); Sun, 16 Dec 2018 12:22:10 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36974 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730694AbeLPRWK (ORCPT ); Sun, 16 Dec 2018 12:22:10 -0500 Received: by mail-wm1-f67.google.com with SMTP id g67so10313988wmd.2 for ; Sun, 16 Dec 2018 09:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FG9o/lWsV4yGfdKR8dDoa04LKopAlyxISU7r7uX9blY=; b=ECTrUxA+rurcXRfXhDls0OhV3UNQSTMbI4uNzbuPnMNUGJDY5E2yK8leAcxwByjw4U ZNfVbuYjSPdXq52/Ayp6jdhHXnp3+RTPyHrSKQx02hjSRiRwGY7gBl0+juR5GA3fPZsF aVtkp/64BHebfufshxzUiG+AqpozZ1wxas+cdU6dWBIKiSlEtF3Hjksxf6Huai2bTtH5 uvJawg7lLxqJ7sELBt3D1iSLrnNW0DjGfnN9Q7EJx0wsc2QqeYoeVEOCuvRG+s38a2u0 GUiIlsIrzMlrnnKUaMoUda1EH/JtKbeqsVuew5AjnKgv+wGgKkw5ZmWGwfMKdGx/yxkM 9SlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FG9o/lWsV4yGfdKR8dDoa04LKopAlyxISU7r7uX9blY=; b=cx91+ibsz/bkHQa8LrQT0Lj93NoebF83AwD+HFi+b7Lio0Zbk2N1AAk6aId08Ru6V7 gGIerUL6Iq5wZlSlYFVKAoT/G9RKTCmqBR/+0wg8nvjMabDrK0ULnRGBhUZ/5OqXsBMs GRrTI7/sKS9oH80Ck/elreNzeDb196rILhBgLx5gARd3SCesbKvZxAtD7zqH0GrXIlWh y/714TRAI+VYlCLfTruhOjz72qNHgk3CnZvcI0NTPJa8ACihXP1LBMilFGn4+CJQ91+l RFklZrIYfFr54/Wi7FoDtM6eIYK6urkJ2dRilQRjli7iou08dValyOCLI8xi/3uGDLx5 ZhnA== X-Gm-Message-State: AA+aEWYcV8VkkgWnFRsx8/mQ3hjm8MCiNSVJSeECFuZ4hBb+RadVO7pI 6Sgzz378D0kRDRtFCoydx6b8pLdY X-Google-Smtp-Source: AFSGD/WG0nQtGks0B36jpAPweswcwjoRSAlpeZWIDlhjfGsQaqqa38Gs/92gz0M5V5bRGhRaXGcgNQ== X-Received: by 2002:a1c:b515:: with SMTP id e21mr9341401wmf.82.1544980922573; Sun, 16 Dec 2018 09:22:02 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4059:bc00:511d:a2f9:81d4:4b91]) by smtp.gmail.com with ESMTPSA id z17sm9064743wrv.2.2018.12.16.09.22.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Dec 2018 09:22:02 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 6/6] show-parse: use show_typename() instead of show_type() Date: Sun, 16 Dec 2018 18:21:51 +0100 Message-Id: <20181216172151.1361-7-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181216172151.1361-1-luc.vanoostenryck@gmail.com> References: <20181216172151.1361-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP show_type() is essentially a copy of show_typename() which also outputs its result to stdout. Replace its unique use by a call to show_typename() + printf() so this function name can be used later for a version which display only a type and not the associated identifier. Signed-off-by: Luc Van Oostenryck --- show-parse.c | 13 +------------ symbol.h | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/show-parse.c b/show-parse.c index 7bff8f95f..1fa936b50 100644 --- a/show-parse.c +++ b/show-parse.c @@ -406,17 +406,6 @@ out: name->end--; } -void show_type(struct symbol *sym) -{ - char array[200]; - struct type_name name; - - name.start = name.end = array+100; - do_show_type(sym, &name); - *name.end = 0; - printf("%s", name.start); -} - const char *show_typename(struct symbol *sym) { static char array[200]; @@ -438,7 +427,7 @@ void show_symbol(struct symbol *sym) if (sym->ctype.alignment) printf(".align %ld\n", sym->ctype.alignment); - show_type(sym); + printf("%s", show_typename(sym)); type = sym->ctype.base_type; if (!type) { printf("\n"); diff --git a/symbol.h b/symbol.h index 91e1ea730..77c91c171 100644 --- a/symbol.h +++ b/symbol.h @@ -306,7 +306,6 @@ extern void init_builtins(int stream); extern void declare_builtins(void); extern void init_ctype(void); extern struct symbol *alloc_symbol(struct position, int type); -extern void show_type(struct symbol *); extern const char *modifier_string(unsigned long mod); extern void show_symbol(struct symbol *); extern int show_symbol_expr_init(struct symbol *sym);