Skip to content

Commit

Permalink
Break more lines before not after operators.
Browse files Browse the repository at this point in the history
This patch makes further coding style fixes where code was breaking
lines after an operator, contrary to the GNU Coding Standards.  As
with the previous patch, it is limited to files following a reasonable
approximation to GNU style already, and is not exhaustive; more such
issues remain to be fixed.

Tested for x86_64, and with build-many-glibcs.py.

	* dirent/dirent.h [!_DIRENT_HAVE_D_NAMLEN
	&& _DIRENT_HAVE_D_RECLEN] (_D_ALLOC_NAMLEN): Break lines before
	rather than after operators.
	* elf/cache.c (print_cache): Likewise.
	* gshadow/fgetsgent_r.c (__fgetsgent_r): Likewise.
	* htl/pt-getattr.c (__pthread_getattr_np): Likewise.
	* hurd/hurdinit.c (_hurd_setproc): Likewise.
	* hurd/hurdkill.c (_hurd_sig_post): Likewise.
	* hurd/hurdlookup.c (__file_name_lookup_under): Likewise.
	* hurd/hurdsig.c (_hurd_internal_post_signal): Likewise.
	(reauth_proc): Likewise.
	* hurd/lookup-at.c (__file_name_lookup_at): Likewise.
	(__file_name_split_at): Likewise.
	(__directory_name_split_at): Likewise.
	* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise.
	* hurd/port2fd.c (_hurd_port2fd): Likewise.
	* iconv/gconv_dl.c (do_print): Likewise.
	* inet/netinet/in.h (struct sockaddr_in): Likewise.
	* libio/wstrops.c (_IO_wstr_seekoff): Likewise.
	* locale/setlocale.c (new_composite_name): Likewise.
	* malloc/memusagestat.c (main): Likewise.
	* misc/fstab.c (fstab_convert): Likewise.
	* nptl/pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
	Likewise.
	* nss/nss_compat/compat-grp.c (getgrent_next_nss): Likewise.
	(getgrent_next_file): Likewise.
	(internal_getgrnam_r): Likewise.
	(internal_getgrgid_r): Likewise.
	* nss/nss_compat/compat-initgroups.c (getgrent_next_nss):
	Likewise.
	(internal_getgrent_r): Likewise.
	* nss/nss_compat/compat-pwd.c (getpwent_next_nss_netgr): Likewise.
	(getpwent_next_nss): Likewise.
	(getpwent_next_file): Likewise.
	(internal_getpwnam_r): Likewise.
	(internal_getpwuid_r): Likewise.
	* nss/nss_compat/compat-spwd.c (getspent_next_nss_netgr):
	Likewise.
	(getspent_next_nss): Likewise.
	(internal_getspnam_r): Likewise.
	* pwd/fgetpwent_r.c (__fgetpwent_r): Likewise.
	* shadow/fgetspent_r.c (__fgetspent_r): Likewise.
	* string/strchr.c (STRCHR): Likewise.
	* string/strchrnul.c (STRCHRNUL): Likewise.
	* sysdeps/aarch64/fpu/fpu_control.h (_FPU_FPCR_IEEE): Likewise.
	* sysdeps/aarch64/sfp-machine.h (_FP_CHOOSENAN): Likewise.
	* sysdeps/csky/dl-machine.h (elf_machine_rela): Likewise.
	* sysdeps/generic/memcopy.h (PAGE_COPY_FWD_MAYBE): Likewise.
	* sysdeps/generic/symbol-hacks.h (__stack_chk_fail_local):
	Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h (ICMP_INFOTYPE): Likewise.
	* sysdeps/gnu/updwtmp.c (TRANSFORM_UTMP_FILE_NAME): Likewise.
	* sysdeps/gnu/utmp_file.c (TRANSFORM_UTMP_FILE_NAME): Likewise.
	* sysdeps/hppa/jmpbuf-unwind.h (_JMPBUF_UNWINDS): Likewise.
	* sysdeps/mach/hurd/bits/stat.h (S_ISPARE): Likewise.
	* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Likewise.
	(open_file): Likewise.
	* sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
	(pthread_mutexattr_setprotocol): Likewise.
	* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.
	* sysdeps/mach/hurd/mmap.c (__mmap): Likewise.
	* sysdeps/mach/hurd/ptrace.c (ptrace): Likewise.
	* sysdeps/mach/hurd/spawni.c (__spawni): Likewise.
	* sysdeps/microblaze/dl-machine.h (elf_machine_type_class):
	Likewise.
	(elf_machine_rela): Likewise.
	* sysdeps/mips/mips32/sfp-machine.h (_FP_CHOOSENAN): Likewise.
	* sysdeps/mips/mips64/sfp-machine.h (_FP_CHOOSENAN): Likewise.
	* sysdeps/mips/sys/asm.h (multiple #if conditionals): Likewise.
	* sysdeps/posix/rename.c (rename): Likewise.
	* sysdeps/powerpc/novmx-sigjmp.c (__novmx__sigjmp_save): Likewise.
	* sysdeps/powerpc/sigjmp.c (__vmx__sigjmp_save): Likewise.
	* sysdeps/s390/fpu/fenv_libc.h (FPC_VALID_MASK): Likewise.
	* sysdeps/s390/utf8-utf16-z9.c (gconv_end): Likewise.
	* sysdeps/unix/grantpt.c (grantpt): Likewise.
	* sysdeps/unix/sysv/linux/a.out.h (N_TXTOFF): Likewise.
	* sysdeps/unix/sysv/linux/updwtmp.c (TRANSFORM_UTMP_FILE_NAME):
	Likewise.
	* sysdeps/unix/sysv/linux/utmp_file.c (TRANSFORM_UTMP_FILE_NAME):
	Likewise.
	* sysdeps/x86/cpu-features.c (get_common_indices): Likewise.
	* time/tzfile.c (__tzfile_compute): Likewise.
  • Loading branch information
jsm28 committed Feb 25, 2019
1 parent 34a5a14 commit a04549c
Show file tree
Hide file tree
Showing 58 changed files with 323 additions and 223 deletions.
85 changes: 85 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
2019-02-25 Joseph Myers <[email protected]>

* dirent/dirent.h [!_DIRENT_HAVE_D_NAMLEN
&& _DIRENT_HAVE_D_RECLEN] (_D_ALLOC_NAMLEN): Break lines before
rather than after operators.
* elf/cache.c (print_cache): Likewise.
* gshadow/fgetsgent_r.c (__fgetsgent_r): Likewise.
* htl/pt-getattr.c (__pthread_getattr_np): Likewise.
* hurd/hurdinit.c (_hurd_setproc): Likewise.
* hurd/hurdkill.c (_hurd_sig_post): Likewise.
* hurd/hurdlookup.c (__file_name_lookup_under): Likewise.
* hurd/hurdsig.c (_hurd_internal_post_signal): Likewise.
(reauth_proc): Likewise.
* hurd/lookup-at.c (__file_name_lookup_at): Likewise.
(__file_name_split_at): Likewise.
(__directory_name_split_at): Likewise.
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise.
* hurd/port2fd.c (_hurd_port2fd): Likewise.
* iconv/gconv_dl.c (do_print): Likewise.
* inet/netinet/in.h (struct sockaddr_in): Likewise.
* libio/wstrops.c (_IO_wstr_seekoff): Likewise.
* locale/setlocale.c (new_composite_name): Likewise.
* malloc/memusagestat.c (main): Likewise.
* misc/fstab.c (fstab_convert): Likewise.
* nptl/pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
Likewise.
* nss/nss_compat/compat-grp.c (getgrent_next_nss): Likewise.
(getgrent_next_file): Likewise.
(internal_getgrnam_r): Likewise.
(internal_getgrgid_r): Likewise.
* nss/nss_compat/compat-initgroups.c (getgrent_next_nss):
Likewise.
(internal_getgrent_r): Likewise.
* nss/nss_compat/compat-pwd.c (getpwent_next_nss_netgr): Likewise.
(getpwent_next_nss): Likewise.
(getpwent_next_file): Likewise.
(internal_getpwnam_r): Likewise.
(internal_getpwuid_r): Likewise.
* nss/nss_compat/compat-spwd.c (getspent_next_nss_netgr):
Likewise.
(getspent_next_nss): Likewise.
(internal_getspnam_r): Likewise.
* pwd/fgetpwent_r.c (__fgetpwent_r): Likewise.
* shadow/fgetspent_r.c (__fgetspent_r): Likewise.
* string/strchr.c (STRCHR): Likewise.
* string/strchrnul.c (STRCHRNUL): Likewise.
* sysdeps/aarch64/fpu/fpu_control.h (_FPU_FPCR_IEEE): Likewise.
* sysdeps/aarch64/sfp-machine.h (_FP_CHOOSENAN): Likewise.
* sysdeps/csky/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/generic/memcopy.h (PAGE_COPY_FWD_MAYBE): Likewise.
* sysdeps/generic/symbol-hacks.h (__stack_chk_fail_local):
Likewise.
* sysdeps/gnu/netinet/ip_icmp.h (ICMP_INFOTYPE): Likewise.
* sysdeps/gnu/updwtmp.c (TRANSFORM_UTMP_FILE_NAME): Likewise.
* sysdeps/gnu/utmp_file.c (TRANSFORM_UTMP_FILE_NAME): Likewise.
* sysdeps/hppa/jmpbuf-unwind.h (_JMPBUF_UNWINDS): Likewise.
* sysdeps/mach/hurd/bits/stat.h (S_ISPARE): Likewise.
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Likewise.
(open_file): Likewise.
* sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
(pthread_mutexattr_setprotocol): Likewise.
* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.
* sysdeps/mach/hurd/mmap.c (__mmap): Likewise.
* sysdeps/mach/hurd/ptrace.c (ptrace): Likewise.
* sysdeps/mach/hurd/spawni.c (__spawni): Likewise.
* sysdeps/microblaze/dl-machine.h (elf_machine_type_class):
Likewise.
(elf_machine_rela): Likewise.
* sysdeps/mips/mips32/sfp-machine.h (_FP_CHOOSENAN): Likewise.
* sysdeps/mips/mips64/sfp-machine.h (_FP_CHOOSENAN): Likewise.
* sysdeps/mips/sys/asm.h (multiple #if conditionals): Likewise.
* sysdeps/posix/rename.c (rename): Likewise.
* sysdeps/powerpc/novmx-sigjmp.c (__novmx__sigjmp_save): Likewise.
* sysdeps/powerpc/sigjmp.c (__vmx__sigjmp_save): Likewise.
* sysdeps/s390/fpu/fenv_libc.h (FPC_VALID_MASK): Likewise.
* sysdeps/s390/utf8-utf16-z9.c (gconv_end): Likewise.
* sysdeps/unix/grantpt.c (grantpt): Likewise.
* sysdeps/unix/sysv/linux/a.out.h (N_TXTOFF): Likewise.
* sysdeps/unix/sysv/linux/updwtmp.c (TRANSFORM_UTMP_FILE_NAME):
Likewise.
* sysdeps/unix/sysv/linux/utmp_file.c (TRANSFORM_UTMP_FILE_NAME):
Likewise.
* sysdeps/x86/cpu-features.c (get_common_indices): Likewise.
* time/tzfile.c (__tzfile_compute): Likewise.

2019-02-22 Joseph Myers <[email protected]>

* benchtests/bench-memmem.c (simple_memmem): Break lines before
Expand Down
4 changes: 2 additions & 2 deletions dirent/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ typedef __ino64_t ino64_t;
# ifdef _DIRENT_HAVE_D_RECLEN
# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
# else
# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
_D_EXACT_NAMLEN (d) + 1)
# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name \
: _D_EXACT_NAMLEN (d) + 1)
# endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions elf/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ print_cache (const char *cache_name)
cache_data = (const char *) &cache->libs[cache->nlibs];

