public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v2 05/14] stdio-common: Introduce buffers for implementing printf
Date: Thu, 2 Jun 2022 15:48:52 -0300	[thread overview]
Message-ID: <7152bc46-ec47-196b-4dfa-0e1aaf5ad033@linaro.org> (raw)
In-Reply-To: <a24674e2b8fe6363ebe76b11cebf975dca7ee2a8.1653314701.git.fweimer@redhat.com>



On 23/05/2022 11:07, Florian Weimer via Libc-alpha wrote:
> +
> +void
> +__printf_buffer_flush_to_file (struct __printf_buffer_to_file *buf)
> +{
> +  /* The bytes in the buffer are always consumed.  */
> +  buf->base.written += buf->base.write_ptr - buf->base.write_base;
> +
> +  if (buf->base.write_end == array_end (buf->stage))
> +    {
> +      /* If the stage buffer is used, make a copy into the file.  The
> +         stage buffer is always consumed fully, even if just partially
> +         written, to ensure that the file stream has all the data.  */
> +      size_t count = buf->base.write_ptr - buf->stage;
> +      if ((size_t) _IO_sputn (buf->fp, buf->stage, count) != count)
> +            {
> +              __printf_buffer_mark_failed (&buf->base);
> +              return;
> +            }

Indentation seems off here.

  parent reply	other threads:[~2022-06-02 18:48 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 14:06 [PATCH v2 00/14] vfprintf rework to remove vtables Florian Weimer
2022-05-23 14:07 ` [PATCH v2 01/14] stdio-common: Add printf specifier registry to <printf.h> Florian Weimer
2022-05-23 14:37   ` Andreas Schwab
2022-05-23 14:07 ` [PATCH v2 02/14] stdio-common: Move union printf_arg int <printf.h> Florian Weimer
2022-05-23 14:07 ` [PATCH v2 03/14] stdio-common: Simplify printf_unknown interface in vfprintf-internal.c Florian Weimer
2022-05-23 14:07 ` [PATCH v2 04/14] locale: Implement struct grouping_iterator Florian Weimer
2022-05-23 20:00   ` Adhemerval Zanella
2022-05-24 13:31   ` Andreas Schwab
2022-05-24 14:33     ` Florian Weimer
2022-05-23 14:07 ` [PATCH v2 05/14] stdio-common: Introduce buffers for implementing printf Florian Weimer
2022-06-02 17:16   ` Adhemerval Zanella
2022-06-02 17:58     ` Florian Weimer
2022-06-02 18:35       ` Adhemerval Zanella
2022-06-02 18:41         ` Florian Weimer
2022-06-02 18:55           ` Adhemerval Zanella
2022-06-02 19:12             ` Florian Weimer
2022-06-07 14:30       ` Florian Weimer
2022-06-07 16:55       ` Paul Eggert
2022-06-07 17:11         ` Florian Weimer
2022-06-07 17:41           ` Paul Eggert
2022-06-02 18:48   ` Adhemerval Zanella [this message]
2022-06-02 18:54     ` Florian Weimer
2022-06-07 16:57   ` Paul Eggert
2022-06-07 17:33     ` Florian Weimer
2022-05-23 14:07 ` [PATCH v2 06/14] stdio-common: Add __printf_function_invoke Florian Weimer
2022-06-03 13:51   ` Adhemerval Zanella
2022-05-23 14:07 ` [PATCH v2 07/14] stdio-common: Add __translated_number_width Florian Weimer
2022-05-23 14:07 ` [PATCH v2 08/14] stdio-common: Convert vfprintf and related functions to buffers Florian Weimer
2022-05-23 20:23   ` Joseph Myers
2022-05-23 20:48     ` Florian Weimer
2022-05-23 14:07 ` [PATCH v2 09/14] stdio-common: Add lock optimization to vfprintf and vfwprintf Florian Weimer
2022-05-23 14:07 ` [PATCH v2 10/14] libio: Convert __vsprintf_internal to buffers Florian Weimer
2022-05-23 14:07 ` [PATCH v2 11/14] libio: Convert __vasprintf_internal " Florian Weimer
2022-05-23 14:08 ` [PATCH v2 12/14] libio: Convert __vdprintf_internal " Florian Weimer
2022-05-23 14:08 ` [PATCH v2 13/14] libio: Convert __obstack_vprintf_internal to buffers (bug 27124) Florian Weimer
2022-05-23 14:08 ` [PATCH v2 14/14] libio: Convert __vswprintf_internal to buffers (bug 27857) Florian Weimer

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=7152bc46-ec47-196b-4dfa-0e1aaf5ad033@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@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).