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
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
* 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
@@ -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;
}
@@ -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)
@@ -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;
}
@@ -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)
@@ -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);