From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A0CE5386EC15 for ; Thu, 17 Mar 2022 19:30:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0CE5386EC15 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-88-ycOix--iM7mub-ZNcbn_zg-1; Thu, 17 Mar 2022 15:30:16 -0400 X-MC-Unique: ycOix--iM7mub-ZNcbn_zg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B416899EC4 for ; Thu, 17 Mar 2022 19:30:16 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.88]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B61A2469A58 for ; Thu, 17 Mar 2022 19:30:15 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 11/26] stdio-common: Simplify printf_unknown interface in vfprintf-internal.c In-Reply-To: References: X-From-Line: aea6360287c5ea86d3c5b5d18155a89640cdf3d0 Mon Sep 17 00:00:00 2001 Message-Id: Date: Thu, 17 Mar 2022 20:30:13 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Thu, 17 Mar 2022 19:30:19 -0000 The called function does not use the args array, so there is no need to produce it. --- 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]; -- 2.35.1