/* Check for a new cache embedded in the old format. */
if (cache_size >
(offset + sizeof (struct cache_file_new)))
if (cache_size
> (offset + sizeof (struct cache_file_new)))
{

cache_new = (struct cache_file_new *) ((void *)cache + offset);
Expand Down
6 changes: 3 additions & 3 deletions gshadow/fgetsgent_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,
/* Skip leading blanks. */
while (isspace (*p))
++p;
} while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
} while (*p == '\0' || *p == '#' /* Ignore empty and comment lines. */
/* Parse the line. If it is invalid, loop to
get the next line of the file to parse. */
! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,
&errno));
|| ! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,
&errno));

_IO_funlockfile (stream);

Expand Down
6 changes: 3 additions & 3 deletions htl/pt-getattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ __pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
are not supported yet, so fill them with our default values. */
*attr = __pthread_default_attr;

attr->__stackaddr = pthread->stackaddr +
((pthread->guardsize + __vm_page_size - 1)
/ __vm_page_size * __vm_page_size);
attr->__stackaddr = (pthread->stackaddr
+ ((pthread->guardsize + __vm_page_size - 1)
/ __vm_page_size * __vm_page_size));
attr->__stacksize = pthread->stacksize;
attr->__guardsize = pthread->guardsize;
attr->__detachstate = (pthread->state == PTHREAD_DETACHED
Expand Down
8 changes: 4 additions & 4 deletions hurd/hurdinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ _hurd_setproc (process_t procserver)

/* Tell the proc server where our args and environment are. */
if (err = __proc_set_arg_locations (procserver,
_hide_arguments ? 0 :
(vm_address_t) __libc_argv,
_hide_environment ? 0 :
(vm_address_t) __environ))
_hide_arguments ? 0
: (vm_address_t) __libc_argv,
_hide_environment ? 0
: (vm_address_t) __environ))
return err;

