From patchwork Thu Jun 10 11:18:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 43816 X-Patchwork-Delegate: dj@redhat.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0AF239A0032 for ; Thu, 10 Jun 2021 11:21:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0AF239A0032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623324090; bh=S4pDNK4NlswQpQZplvg0mnstRqMmgV8eJ1oSZQ308nM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=gAQB2y1XwJO/JBFDzaK8uGXnFKqGk+WMXVN451IrlYG1THmbtjeuU6ZPT+WW7Cy/4 yJv2q/NMkOZVJG917E1/Bc3C6oaZndQyCki3+Rit8ozuuJEti5cLzQNlrmN3lJTWno 5VZDMnqPhX/PDGFA+WY7xKEMUis+awDDDh9KBkcA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bumble.maple.relay.mailchannels.net (bumble.maple.relay.mailchannels.net [23.83.214.25]) by sourceware.org (Postfix) with ESMTPS id BEA7B39A505D for ; Thu, 10 Jun 2021 11:19:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEA7B39A505D X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3E3B63421BC; Thu, 10 Jun 2021 11:19:48 +0000 (UTC) Received: from pdx1-sub0-mail-a13.g.dreamhost.com (100-96-16-76.trex.outbound.svc.cluster.local [100.96.16.76]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 680023421FA; Thu, 10 Jun 2021 11:19:47 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a13.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.16.76 (trex/6.3.1); Thu, 10 Jun 2021 11:19:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Unite-Attack: 62a6d13427ca0465_1623323988060_2353029261 X-MC-Loop-Signature: 1623323988060:1197891452 X-MC-Ingress-Time: 1623323988060 Received: from pdx1-sub0-mail-a13.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a13.g.dreamhost.com (Postfix) with ESMTP id 18250800C5; Thu, 10 Jun 2021 11:19:47 +0000 (UTC) Received: from rhbox.intra.reserved-bit.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a13.g.dreamhost.com (Postfix) with ESMTPSA id 907757FF19; Thu, 10 Jun 2021 11:19:42 +0000 (UTC) X-DH-BACKEND: pdx1-sub0-mail-a13 To: libc-alpha@sourceware.org Subject: [PATCH 2/6] gconv_conf: Remove unused variables Date: Thu, 10 Jun 2021 16:48:49 +0530 Message-Id: <20210610111853.2286873-3-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610111853.2286873-1-siddhesh@sourceware.org> References: <20210610111853.2286873-1-siddhesh@sourceware.org> MIME-Version: 1.0 X-Spam-Status: No, score=-3494.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Siddhesh Poyarekar via Libc-alpha From: Siddhesh Poyarekar Reply-To: Siddhesh Poyarekar Cc: schwab@linux-m68k.org Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The modules and nmodules parameters passed to add_modules, add_alias, etc. are not used and are hence unnecessary. Remove them so that their signatures match the functions in iconvconfig. Reviewed-by: DJ Delorie --- iconv/gconv_conf.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index 3f2cef255b..6c6625c37a 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -132,7 +132,7 @@ detect_conflict (const char *alias) /* The actual code to add aliases. */ static void -add_alias2 (const char *from, const char *to, const char *wp, void *modules) +add_alias2 (const char *from, const char *to, const char *wp) { /* Test whether this alias conflicts with any available module. */ if (detect_conflict (from)) @@ -161,7 +161,7 @@ add_alias2 (const char *from, const char *to, const char *wp, void *modules) /* Add new alias. */ static void -add_alias (char *rp, void *modules) +add_alias (char *rp) { /* We now expect two more string. The strings are normalized (converted to UPPER case) and strored in the alias database. */ @@ -186,7 +186,7 @@ add_alias (char *rp, void *modules) return; *wp++ = '\0'; - add_alias2 (from, to, wp, modules); + add_alias2 (from, to, wp); } @@ -250,8 +250,7 @@ insert_module (struct gconv_module *newp, int tobefreed) /* Add new module. */ static void -add_module (char *rp, const char *directory, size_t dir_len, void **modules, - size_t *nmodules, int modcounter) +add_module (char *rp, const char *directory, size_t dir_len, int modcounter) { /* We expect now 1. `from' name @@ -364,8 +363,7 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules, /* Read the next configuration file. */ static void -read_conf_file (const char *filename, const char *directory, size_t dir_len, - void **modules, size_t *nmodules) +read_conf_file (const char *filename, const char *directory, size_t dir_len) { /* Note the file is opened with cancellation in the I/O functions disabled. */ @@ -415,10 +413,10 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len, if (rp - word == sizeof ("alias") - 1 && memcmp (word, "alias", sizeof ("alias") - 1) == 0) - add_alias (rp, *modules); + add_alias (rp); else if (rp - word == sizeof ("module") - 1 && memcmp (word, "module", sizeof ("module") - 1) == 0) - add_module (rp, directory, dir_len, modules, nmodules, modcounter++); + add_module (rp, directory, dir_len, modcounter++); /* else */ /* Otherwise ignore the line. */ } @@ -540,8 +538,6 @@ __gconv_get_path (void) static void __gconv_read_conf (void) { - void *modules = NULL; - size_t nmodules = 0; int save_errno = errno; size_t cnt; @@ -572,7 +568,7 @@ __gconv_read_conf (void) gconv_conf_filename, sizeof (gconv_conf_filename)); /* Read the gconv-modules configuration file first. */ - read_conf_file (buf, elem, elem_len, &modules, &nmodules); + read_conf_file (buf, elem, elem_len); /* Next, see if there is a gconv-modules.d directory containing configuration files and if it is non-empty. */ @@ -599,7 +595,7 @@ __gconv_read_conf (void) char *conf; if (__asprintf (&conf, "%s/%s", buf, ent->d_name) < 0) continue; - read_conf_file (conf, elem, elem_len, &modules, &nmodules); + read_conf_file (conf, elem, elem_len); free (conf); } } @@ -633,7 +629,7 @@ __gconv_read_conf (void) const char *to = __rawmemchr (from, '\0') + 1; cp = __rawmemchr (to, '\0') + 1; - add_alias2 (from, to, cp, modules); + add_alias2 (from, to, cp); } while (*cp != '\0');