From patchwork Fri Jan 2 05:48:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: siddhesh X-Patchwork-Id: 4478 Received: (qmail 19539 invoked by alias); 2 Jan 2015 05:52:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 19526 invoked by uid 89); 2 Jan 2015 05:52:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 X-HELO: homiemail-a44.g.dreamhost.com Date: Fri, 2 Jan 2015 11:18:11 +0530 From: Siddhesh Poyarekar To: Andreas Schwab Cc: libc-alpha@sourceware.org, Chris Metcalf Subject: Re: [PATCH] Use one-dimension arrays in gen-posix-conf-vars.awk Message-ID: <20150102054811.GA13457@Devel.siddhesh.in> References: <20141230095050.GA22064@Devel.siddhesh.in> <87d27156u6.fsf@igel.home> <20141231075359.GB14654@Devel.siddhesh.in> <87oaqjq5j3.fsf@igel.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87oaqjq5j3.fsf@igel.home> User-Agent: Mutt/1.5.23 (2014-03-12) On Wed, Dec 31, 2014 at 03:04:48PM +0100, Andreas Schwab wrote: > Siddhesh Poyarekar writes: > > > On Tue, Dec 30, 2014 at 07:29:53PM +0100, Andreas Schwab wrote: > >> c = prefix "_" $1 > > > > Thanks, pushed with that change. > > There are more occurences of the idiom. Fixed all of them now. Thanks, Siddhesh commit b217c15fc340bc29e7cab0a80626c65e48fcebd6 Author: Siddhesh Poyarekar Date: Fri Jan 2 11:16:35 2015 +0530 Remove uses of sprintf in gen-posix-conf-vars.awk Simply some code by replacing sprintf in the awk script. diff --git a/ChangeLog b/ChangeLog index fc7a34e..cf33185 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-01-02 Siddhesh Poyarekar + + * scripts/gen-posix-conf-vars.awk (END): Don't use sprintf. + 2014-12-31 Joseph Myers [BZ #17748] diff --git a/scripts/gen-posix-conf-vars.awk b/scripts/gen-posix-conf-vars.awk index 220d0e8..9a4c542 100644 --- a/scripts/gen-posix-conf-vars.awk +++ b/scripts/gen-posix-conf-vars.awk @@ -68,11 +68,8 @@ END { # Build a name -> sysconf number associative array to print a C array at # the end. - if (prefix_conf[c] == "SPEC") { - name = sprintf ("%s", c) - num = sprintf ("%s_%s", sc_prefixes[c], conf[c]) - spec[name] = num - } + if (prefix_conf[c] == "SPEC") + spec[c] = sc_prefixes[c] "_" conf[c] } # Print the specification array. Define the macro NEED_SPEC_ARRAY before