This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use one-dimension arrays in gen-posix-conf-vars.awk


On Wed, Dec 31, 2014 at 03:04:48PM +0100, Andreas Schwab wrote:
> Siddhesh Poyarekar <me@siddhesh.in> 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 <siddhesh@redhat.com>
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  <siddhesh@redhat.com>
+
+	* scripts/gen-posix-conf-vars.awk (END): Don't use sprintf.
+
 2014-12-31  Joseph Myers  <joseph@codesourcery.com>
 
 	[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]