diff mbox series

*put*s: indentation

Message ID 20210925194618.14189-1-cosiekvfj@o2.pl
State New
Headers show
Series *put*s: indentation | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Kacper Piwiński Sept. 25, 2021, 7:46 p.m. UTC
Make indentation consistent across *put*s functions
---
 libio/iofputs.c    | 2 ++
 libio/iofputs_u.c  | 5 ++++-
 libio/iofputws.c   | 2 ++
 libio/iofputws_u.c | 2 ++
 libio/ioputs.c     | 3 +--
 5 files changed, 11 insertions(+), 3 deletions(-)

Comments

Florian Weimer Sept. 27, 2021, 2:27 p.m. UTC | #1
* Kacper Piwiński via Libc-alpha:

> Make indentation consistent across *put*s functions
> ---
>  libio/iofputs.c    | 2 ++
>  libio/iofputs_u.c  | 5 ++++-
>  libio/iofputws.c   | 2 ++
>  libio/iofputws_u.c | 2 ++
>  libio/ioputs.c     | 3 +--
>  5 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/libio/iofputs.c b/libio/iofputs.c
> index a8721314bc..c865b01f61 100644
> --- a/libio/iofputs.c
> +++ b/libio/iofputs.c
> @@ -34,9 +34,11 @@ _IO_fputs (const char *str, FILE *fp)
>    int result = EOF;
>    CHECK_FILE (fp, EOF);
>    _IO_acquire_lock (fp);
> +
>    if ((_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
>        && _IO_sputn (fp, str, len) == len)
>      result = 1;
> +
>    _IO_release_lock (fp);
>    return result;
>  }

Thanks for submitting this patch.

libio needs a lot of cleanup, admittedly?  Is this part of some larger
series of cleanups?  If yes, it would help to see more of that series.

Florian
diff mbox series

Patch

diff --git a/libio/iofputs.c b/libio/iofputs.c
index a8721314bc..c865b01f61 100644
--- a/libio/iofputs.c
+++ b/libio/iofputs.c
@@ -34,9 +34,11 @@  _IO_fputs (const char *str, FILE *fp)
   int result = EOF;
   CHECK_FILE (fp, EOF);
   _IO_acquire_lock (fp);
+
   if ((_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
       && _IO_sputn (fp, str, len) == len)
     result = 1;
+
   _IO_release_lock (fp);
   return result;
 }
diff --git a/libio/iofputs_u.c b/libio/iofputs_u.c
index b9eb3b415f..9c3d81f7bc 100644
--- a/libio/iofputs_u.c
+++ b/libio/iofputs_u.c
@@ -34,8 +34,11 @@  __fputs_unlocked (const char *str, FILE *fp)
   size_t len = strlen (str);
   int result = EOF;
   CHECK_FILE (fp, EOF);
-  if (_IO_fwide (fp, -1) == -1 && _IO_sputn (fp, str, len) == len)
+
+  if (_IO_fwide (fp, -1) == -1
+      && _IO_sputn (fp, str, len) == len)
     result = 1;
+
   return result;
 }
 libc_hidden_def (__fputs_unlocked)
diff --git a/libio/iofputws.c b/libio/iofputws.c
index 614ac0e336..6f50f42fab 100644
--- a/libio/iofputws.c
+++ b/libio/iofputws.c
@@ -34,9 +34,11 @@  fputws (const wchar_t *str, FILE *fp)
   int result = EOF;
   CHECK_FILE (fp, EOF);
   _IO_acquire_lock (fp);
+
   if (_IO_fwide (fp, 1) == 1
       && _IO_sputn (fp, (char *) str, len) == len)
     result = 1;
+
   _IO_release_lock (fp);
   return result;
 }
diff --git a/libio/iofputws_u.c b/libio/iofputws_u.c
index 0b0cacd293..94aa4bf199 100644
--- a/libio/iofputws_u.c
+++ b/libio/iofputws_u.c
@@ -34,9 +34,11 @@  fputws_unlocked (const wchar_t *str, FILE *fp)
   size_t len = __wcslen (str);
   int result = EOF;
   CHECK_FILE (fp, EOF);
+
   if (_IO_fwide (fp, 1) == 1
       && _IO_sputn (fp, (char *) str, len) == len)
     result = 1;
+
   return result;
 }
 libc_hidden_def (fputws_unlocked)
diff --git a/libio/ioputs.c b/libio/ioputs.c
index 99a177876a..5969c0af30 100644
--- a/libio/ioputs.c
+++ b/libio/ioputs.c
@@ -35,8 +35,7 @@  _IO_puts (const char *str)
   size_t len = strlen (str);
   _IO_acquire_lock (stdout);
 
-  if ((_IO_vtable_offset (stdout) != 0
-       || _IO_fwide (stdout, -1) == -1)
+  if ((_IO_vtable_offset (stdout) != 0 || _IO_fwide (stdout, -1) == -1)
       && _IO_sputn (stdout, str, len) == len
       && _IO_putc_unlocked ('\n', stdout) != EOF)
     result = MIN (INT_MAX, len + 1);