/* Those calls worked, so the port looks good. */
Expand Down
4 changes: 2 additions & 2 deletions hurd/hurdkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ _hurd_sig_post (pid_t pid, int sig, mach_port_t arg_refport)
err = HURD_MSGPORT_RPC (__proc_getmsgport (proc, pid, &msgport),
(refport = arg_refport, 0), 0,
/* If no message port we cannot send signals. */
msgport == MACH_PORT_NULL ? EPERM :
__msg_sig_post (msgport, sig, 0, refport));
msgport == MACH_PORT_NULL ? EPERM
: __msg_sig_post (msgport, sig, 0, refport));
if (! err)
delivered = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions hurd/hurdlookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ __file_name_lookup_under (file_t startdir,

error_t use_init_port (int which, error_t (*operate) (mach_port_t))
{
return (which == INIT_PORT_CWDIR ? (*operate) (startdir) :
_hurd_ports_use (which, operate));
return (which == INIT_PORT_CWDIR ? (*operate) (startdir)
: _hurd_ports_use (which, operate));
}

err = __hurd_file_name_lookup (&use_init_port, &__getdport, 0,
Expand Down
24 changes: 12 additions & 12 deletions hurd/hurdsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
assert_perror (err);
for (i = 0; i < nthreads; ++i)
{
if (threads[i] != _hurd_msgport_thread &&
(act != handle || threads[i] != ss->thread))
if (threads[i] != _hurd_msgport_thread
&& (act != handle || threads[i] != ss->thread))
{
err = __thread_resume (threads[i]);
assert_perror (err);
Expand Down Expand Up @@ -715,9 +715,9 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
}
}

if (_hurd_orphaned && act == stop &&
(__sigmask (signo) & (__sigmask (SIGTTIN) | __sigmask (SIGTTOU) |
__sigmask (SIGTSTP))))
if (_hurd_orphaned && act == stop
&& (__sigmask (signo) & (__sigmask (SIGTTIN) | __sigmask (SIGTTOU)
| __sigmask (SIGTSTP))))
{
/* If we would ordinarily stop for a job control signal, but we are
orphaned so noone would ever notice and continue us again, we just
Expand All @@ -728,9 +728,9 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
}

/* Handle receipt of a blocked signal, or any signal while stopped. */
if (act != ignore && /* Signals ignored now are forgotten now. */
__sigismember (&ss->blocked, signo) ||
(signo != SIGKILL && _hurd_stopped))
if (act != ignore /* Signals ignored now are forgotten now. */
&& __sigismember (&ss->blocked, signo)
|| (signo != SIGKILL && _hurd_stopped))
{
mark_pending ();
act = ignore;
Expand Down Expand Up @@ -1368,10 +1368,10 @@ reauth_proc (mach_port_t new)
ref = __mach_reply_port ();
if (! HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
__proc_reauthenticate (port, ref,
MACH_MSG_TYPE_MAKE_SEND) ||
__auth_user_authenticate (new, ref,
MACH_MSG_TYPE_MAKE_SEND,
&ignore))
MACH_MSG_TYPE_MAKE_SEND)
|| __auth_user_authenticate (new, ref,
MACH_MSG_TYPE_MAKE_SEND,
&ignore))
&& ignore != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), ignore);
__mach_port_destroy (__mach_task_self (), ref);
Expand Down
12 changes: 6 additions & 6 deletions hurd/lookup-at.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ __file_name_lookup_at (int fd, int at_flags,
file_t startdir;
error_t use_init_port (int which, error_t (*operate) (mach_port_t))
{
return (which == INIT_PORT_CWDIR ? (*operate) (startdir) :
_hurd_ports_use (which, operate));
return (which == INIT_PORT_CWDIR ? (*operate) (startdir)
: _hurd_ports_use (which, operate));
}

err = HURD_DPORT_USE (fd, (startdir = port,
Expand Down Expand Up @@ -89,8 +89,8 @@ __file_name_split_at (int fd, const char *file_name, char **name)
file_t startdir;
error_t use_init_port (int which, error_t (*operate) (mach_port_t))
{
return (which == INIT_PORT_CWDIR ? (*operate) (startdir) :
_hurd_ports_use (which, operate));
return (which == INIT_PORT_CWDIR ? (*operate) (startdir)
: _hurd_ports_use (which, operate));
}

err = HURD_DPORT_USE (fd, (startdir = port,
Expand All @@ -114,8 +114,8 @@ __directory_name_split_at (int fd, const char *directory_name, char **name)
file_t startdir;
error_t use_init_port (int which, error_t (*operate) (mach_port_t))
{
return (which == INIT_PORT_CWDIR ? (*operate) (startdir) :
_hurd_ports_use (which, operate));
return (which == INIT_PORT_CWDIR ? (*operate) (startdir)
: _hurd_ports_use (which, operate));
}

err = HURD_DPORT_USE (fd, (startdir = port,
Expand Down
8 changes: 4 additions & 4 deletions hurd/lookup-retry.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
int save = errno;
errno = 0;
fd = (int) __strtoul_internal (&retryname[3], &end, 10, 0);
if (end == NULL || errno || /* Malformed number. */
if (end == NULL || errno /* Malformed number. */
/* Check for excess text after the number. A slash
is valid; it ends the component. Anything else
does not name a numeric file descriptor. */
(*end != '/' && *end != '\0'))
|| (*end != '/' && *end != '\0'))
{
errno = save;
err = ENOENT;
Expand Down Expand Up @@ -327,8 +327,8 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
break;

case 'p':
if (retryname[1] == 'i' && retryname[2] == 'd' &&
(retryname[3] == '/' || retryname[3] == 0))
if (retryname[1] == 'i' && retryname[2] == 'd'
&& (retryname[3] == '/' || retryname[3] == 0))
{
char *p, buf[1024]; /* XXX */
size_t len;
Expand Down
5 changes: 3 additions & 2 deletions hurd/port2fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ _hurd_port2fd (struct hurd_fd *d, io_t dport, int flags)
if (!(flags & O_IGNORE_CTTY))
__USEPORT (CTTYID,
({
if (port != MACH_PORT_NULL && /* Do we have a ctty? */
! __term_getctty (dport, &cttyid)) /* Could this be it? */
if (port != MACH_PORT_NULL /* Do we have a ctty? */
&& ! __term_getctty (dport, &cttyid))
/* Could this be it? */
{
__mach_port_deallocate (__mach_task_self (), cttyid);
/* This port is capable of being a controlling tty.
Expand Down
6 changes: 3 additions & 3 deletions iconv/gconv_dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ do_print (const void *nodep, VISIT value, int level)
struct __gconv_loaded_object *obj = *(struct __gconv_loaded_object **) nodep;

printf ("%10s: \"%s\", %d\n",
value == leaf ? "leaf" :
value == preorder ? "preorder" :
value == postorder ? "postorder" : "endorder",
value == leaf ? "leaf"
: value == preorder ? "preorder"
: value == postorder ? "postorder" : "endorder",
obj->name, obj->counter);
}

Expand Down
8 changes: 4 additions & 4 deletions inet/netinet/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ struct sockaddr_in
struct in_addr sin_addr; /* Internet address. */

/* Pad to size of `struct sockaddr'. */
unsigned char sin_zero[sizeof (struct sockaddr) -
__SOCKADDR_COMMON_SIZE -
sizeof (in_port_t) -
sizeof (struct in_addr)];
unsigned char sin_zero[sizeof (struct sockaddr)
- __SOCKADDR_COMMON_SIZE
- sizeof (in_port_t)
- sizeof (struct in_addr)];
};

#if !__USE_KERNEL_IPV6_DEFS
Expand Down
4 changes: 2 additions & 2 deletions libio/wstrops.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ _IO_wstr_seekoff (FILE *fp, off64_t offset, int dir, int mode)
if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);

bool was_writing = (fp->_wide_data->_IO_write_ptr >
fp->_wide_data->_IO_write_base
bool was_writing = ((fp->_wide_data->_IO_write_ptr
> fp->_wide_data->_IO_write_base)
|| _IO_in_put_mode (fp));
if (was_writing)
_IO_wstr_switch_to_get_mode (fp);
Expand Down
12 changes: 6 additions & 6 deletions locale/setlocale.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ new_composite_name (int category, const char *newnames[__LC_LAST])
for (i = 0; i < __LC_LAST; ++i)
if (i != LC_ALL)
{
const char *name = (category == LC_ALL ? newnames[i] :
category == i ? newnames[0] :
_nl_global_locale.__names[i]);
const char *name = (category == LC_ALL ? newnames[i]
: category == i ? newnames[0]
: _nl_global_locale.__names[i]);
last_len = strlen (name);
cumlen += _nl_category_name_sizes[i] + 1 + last_len + 1;
if (same && name != newnames[0] && strcmp (name, newnames[0]) != 0)
Expand All @@ -177,9 +177,9 @@ new_composite_name (int category, const char *newnames[__LC_LAST])
if (i != LC_ALL)
{
/* Add "CATEGORY=NAME;" to the string. */
const char *name = (category == LC_ALL ? newnames[i] :
category == i ? newnames[0] :
_nl_global_locale.__names[i]);
const char *name = (category == LC_ALL ? newnames[i]
: category == i ? newnames[0]
: _nl_global_locale.__names[i]);
p = __stpcpy (p, _nl_category_names.str + _nl_category_name_idxs[i]);
*p++ = '=';
p = __stpcpy (p, name);
Expand Down
4 changes: 2 additions & 2 deletions malloc/memusagestat.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ main (int argc, char *argv[])
if (cnt != cnt2)
gdImageDashedLine (im_out, 40, ysize - 20 - cnt2, xsize - 40,
ysize - 20 - cnt2, green);
snprintf (buf, sizeof (buf), stack_format, maxsize_stack / 4 * line /
stack_scale);
snprintf (buf, sizeof (buf), stack_format,
maxsize_stack / 4 * line / stack_scale);
gdImageString (im_out, gdFontSmall, xsize - 37, ysize - 26 - cnt2,
(unsigned char *) buf, green);
}
Expand Down
12 changes: 6 additions & 6 deletions misc/fstab.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ fstab_convert (struct fstab_state *state)
f->fs_file = m->mnt_dir;
f->fs_vfstype = m->mnt_type;
f->fs_mntops = m->mnt_opts;
f->fs_type = (__hasmntopt (m, FSTAB_RW) ? FSTAB_RW :
__hasmntopt (m, FSTAB_RQ) ? FSTAB_RQ :
__hasmntopt (m, FSTAB_RO) ? FSTAB_RO :
__hasmntopt (m, FSTAB_SW) ? FSTAB_SW :
__hasmntopt (m, FSTAB_XX) ? FSTAB_XX :
"??");
f->fs_type = (__hasmntopt (m, FSTAB_RW) ? FSTAB_RW
: __hasmntopt (m, FSTAB_RQ) ? FSTAB_RQ
: __hasmntopt (m, FSTAB_RO) ? FSTAB_RO
: __hasmntopt (m, FSTAB_SW) ? FSTAB_SW
: __hasmntopt (m, FSTAB_XX) ? FSTAB_XX
: "??");
f->fs_freq = m->mnt_freq;
f->fs_passno = m->mnt_passno;
return f;
Expand Down
Loading

0 comments on commit a04549c

Please sign in to comment.