public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] stdio-common: Simplify printf_unknown interface in vfprintf-internal.c
Date: Tue, 24 May 2022 06:51:26 +0000 (GMT)	[thread overview]
Message-ID: <20220524065126.39259385625F@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fe8ca369ad2eb8a4a5d572c6c48f38dd99ff3c01

commit fe8ca369ad2eb8a4a5d572c6c48f38dd99ff3c01
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue May 24 08:03:11 2022 +0200

    stdio-common: Simplify printf_unknown interface in vfprintf-internal.c
    
    The called function does not use the args array, so there is no need
    to produce it.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 stdio-common/vfprintf-internal.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/stdio-common/vfprintf-internal.c b/stdio-common/vfprintf-internal.c
index f8aa2fdafb..fb94961f37 100644
--- a/stdio-common/vfprintf-internal.c
+++ b/stdio-common/vfprintf-internal.c
@@ -672,8 +672,7 @@ static int printf_positional (FILE *s,
 			      unsigned int mode_flags);
 
 /* Handle unknown format specifier.  */
-static int printf_unknown (FILE *, const struct printf_info *,
-			   const void *const *) __THROW;
+static int printf_unknown (FILE *, const struct printf_info *) __THROW;
 
 /* Group digits of number string.  */
 static CHAR_T *group_number (CHAR_T *, CHAR_T *, CHAR_T *, const char *,
@@ -1465,19 +1464,7 @@ printf_positional (FILE *s, const CHAR_T *format, int readonly_format,
 
 	  LABEL (form_unknown):
 	  {
-	    unsigned int i;
-	    const void **ptr;
-
-	    ptr = alloca (specs[nspecs_done].ndata_args
-			  * sizeof (const void *));
-
-	    /* Fill in an array of pointers to the argument values.  */
-	    for (i = 0; i < specs[nspecs_done].ndata_args; ++i)
-	      ptr[i] = &args_value[specs[nspecs_done].data_arg + i];
-
-	    /* Call the function.  */
-	    function_done = printf_unknown (s, &specs[nspecs_done].info,
-					    ptr);
+	    int function_done = printf_unknown (s, &specs[nspecs_done].info);
 
 	    /* If an error occurred we don't have information about #
 	       of chars.  */
@@ -1507,9 +1494,7 @@ printf_positional (FILE *s, const CHAR_T *format, int readonly_format,
 /* Handle an unknown format specifier.  This prints out a canonicalized
    representation of the format spec itself.  */
 static int
-printf_unknown (FILE *s, const struct printf_info *info,
-		const void *const *args)
-
+printf_unknown (FILE *s, const struct printf_info *info)
 {
   int done = 0;
   CHAR_T work_buffer[MAX (sizeof (info->width), sizeof (info->prec)) * 3];


                 reply	other threads:[~2022-05-24  6:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220524065126.39259385625F@sourceware.org \
    --to=fw@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).