mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Break some lines before not after operators.
The GNU Coding Standards specify that line breaks in expressions should go before an operator, not after one. This patch fixes various code to do this. It only changes code that appears to be mostly following GNU style anyway, not files and directories with substantially different formatting. It is not exhaustive even for files using GNU style (for example, changes to sysdeps files are deferred for subsequent cleanups). Some files changed are shared with gnulib, but most are specific to glibc. Changes were made manually, with places to change found by grep (so some cases, e.g. where the operator was followed by a comment at end of line, are particularly liable to have been missed by grep, but I did include cases where the operator was followed by backslash-newline). This patch generally does not attempt to address other coding style issues in the expressions changed (for example, missing spaces before '(', or lack of parentheses to ensure indentation of continuation lines properly reflects operator precedence). Tested for x86_64, and with build-many-glibcs.py. * benchtests/bench-memmem.c (simple_memmem): Break lines before rather than after operators. * benchtests/bench-skeleton.c (TIMESPEC_AFTER): Likewise. * crypt/md5.c (md5_finish_ctx): Likewise. * crypt/sha256.c (__sha256_finish_ctx): Likewise. * crypt/sha512.c (__sha512_finish_ctx): Likewise. * elf/cache.c (load_aux_cache): Likewise. * elf/dl-load.c (open_verify): Likewise. * elf/get-dynamic-info.h (elf_get_dynamic_info): Likewise. * elf/readelflib.c (process_elf_file): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/sprof.c (generate_call_graph): Likewise. * hurd/ctty-input.c (_hurd_ctty_input): Likewise. * hurd/ctty-output.c (_hurd_ctty_output): Likewise. * hurd/dtable.c (reauth_dtable): Likewise. * hurd/getdport.c (__getdport): Likewise. * hurd/hurd/signal.h (_hurd_interrupted_rpc_timeout): Likewise. * hurd/hurd/sigpreempt.h (HURD_PREEMPT_SIGNAL_P): Likewise. * hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Likewise. * hurd/hurdioctl.c (fioctl): Likewise. * hurd/hurdselect.c (_hurd_select): Likewise. * hurd/hurdsig.c (_hurdsig_abort_rpcs): Likewise. (STOPSIGS): Likewise. * hurd/hurdstartup.c (_hurd_startup): Likewise. * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Likewise. * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise. * hurd/msgportdemux.c (msgport_server): Likewise. * hurd/setauth.c (_hurd_setauth): Likewise. * include/features.h (__GLIBC_USE_DEPRECATED_SCANF): Likewise. * libio/libioP.h [IO_DEBUG] (CHECK_FILE): Likewise. * locale/programs/ld-ctype.c (set_class_defaults): Likewise. * localedata/tests-mbwc/tst_swscanf.c (tst_swscanf): Likewise. * login/tst-utmp.c (do_check): Likewise. (simulate_login): Likewise. * mach/lowlevellock.h (lll_lock): Likewise. (lll_trylock): Likewise. * math/test-fenv.c (ALL_EXC): Likewise. * math/test-fenvinline.c (ALL_EXC): Likewise. * misc/sys/cdefs.h (__attribute_deprecated_msg__): Likewise. * nis/nis_call.c (__do_niscall3): Likewise. * nis/nis_callback.c (cb_prog_1): Likewise. * nis/nis_defaults.c (searchaccess): Likewise. * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise. * nis/nis_ismember.c (internal_ismember): Likewise. * nis/nis_local_names.c (nis_local_principal): Likewise. * nis/nss_nis/nis-rpc.c (_nss_nis_getrpcbyname_r): Likewise. * nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_getnetgrent_r): Likewise. * nis/ypclnt.c (yp_match): Likewise. (yp_first): Likewise. (yp_next): Likewise. (yp_master): Likewise. (yp_order): Likewise. * nscd/hstcache.c (cache_addhst): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nss/nss_compat/compat-pwd.c (copy_pwd_changes): Likewise. (internal_getpwuid_r): Likewise. * nss/nss_compat/compat-spwd.c (copy_spwd_changes): Likewise. * posix/glob.h (__GLOB_FLAGS): Likewise. * posix/regcomp.c (peek_token): Likewise. (peek_token_bracket): Likewise. (parse_expression): Likewise. * posix/regexec.c (sift_states_iter_mb): Likewise. (check_node_accept_bytes): Likewise. * posix/tst-spawn3.c (do_test): Likewise. * posix/wordexp-test.c (testit): Likewise. * posix/wordexp.c (parse_tilde): Likewise. (exec_comm): Likewise. * posix/wordexp.h (__WRDE_FLAGS): Likewise. * resource/vtimes.c (TIMEVAL_TO_VTIMES): Likewise. * setjmp/sigjmp.c (__sigjmp_save): Likewise. * stdio-common/printf_fp.c (__printf_fp_l): Likewise. * stdio-common/tst-fileno.c (do_test): Likewise. * stdio-common/vfprintf-internal.c (vfprintf): Likewise. * stdlib/strfmon_l.c (__vstrfmon_l_internal): Likewise. * stdlib/strtod_l.c (round_and_return): Likewise. (____STRTOF_INTERNAL): Likewise. * stdlib/tst-strfrom.h (TEST_STRFROM): Likewise. * string/strcspn.c (STRCSPN): Likewise. * string/test-memmem.c (simple_memmem): Likewise. * termios/tcsetattr.c (tcsetattr): Likewise. * time/alt_digit.c (_nl_parse_alt_digit): Likewise. * time/asctime.c (asctime_internal): Likewise. * time/strptime_l.c (__strptime_internal): Likewise. * time/sys/time.h (timercmp): Likewise. * time/tzfile.c (__tzfile_compute): Likewise.
This commit is contained in:
parent
b0b50fe005
commit
34a5a1460e
90
ChangeLog
90
ChangeLog
@ -1,3 +1,93 @@
|
||||
2019-02-22 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* benchtests/bench-memmem.c (simple_memmem): Break lines before
|
||||
rather than after operators.
|
||||
* benchtests/bench-skeleton.c (TIMESPEC_AFTER): Likewise.
|
||||
* crypt/md5.c (md5_finish_ctx): Likewise.
|
||||
* crypt/sha256.c (__sha256_finish_ctx): Likewise.
|
||||
* crypt/sha512.c (__sha512_finish_ctx): Likewise.
|
||||
* elf/cache.c (load_aux_cache): Likewise.
|
||||
* elf/dl-load.c (open_verify): Likewise.
|
||||
* elf/get-dynamic-info.h (elf_get_dynamic_info): Likewise.
|
||||
* elf/readelflib.c (process_elf_file): Likewise.
|
||||
* elf/rtld.c (dl_main): Likewise.
|
||||
* elf/sprof.c (generate_call_graph): Likewise.
|
||||
* hurd/ctty-input.c (_hurd_ctty_input): Likewise.
|
||||
* hurd/ctty-output.c (_hurd_ctty_output): Likewise.
|
||||
* hurd/dtable.c (reauth_dtable): Likewise.
|
||||
* hurd/getdport.c (__getdport): Likewise.
|
||||
* hurd/hurd/signal.h (_hurd_interrupted_rpc_timeout): Likewise.
|
||||
* hurd/hurd/sigpreempt.h (HURD_PREEMPT_SIGNAL_P): Likewise.
|
||||
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise):
|
||||
Likewise.
|
||||
* hurd/hurdioctl.c (fioctl): Likewise.
|
||||
* hurd/hurdselect.c (_hurd_select): Likewise.
|
||||
* hurd/hurdsig.c (_hurdsig_abort_rpcs): Likewise.
|
||||
(STOPSIGS): Likewise.
|
||||
* hurd/hurdstartup.c (_hurd_startup): Likewise.
|
||||
* hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Likewise.
|
||||
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise.
|
||||
* hurd/msgportdemux.c (msgport_server): Likewise.
|
||||
* hurd/setauth.c (_hurd_setauth): Likewise.
|
||||
* include/features.h (__GLIBC_USE_DEPRECATED_SCANF): Likewise.
|
||||
* libio/libioP.h [IO_DEBUG] (CHECK_FILE): Likewise.
|
||||
* locale/programs/ld-ctype.c (set_class_defaults): Likewise.
|
||||
* localedata/tests-mbwc/tst_swscanf.c (tst_swscanf): Likewise.
|
||||
* login/tst-utmp.c (do_check): Likewise.
|
||||
(simulate_login): Likewise.
|
||||
* mach/lowlevellock.h (lll_lock): Likewise.
|
||||
(lll_trylock): Likewise.
|
||||
* math/test-fenv.c (ALL_EXC): Likewise.
|
||||
* math/test-fenvinline.c (ALL_EXC): Likewise.
|
||||
* misc/sys/cdefs.h (__attribute_deprecated_msg__): Likewise.
|
||||
* nis/nis_call.c (__do_niscall3): Likewise.
|
||||
* nis/nis_callback.c (cb_prog_1): Likewise.
|
||||
* nis/nis_defaults.c (searchaccess): Likewise.
|
||||
* nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise.
|
||||
* nis/nis_ismember.c (internal_ismember): Likewise.
|
||||
* nis/nis_local_names.c (nis_local_principal): Likewise.
|
||||
* nis/nss_nis/nis-rpc.c (_nss_nis_getrpcbyname_r): Likewise.
|
||||
* nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_getnetgrent_r):
|
||||
Likewise.
|
||||
* nis/ypclnt.c (yp_match): Likewise.
|
||||
(yp_first): Likewise.
|
||||
(yp_next): Likewise.
|
||||
(yp_master): Likewise.
|
||||
(yp_order): Likewise.
|
||||
* nscd/hstcache.c (cache_addhst): Likewise.
|
||||
* nscd/initgrcache.c (addinitgroupsX): Likewise.
|
||||
* nss/nss_compat/compat-pwd.c (copy_pwd_changes): Likewise.
|
||||
(internal_getpwuid_r): Likewise.
|
||||
* nss/nss_compat/compat-spwd.c (copy_spwd_changes): Likewise.
|
||||
* posix/glob.h (__GLOB_FLAGS): Likewise.
|
||||
* posix/regcomp.c (peek_token): Likewise.
|
||||
(peek_token_bracket): Likewise.
|
||||
(parse_expression): Likewise.
|
||||
* posix/regexec.c (sift_states_iter_mb): Likewise.
|
||||
(check_node_accept_bytes): Likewise.
|
||||
* posix/tst-spawn3.c (do_test): Likewise.
|
||||
* posix/wordexp-test.c (testit): Likewise.
|
||||
* posix/wordexp.c (parse_tilde): Likewise.
|
||||
(exec_comm): Likewise.
|
||||
* posix/wordexp.h (__WRDE_FLAGS): Likewise.
|
||||
* resource/vtimes.c (TIMEVAL_TO_VTIMES): Likewise.
|
||||
* setjmp/sigjmp.c (__sigjmp_save): Likewise.
|
||||
* stdio-common/printf_fp.c (__printf_fp_l): Likewise.
|
||||
* stdio-common/tst-fileno.c (do_test): Likewise.
|
||||
* stdio-common/vfprintf-internal.c (vfprintf): Likewise.
|
||||
* stdlib/strfmon_l.c (__vstrfmon_l_internal): Likewise.
|
||||
* stdlib/strtod_l.c (round_and_return): Likewise.
|
||||
(____STRTOF_INTERNAL): Likewise.
|
||||
* stdlib/tst-strfrom.h (TEST_STRFROM): Likewise.
|
||||
* string/strcspn.c (STRCSPN): Likewise.
|
||||
* string/test-memmem.c (simple_memmem): Likewise.
|
||||
* termios/tcsetattr.c (tcsetattr): Likewise.
|
||||
* time/alt_digit.c (_nl_parse_alt_digit): Likewise.
|
||||
* time/asctime.c (asctime_internal): Likewise.
|
||||
* time/strptime_l.c (__strptime_internal): Likewise.
|
||||
* time/sys/time.h (timercmp): Likewise.
|
||||
* time/tzfile.c (__tzfile_compute): Likewise.
|
||||
|
||||
2019-02-21 Patsy Griffin Franklin <pfrankli@redhat.com>
|
||||
|
||||
[BZ #21915]
|
||||
|
@ -47,10 +47,10 @@ simple_memmem (const void *haystack, size_t haystack_len, const void *needle,
|
||||
return NULL;
|
||||
|
||||
for (begin = (const char *) haystack; begin <= last_possible; ++begin)
|
||||
if (begin[0] == ((const char *) needle)[0] &&
|
||||
!memcmp ((const void *) &begin[1],
|
||||
(const void *) ((const char *) needle + 1),
|
||||
needle_len - 1))
|
||||
if (begin[0] == ((const char *) needle)[0]
|
||||
&& !memcmp ((const void *) &begin[1],
|
||||
(const void *) ((const char *) needle + 1),
|
||||
needle_len - 1))
|
||||
return (void *) begin;
|
||||
|
||||
return NULL;
|
||||
|
@ -29,9 +29,9 @@
|
||||
#include "bench-util.c"
|
||||
|
||||
#define TIMESPEC_AFTER(a, b) \
|
||||
(((a).tv_sec == (b).tv_sec) ? \
|
||||
((a).tv_nsec > (b).tv_nsec) : \
|
||||
((a).tv_sec > (b).tv_sec))
|
||||
(((a).tv_sec == (b).tv_sec) \
|
||||
? ((a).tv_nsec > (b).tv_nsec) \
|
||||
: ((a).tv_sec > (b).tv_sec))
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
|
@ -116,8 +116,8 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
ctx->buffer32[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3);
|
||||
ctx->buffer32[(bytes + pad + 4) / 4] = SWAP ((ctx->total[1] << 3) |
|
||||
(ctx->total[0] >> 29));
|
||||
ctx->buffer32[(bytes + pad + 4) / 4] = SWAP ((ctx->total[1] << 3)
|
||||
| (ctx->total[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
__md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
|
@ -125,8 +125,8 @@ __sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
|
||||
ctx->buffer64[(bytes + pad) / 8] = SWAP64 (ctx->total64 << 3);
|
||||
#else
|
||||
ctx->buffer32[(bytes + pad + 4) / 4] = SWAP (ctx->total[TOTAL64_low] << 3);
|
||||
ctx->buffer32[(bytes + pad) / 4] = SWAP ((ctx->total[TOTAL64_high] << 3) |
|
||||
(ctx->total[TOTAL64_low] >> 29));
|
||||
ctx->buffer32[(bytes + pad) / 4] = SWAP ((ctx->total[TOTAL64_high] << 3)
|
||||
| (ctx->total[TOTAL64_low] >> 29));
|
||||
#endif
|
||||
|
||||
/* Process last bytes. */
|
||||
|
@ -149,8 +149,8 @@ __sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
|
||||
|
||||
/* Put the 128-bit file length in *bits* at the end of the buffer. */
|
||||
ctx->buffer64[(bytes + pad + 8) / 8] = SWAP (ctx->total[TOTAL128_low] << 3);
|
||||
ctx->buffer64[(bytes + pad) / 8] = SWAP ((ctx->total[TOTAL128_high] << 3) |
|
||||
(ctx->total[TOTAL128_low] >> 61));
|
||||
ctx->buffer64[(bytes + pad) / 8] = SWAP ((ctx->total[TOTAL128_high] << 3)
|
||||
| (ctx->total[TOTAL128_low] >> 61));
|
||||
|
||||
/* Process last bytes. */
|
||||
__sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
|
||||
|
@ -712,9 +712,9 @@ load_aux_cache (const char *aux_cache_name)
|
||||
if (aux_cache == MAP_FAILED
|
||||
|| aux_cache_size < sizeof (struct aux_cache_file)
|
||||
|| memcmp (aux_cache->magic, AUX_CACHEMAGIC, sizeof AUX_CACHEMAGIC - 1)
|
||||
|| aux_cache_size != (sizeof(struct aux_cache_file) +
|
||||
aux_cache->nlibs * sizeof(struct aux_cache_file_entry) +
|
||||
aux_cache->len_strings))
|
||||
|| aux_cache_size != (sizeof(struct aux_cache_file)
|
||||
+ aux_cache->nlibs * sizeof(struct aux_cache_file_entry)
|
||||
+ aux_cache->len_strings))
|
||||
{
|
||||
close (fd);
|
||||
init_aux_cache ();
|
||||
|
@ -1581,15 +1581,15 @@ open_verify (const char *name, int fd,
|
||||
const Elf32_Word *magp = (const void *) ehdr->e_ident;
|
||||
if (*magp !=
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
((ELFMAG0 << (EI_MAG0 * 8)) |
|
||||
(ELFMAG1 << (EI_MAG1 * 8)) |
|
||||
(ELFMAG2 << (EI_MAG2 * 8)) |
|
||||
(ELFMAG3 << (EI_MAG3 * 8)))
|
||||
((ELFMAG0 << (EI_MAG0 * 8))
|
||||
| (ELFMAG1 << (EI_MAG1 * 8))
|
||||
| (ELFMAG2 << (EI_MAG2 * 8))
|
||||
| (ELFMAG3 << (EI_MAG3 * 8)))
|
||||
#else
|
||||
((ELFMAG0 << (EI_MAG3 * 8)) |
|
||||
(ELFMAG1 << (EI_MAG2 * 8)) |
|
||||
(ELFMAG2 << (EI_MAG1 * 8)) |
|
||||
(ELFMAG3 << (EI_MAG0 * 8)))
|
||||
((ELFMAG0 << (EI_MAG3 * 8))
|
||||
| (ELFMAG1 << (EI_MAG2 * 8))
|
||||
| (ELFMAG2 << (EI_MAG1 * 8))
|
||||
| (ELFMAG3 << (EI_MAG0 * 8)))
|
||||
#endif
|
||||
)
|
||||
errstring = N_("invalid ELF header");
|
||||
|
@ -49,8 +49,8 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
|
||||
{
|
||||
if ((d_tag_utype) dyn->d_tag < DT_NUM)
|
||||
info[dyn->d_tag] = dyn;
|
||||
else if (dyn->d_tag >= DT_LOPROC &&
|
||||
dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)
|
||||
else if (dyn->d_tag >= DT_LOPROC
|
||||
&& dyn->d_tag < DT_LOPROC + DT_THISPROCNUM)
|
||||
{
|
||||
/* This does not violate the array bounds of l->l_info, but
|
||||
gcc 4.6 on sparc somehow does not see this. */
|
||||
|
@ -164,10 +164,10 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
|
||||
if (size == 0)
|
||||
break;
|
||||
|
||||
*osversion = (abi_note [4] << 24) |
|
||||
((abi_note [5] & 0xff) << 16) |
|
||||
((abi_note [6] & 0xff) << 8) |
|
||||
(abi_note [7] & 0xff);
|
||||
*osversion = ((abi_note [4] << 24)
|
||||
| ((abi_note [5] & 0xff) << 16)
|
||||
| ((abi_note [6] & 0xff) << 8)
|
||||
| (abi_note [7] & 0xff));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2110,8 +2110,8 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]);
|
||||
liblist = (ElfW(Lib) *)
|
||||
main_map->l_info[ADDRIDX (DT_GNU_LIBLIST)]->d_un.d_ptr;
|
||||
liblistend = (ElfW(Lib) *)
|
||||
((char *) liblist +
|
||||
main_map->l_info[VALIDX (DT_GNU_LIBLISTSZ)]->d_un.d_val);
|
||||
((char *) liblist
|
||||
+ main_map->l_info[VALIDX (DT_GNU_LIBLISTSZ)]->d_un.d_val);
|
||||
r_list = main_map->l_searchlist.r_list;
|
||||
r_listend = r_list + main_map->l_searchlist.r_nlist;
|
||||
|
||||
|
@ -1354,8 +1354,8 @@ generate_call_graph (struct profdata *profdata)
|
||||
? sortsym[runp->idx]->ticks * tick_unit : 0.0),
|
||||
0.0, /* FIXME: what's time for the children, recursive */
|
||||
runp->count, sortsym[cnt]->calls,
|
||||
(runp->idx != (size_t) -1l ?
|
||||
sortsym[runp->idx]->name : "<UNKNOWN>"));
|
||||
(runp->idx != (size_t) -1l
|
||||
? sortsym[runp->idx]->name : "<UNKNOWN>"));
|
||||
|
||||
if (runp->idx != (size_t) -1l)
|
||||
printf (" [%Zd]", runp->idx);
|
||||
|
@ -44,8 +44,8 @@ _hurd_ctty_input (io_t port, io_t ctty, error_t (*rpc) (io_t))
|
||||
{
|
||||
struct hurd_sigstate *ss = _hurd_self_sigstate ();
|
||||
__spin_lock (&ss->lock);
|
||||
if (__sigismember (&ss->blocked, SIGTTIN) ||
|
||||
ss->actions[SIGTTIN].sa_handler == SIG_IGN)
|
||||
if (__sigismember (&ss->blocked, SIGTTIN)
|
||||
|| ss->actions[SIGTTIN].sa_handler == SIG_IGN)
|
||||
/* We are blocking or ignoring SIGTTIN. Just fail. */
|
||||
err = EIO;
|
||||
__spin_unlock (&ss->lock);
|
||||
|
@ -38,8 +38,8 @@ _hurd_ctty_output (io_t port, io_t ctty, error_t (*rpc) (io_t))
|
||||
SIGTTOU. We redo this check at the top of the loop in case
|
||||
the signal handler changed the state. */
|
||||
__spin_lock (&ss->lock);
|
||||
if (__sigismember (&ss->blocked, SIGTTOU) ||
|
||||
ss->actions[SIGTTOU].sa_handler == SIG_IGN)
|
||||
if (__sigismember (&ss->blocked, SIGTTOU)
|
||||
|| ss->actions[SIGTTOU].sa_handler == SIG_IGN)
|
||||
err = EIO;
|
||||
else
|
||||
err = 0;
|
||||
|
@ -266,24 +266,24 @@ reauth_dtable (void)
|
||||
__spin_lock (&d->port.lock);
|
||||
|
||||
/* Reauthenticate the descriptor's port. */
|
||||
if (d->port.port != MACH_PORT_NULL &&
|
||||
! __io_reauthenticate (d->port.port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND) &&
|
||||
! __USEPORT (AUTH, __auth_user_authenticate
|
||||
(port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&new)))
|
||||
if (d->port.port != MACH_PORT_NULL
|
||||
&& ! __io_reauthenticate (d->port.port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND)
|
||||
&& ! __USEPORT (AUTH, __auth_user_authenticate
|
||||
(port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&new)))
|
||||
{
|
||||
/* Replace the port in the descriptor cell
|
||||
with the newly reauthenticated port. */
|
||||
|
||||
if (d->ctty.port != MACH_PORT_NULL &&
|
||||
! __io_reauthenticate (d->ctty.port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND) &&
|
||||
! __USEPORT (AUTH, __auth_user_authenticate
|
||||
(port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&newctty)))
|
||||
if (d->ctty.port != MACH_PORT_NULL
|
||||
&& ! __io_reauthenticate (d->ctty.port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND)
|
||||
&& ! __USEPORT (AUTH, __auth_user_authenticate
|
||||
(port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&newctty)))
|
||||
_hurd_port_set (&d->ctty, newctty);
|
||||
|
||||
_hurd_port_locked_set (&d->port, new);
|
||||
|
@ -41,8 +41,8 @@ __getdport (int fd)
|
||||
return MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
if (fd < 0 || (unsigned int) fd > _hurd_init_dtablesize ||
|
||||
_hurd_init_dtable[fd] == MACH_PORT_NULL)
|
||||
if (fd < 0 || (unsigned int) fd > _hurd_init_dtablesize
|
||||
|| _hurd_init_dtable[fd] == MACH_PORT_NULL)
|
||||
{
|
||||
errno = EBADF;
|
||||
return MACH_PORT_NULL;
|
||||
|
@ -379,8 +379,8 @@ extern mach_msg_timeout_t _hurd_interrupted_rpc_timeout;
|
||||
__mach_port_deallocate (__mach_task_self (), msgport); \
|
||||
if ((dealloc_refport) && refport != MACH_PORT_NULL) \
|
||||
__mach_port_deallocate (__mach_task_self (), refport); \
|
||||
} while (__err == MACH_SEND_INVALID_DEST || \
|
||||
__err == MIG_SERVER_DIED); \
|
||||
} while (__err == MACH_SEND_INVALID_DEST \
|
||||
|| __err == MIG_SERVER_DIED); \
|
||||
__err; \
|
||||
})
|
||||
|
||||
|
@ -51,8 +51,8 @@ struct hurd_signal_preemptor
|
||||
};
|
||||
|
||||
#define HURD_PREEMPT_SIGNAL_P(preemptor, signo, sigcode) \
|
||||
(((preemptor)->signals & sigmask (signo)) && \
|
||||
(sigcode) >= (preemptor)->first && (sigcode) <= (preemptor)->last)
|
||||
(((preemptor)->signals & sigmask (signo)) \
|
||||
&& (sigcode) >= (preemptor)->first && (sigcode) <= (preemptor)->last)
|
||||
|
||||
|
||||
/* Signal preemptors applying to all threads; locked by _hurd_siglock. */
|
||||
|
@ -52,8 +52,8 @@ _hurdsig_fault_catch_exception_raise (mach_port_t port,
|
||||
int signo;
|
||||
struct hurd_signal_detail d;
|
||||
|
||||
if (port != forward_sigexc ||
|
||||
thread != _hurd_msgport_thread || task != __mach_task_self ())
|
||||
if (port != forward_sigexc
|
||||
|| thread != _hurd_msgport_thread || task != __mach_task_self ())
|
||||
return EPERM; /* Strange bogosity. */
|
||||
|
||||
d.exc = exception;
|
||||
|
@ -78,16 +78,16 @@ fioctl (int fd,
|
||||
break;
|
||||
|
||||
case FIONBIO:
|
||||
err = HURD_DPORT_USE (fd, (*arg ?
|
||||
__io_set_some_openmodes :
|
||||
__io_clear_some_openmodes)
|
||||
err = HURD_DPORT_USE (fd, (*arg
|
||||
? __io_set_some_openmodes
|
||||
: __io_clear_some_openmodes)
|
||||
(port, O_NONBLOCK));
|
||||
break;
|
||||
|
||||
case FIOASYNC:
|
||||
err = HURD_DPORT_USE (fd, (*arg ?
|
||||
__io_set_some_openmodes :
|
||||
__io_clear_some_openmodes)
|
||||
err = HURD_DPORT_USE (fd, (*arg
|
||||
? __io_set_some_openmodes
|
||||
: __io_clear_some_openmodes)
|
||||
(port, O_ASYNC));
|
||||
break;
|
||||
|
||||
|
@ -81,8 +81,8 @@ _hurd_select (int nfds,
|
||||
return -1;
|
||||
}
|
||||
|
||||
to = (timeout->tv_sec * 1000 +
|
||||
(timeout->tv_nsec + 999999) / 1000000);
|
||||
to = (timeout->tv_sec * 1000
|
||||
+ (timeout->tv_nsec + 999999) / 1000000);
|
||||
}
|
||||
|
||||
if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset))
|
||||
@ -347,30 +347,30 @@ _hurd_select (int nfds,
|
||||
{ MACH_MSG_TYPE_INTEGER_T, sizeof (integer_t) * 8, 1, 1, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
if (msg.head.msgh_id == IO_SELECT_REPLY_MSGID &&
|
||||
msg.head.msgh_size >= sizeof msg.error &&
|
||||
!(msg.head.msgh_bits & MACH_MSGH_BITS_COMPLEX) &&
|
||||
if (msg.head.msgh_id == IO_SELECT_REPLY_MSGID
|
||||
&& msg.head.msgh_size >= sizeof msg.error
|
||||
&& !(msg.head.msgh_bits & MACH_MSGH_BITS_COMPLEX)
|
||||
#ifdef MACH_MSG_TYPE_BIT
|
||||
msg.error.err_type.word == inttype.word
|
||||
&& msg.error.err_type.word == inttype.word
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* This is a properly formatted message so far.
|
||||
See if it is a success or a failure. */
|
||||
if (msg.error.err == EINTR &&
|
||||
msg.head.msgh_size == sizeof msg.error)
|
||||
if (msg.error.err == EINTR
|
||||
&& msg.head.msgh_size == sizeof msg.error)
|
||||
{
|
||||
/* EINTR response; poll for further responses
|
||||
and then return quickly. */
|
||||
err = EINTR;
|
||||
goto poll;
|
||||
}
|
||||
if (msg.error.err ||
|
||||
msg.head.msgh_size != sizeof msg.success ||
|
||||
if (msg.error.err
|
||||
|| msg.head.msgh_size != sizeof msg.success
|
||||
#ifdef MACH_MSG_TYPE_BIT
|
||||
msg.success.result_type.word != inttype.word ||
|
||||
|| msg.success.result_type.word != inttype.word
|
||||
#endif
|
||||
(msg.success.result & SELECT_ALL) == 0)
|
||||
|| (msg.success.result & SELECT_ALL) == 0)
|
||||
{
|
||||
/* Error or bogus reply. Simulate readiness. */
|
||||
__mach_msg_destroy (&msg.head);
|
||||
|
@ -309,8 +309,8 @@ _hurdsig_abort_rpcs (struct hurd_sigstate *ss, int signo, int sigthread,
|
||||
receive completes immediately or aborts. */
|
||||
abort_thread (ss, state, reply);
|
||||
|
||||
if (state->basic.PC >= (natural_t) &_hurd_intr_rpc_msg_about_to &&
|
||||
state->basic.PC < (natural_t) &_hurd_intr_rpc_msg_in_trap)
|
||||
if (state->basic.PC >= (natural_t) &_hurd_intr_rpc_msg_about_to
|
||||
&& state->basic.PC < (natural_t) &_hurd_intr_rpc_msg_in_trap)
|
||||
{
|
||||
/* The thread is about to do the RPC, but hasn't yet entered
|
||||
mach_msg. Mutate the thread's state so it knows not to try
|
||||
@ -321,11 +321,11 @@ _hurdsig_abort_rpcs (struct hurd_sigstate *ss, int signo, int sigthread,
|
||||
state->basic.SYSRETURN = MACH_SEND_INTERRUPTED;
|
||||
*state_change = 1;
|
||||
}
|
||||
else if (state->basic.PC == (natural_t) &_hurd_intr_rpc_msg_in_trap &&
|
||||
else if (state->basic.PC == (natural_t) &_hurd_intr_rpc_msg_in_trap
|
||||
/* The thread was blocked in the system call. After thread_abort,
|
||||
the return value register indicates what state the RPC was in
|
||||
when interrupted. */
|
||||
state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
|
||||
&& state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
|
||||
{
|
||||
/* The RPC request message was sent and the thread was waiting for
|
||||
the reply message; now the message receive has been aborted, so
|
||||
@ -462,8 +462,8 @@ sigset_t _hurdsig_preempted_set;
|
||||
weak_alias (_hurdsig_preemptors, _hurdsig_preempters)
|
||||
|
||||
/* Mask of stop signals. */
|
||||
#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) | \
|
||||
sigmask (SIGSTOP) | sigmask (SIGTSTP))
|
||||
#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) \
|
||||
| sigmask (SIGSTOP) | sigmask (SIGTSTP))
|
||||
|
||||
/* Deliver a signal. SS is not locked. */
|
||||
void
|
||||
|
@ -127,9 +127,9 @@ _hurd_startup (void **argptr, void (*main) (intptr_t *data))
|
||||
pointers and fill them in. We allocate the space for the
|
||||
environment pointers immediately after the argv pointers because
|
||||
the ELF ABI will expect it. */
|
||||
argcptr = __alloca (sizeof (intptr_t) +
|
||||
(argc + 1 + envc + 1) * sizeof (char *) +
|
||||
sizeof (struct hurd_startup_data));
|
||||
argcptr = __alloca (sizeof (intptr_t)
|
||||
+ (argc + 1 + envc + 1) * sizeof (char *)
|
||||
+ sizeof (struct hurd_startup_data));
|
||||
*argcptr = argc;
|
||||
argv = (void *) (argcptr + 1);
|
||||
__argz_extract (args, argslen, argv);
|
||||
|
@ -362,12 +362,12 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
|
||||
1, TRUE, FALSE, FALSE, 0 } };
|
||||
#endif
|
||||
|
||||
if (m->reply.RetCode == EINTR &&
|
||||
m->header.msgh_size == sizeof m->reply &&
|
||||
if (m->reply.RetCode == EINTR
|
||||
&& m->header.msgh_size == sizeof m->reply
|
||||
#ifdef MACH_MSG_TYPE_BIT
|
||||
m->check.type == check.i &&
|
||||
&& m->check.type == check.i
|
||||
#endif
|
||||
!(m->header.msgh_bits & MACH_MSGH_BITS_COMPLEX))
|
||||
&& !(m->header.msgh_bits & MACH_MSGH_BITS_COMPLEX))
|
||||
{
|
||||
/* It is indeed EINTR. Is the interrupt for us? */
|
||||
if (ss->intr_port != MACH_PORT_NULL)
|
||||
|
@ -121,10 +121,10 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
|
||||
}
|
||||
|
||||
/* An empty RETRYNAME indicates we have the final port. */
|
||||
if (retryname[0] == '\0' &&
|
||||
if (retryname[0] == '\0'
|
||||
/* If reauth'd, we must do one more retry on "" to give the new
|
||||
translator a chance to make a new port for us. */
|
||||
doretry == FS_RETRY_NORMAL)
|
||||
&& doretry == FS_RETRY_NORMAL)
|
||||
{
|
||||
if (flags & O_NOFOLLOW)
|
||||
{
|
||||
@ -258,10 +258,10 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
if (retryname[1] == 'a' && retryname[2] == 'c' &&
|
||||
retryname[3] == 'h' && retryname[4] == 't' &&
|
||||
retryname[5] == 'y' && retryname[6] == 'p' &&
|
||||
retryname[7] == 'e')
|
||||
if (retryname[1] == 'a' && retryname[2] == 'c'
|
||||
&& retryname[3] == 'h' && retryname[4] == 't'
|
||||
&& retryname[5] == 'y' && retryname[6] == 'p'
|
||||
&& retryname[7] == 'e')
|
||||
{
|
||||
error_t err;
|
||||
struct host_basic_info hostinfo;
|
||||
|
@ -46,8 +46,8 @@ msgport_server (mach_msg_header_t *inp,
|
||||
if ((*d->demux) (inp, outp))
|
||||
return 1;
|
||||
|
||||
return (_S_exc_server (inp, outp) ||
|
||||
_S_msg_server (inp, outp));
|
||||
return (_S_exc_server (inp, outp)
|
||||
|| _S_msg_server (inp, outp));
|
||||
}
|
||||
|
||||
/* This is the code that the signal thread runs. */
|
||||
|
@ -67,12 +67,12 @@ _hurd_setauth (auth_t new)
|
||||
mach_port_t new;
|
||||
ref = __mach_reply_port ();
|
||||
if (! __io_reauthenticate (_hurd_init_dtable[d],
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND) &&
|
||||
! HURD_PORT_USE (&_hurd_ports[INIT_PORT_AUTH],
|
||||
__auth_user_authenticate
|
||||
(port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&new)))
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND)
|
||||
&& ! HURD_PORT_USE (&_hurd_ports[INIT_PORT_AUTH],
|
||||
__auth_user_authenticate
|
||||
(port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&new)))
|
||||
{
|
||||
__mach_port_deallocate (__mach_task_self (),
|
||||
_hurd_init_dtable[d]);
|
||||
@ -84,20 +84,20 @@ _hurd_setauth (auth_t new)
|
||||
ref = __mach_reply_port ();
|
||||
if (__USEPORT (CRDIR,
|
||||
! __io_reauthenticate (port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND) &&
|
||||
! __auth_user_authenticate (new,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&newport)))
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND)
|
||||
&& ! __auth_user_authenticate (new,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&newport)))
|
||||
_hurd_port_set (&_hurd_ports[INIT_PORT_CRDIR], newport);
|
||||
__mach_port_destroy (__mach_task_self (), ref);
|
||||
|
||||
ref = __mach_reply_port ();
|
||||
if (__USEPORT (CWDIR,
|
||||
! __io_reauthenticate (port,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND) &&
|
||||
! __auth_user_authenticate (new,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&newport)))
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND)
|
||||
&& ! __auth_user_authenticate (new,
|
||||
ref, MACH_MSG_TYPE_MAKE_SEND,
|
||||
&newport)))
|
||||
_hurd_port_set (&_hurd_ports[INIT_PORT_CWDIR], newport);
|
||||
__mach_port_destroy (__mach_task_self (), ref);
|
||||
|
||||
|
@ -414,10 +414,10 @@
|
||||
instance, with GCC, -std=gnu11 will have C99-compliant scanf with
|
||||
or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
|
||||
old extension. */
|
||||
#if defined __USE_GNU && \
|
||||
(defined __cplusplus \
|
||||
? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \
|
||||
: (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L))
|
||||
#if (defined __USE_GNU \
|
||||
&& (defined __cplusplus \
|
||||
? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \
|
||||
: (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L)))
|
||||
# define __GLIBC_USE_DEPRECATED_SCANF 1
|
||||
#else
|
||||
# define __GLIBC_USE_DEPRECATED_SCANF 0
|
||||
|
@ -848,13 +848,13 @@ _IO_deallocate_file (FILE *fp)
|
||||
}
|
||||
|
||||
#ifdef IO_DEBUG
|
||||
# define CHECK_FILE(FILE, RET) do { \
|
||||
if ((FILE) == NULL || \
|
||||
((FILE)->_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
|
||||
{ \
|
||||
__set_errno (EINVAL); \
|
||||
return RET; \
|
||||
} \
|
||||
# define CHECK_FILE(FILE, RET) do { \
|
||||
if ((FILE) == NULL \
|
||||
|| ((FILE)->_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
|
||||
{ \
|
||||
__set_errno (EINVAL); \
|
||||
return RET; \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
# define CHECK_FILE(FILE, RET) do { } while (0)
|
||||
|
@ -3148,11 +3148,12 @@ set_class_defaults (struct locale_ctype_t *ctype,
|
||||
the keywords `upper', `lower', `alpha', `digit', `xdigit' and `punct',
|
||||
shall belong to this character class." [P1003.2, 2.5.2.1] */
|
||||
{
|
||||
unsigned long int mask = BIT (tok_upper) | BIT (tok_lower) |
|
||||
BIT (tok_alpha) | BIT (tok_digit) | BIT (tok_xdigit) | BIT (tok_punct);
|
||||
unsigned long int maskw = BITw (tok_upper) | BITw (tok_lower) |
|
||||
BITw (tok_alpha) | BITw (tok_digit) | BITw (tok_xdigit) |
|
||||
BITw (tok_punct);
|
||||
unsigned long int mask = BIT (tok_upper) | BIT (tok_lower)
|
||||
| BIT (tok_alpha) | BIT (tok_digit) | BIT (tok_xdigit)
|
||||
| BIT (tok_punct);
|
||||
unsigned long int maskw = BITw (tok_upper) | BITw (tok_lower)
|
||||
| BITw (tok_alpha) | BITw (tok_digit) | BITw (tok_xdigit)
|
||||
| BITw (tok_punct);
|
||||
|
||||
for (size_t cnt = 0; cnt < ctype->class_collection_act; ++cnt)
|
||||
if ((ctype->class_collection[cnt] & maskw) != 0)
|
||||
@ -3169,11 +3170,12 @@ set_class_defaults (struct locale_ctype_t *ctype,
|
||||
and the <space> character shall belong to this character class."
|
||||
[P1003.2, 2.5.2.1] */
|
||||
{
|
||||
unsigned long int mask = BIT (tok_upper) | BIT (tok_lower) |
|
||||
BIT (tok_alpha) | BIT (tok_digit) | BIT (tok_xdigit) | BIT (tok_punct);
|
||||
unsigned long int maskw = BITw (tok_upper) | BITw (tok_lower) |
|
||||
BITw (tok_alpha) | BITw (tok_digit) | BITw (tok_xdigit) |
|
||||
BITw (tok_punct);
|
||||
unsigned long int mask = BIT (tok_upper) | BIT (tok_lower)
|
||||
| BIT (tok_alpha) | BIT (tok_digit) | BIT (tok_xdigit)
|
||||
| BIT (tok_punct);
|
||||
unsigned long int maskw = BITw (tok_upper) | BITw (tok_lower)
|
||||
| BITw (tok_alpha) | BITw (tok_digit) | BITw (tok_xdigit)
|
||||
| BITw (tok_punct);
|
||||
struct charseq *seq;
|
||||
|
||||
for (size_t cnt = 0; cnt < ctype->class_collection_act; ++cnt)
|
||||
|
@ -115,11 +115,11 @@ tst_swscanf (FILE * fp, int debug_flg)
|
||||
|
||||
if (errno == 0 && !TST_INPUT (swscanf).wch)
|
||||
{
|
||||
if (val_int1 != TST_EXPECT (swscanf).val_int ||
|
||||
val_int2 != TST_EXPECT (swscanf).val_uns ||
|
||||
val_flt != TST_EXPECT (swscanf).val_flt ||
|
||||
val_c != TST_EXPECT (swscanf).val_c ||
|
||||
strcmp (val_s, TST_EXPECT (swscanf).val_s))
|
||||
if (val_int1 != TST_EXPECT (swscanf).val_int
|
||||
|| val_int2 != TST_EXPECT (swscanf).val_uns
|
||||
|| val_flt != TST_EXPECT (swscanf).val_flt
|
||||
|| val_c != TST_EXPECT (swscanf).val_c
|
||||
|| strcmp (val_s, TST_EXPECT (swscanf).val_s))
|
||||
{
|
||||
err_count++;
|
||||
Result (C_FAILURE, S_SWSCANF, CASE_3,
|
||||
|
@ -132,8 +132,8 @@ do_check (void)
|
||||
n = 0;
|
||||
while ((ut = getutent ()))
|
||||
{
|
||||
if (n < num_entries &&
|
||||
memcmp (ut, &entry[n], sizeof (struct utmp)))
|
||||
if (n < num_entries
|
||||
&& memcmp (ut, &entry[n], sizeof (struct utmp)))
|
||||
{
|
||||
error (0, 0, "UTMP entry does not match");
|
||||
return 1;
|
||||
@ -160,8 +160,8 @@ simulate_login (const char *line, const char *user)
|
||||
|
||||
for (n = 0; n < num_entries; n++)
|
||||
{
|
||||
if (strcmp (line, entry[n].ut_line) == 0 ||
|
||||
entry[n].ut_type == DEAD_PROCESS)
|
||||
if (strcmp (line, entry[n].ut_line) == 0
|
||||
|| entry[n].ut_type == DEAD_PROCESS)
|
||||
{
|
||||
if (entry[n].ut_pid == DEAD_PROCESS)
|
||||
entry[n].ut_pid = (entry_pid += 27);
|
||||
|
@ -49,8 +49,8 @@
|
||||
({ \
|
||||
int *__iptr = (int *)(ptr); \
|
||||
int __flags = (flags); \
|
||||
if (*__iptr != 0 || \
|
||||
atomic_compare_and_exchange_bool_acq (__iptr, 1, 0) != 0) \
|
||||
if (*__iptr != 0 \
|
||||
|| atomic_compare_and_exchange_bool_acq (__iptr, 1, 0) != 0) \
|
||||
while (1) \
|
||||
{ \
|
||||
if (atomic_exchange_acq (__iptr, 2) == 0) \
|
||||
@ -65,8 +65,8 @@
|
||||
#define lll_trylock(ptr) \
|
||||
({ \
|
||||
int *__iptr = (int *)(ptr); \
|
||||
*__iptr == 0 && \
|
||||
atomic_compare_and_exchange_bool_acq (__iptr, 1, 0) == 0 ? 0 : -1; \
|
||||
*__iptr == 0 \
|
||||
&& atomic_compare_and_exchange_bool_acq (__iptr, 1, 0) == 0 ? 0 : -1; \
|
||||
})
|
||||
|
||||
/* Release the lock at PTR. */
|
||||
|
@ -49,8 +49,8 @@
|
||||
#define OVERFLOW_EXC 0x08
|
||||
#define INVALID_EXC 0x10
|
||||
#define ALL_EXC \
|
||||
(INEXACT_EXC | DIVBYZERO_EXC | UNDERFLOW_EXC | OVERFLOW_EXC | \
|
||||
INVALID_EXC)
|
||||
(INEXACT_EXC | DIVBYZERO_EXC | UNDERFLOW_EXC | OVERFLOW_EXC \
|
||||
| INVALID_EXC)
|
||||
|
||||
static int count_errors;
|
||||
|
||||
|
@ -38,8 +38,8 @@
|
||||
#define OVERFLOW_EXC 0x08
|
||||
#define INVALID_EXC 0x10
|
||||
#define ALL_EXC \
|
||||
(INEXACT_EXC | DIVBYZERO_EXC | UNDERFLOW_EXC | OVERFLOW_EXC | \
|
||||
INVALID_EXC)
|
||||
(INEXACT_EXC | DIVBYZERO_EXC | UNDERFLOW_EXC | OVERFLOW_EXC \
|
||||
| INVALID_EXC)
|
||||
static int count_errors;
|
||||
|
||||
#if FE_ALL_EXCEPT
|
||||
|
@ -256,8 +256,8 @@
|
||||
/* Since version 4.5, gcc also allows one to specify the message printed
|
||||
when a deprecated function is used. clang claims to be gcc 4.2, but
|
||||
may also support this feature. */
|
||||
#if __GNUC_PREREQ (4,5) || \
|
||||
__glibc_clang_has_extension (__attribute_deprecated_with_message__)
|
||||
#if __GNUC_PREREQ (4,5) \
|
||||
|| __glibc_clang_has_extension (__attribute_deprecated_with_message__)
|
||||
# define __attribute_deprecated_msg__(msg) \
|
||||
__attribute__ ((__deprecated__ (msg)))
|
||||
#else
|
||||
|
@ -317,8 +317,8 @@ __do_niscall3 (dir_binding *dbp, u_long prog, xdrproc_t xargs, caddr_t req,
|
||||
switch (prog)
|
||||
{
|
||||
case NIS_IBLIST:
|
||||
if ((((nis_result *)resp)->status == NIS_CBRESULTS) &&
|
||||
(cb != NULL))
|
||||
if ((((nis_result *)resp)->status == NIS_CBRESULTS)
|
||||
&& (cb != NULL))
|
||||
{
|
||||
__nis_do_callback (dbp, &((nis_result *) resp)->cookie, cb);
|
||||
break;
|
||||
|
@ -130,8 +130,8 @@ cb_prog_1 (struct svc_req *rqstp, SVCXPRT *transp)
|
||||
for (i = 0; i < argument.cbproc_receive_1_arg.entries.entries_len; ++i)
|
||||
{
|
||||
#define cbproc_entry(a) argument.cbproc_receive_1_arg.entries.entries_val[a]
|
||||
char name[strlen (cbproc_entry(i)->zo_name) +
|
||||
strlen (cbproc_entry(i)->zo_domain) + 3];
|
||||
char name[strlen (cbproc_entry(i)->zo_name)
|
||||
+ strlen (cbproc_entry(i)->zo_domain) + 3];
|
||||
char *cp;
|
||||
|
||||
cp = stpcpy (name, cbproc_entry(i)->zo_name);
|
||||
|
@ -278,18 +278,18 @@ searchaccess (char *str, unsigned int access)
|
||||
cptr++; /* Remove "=" from beginning */
|
||||
/* Clear */
|
||||
if (n)
|
||||
result = result & ~((NIS_READ_ACC + NIS_MODIFY_ACC +
|
||||
NIS_CREATE_ACC + NIS_DESTROY_ACC) << 24);
|
||||
result = result & ~((NIS_READ_ACC + NIS_MODIFY_ACC
|
||||
+ NIS_CREATE_ACC + NIS_DESTROY_ACC) << 24);
|
||||
|
||||
if (o)
|
||||
result = result & ~((NIS_READ_ACC + NIS_MODIFY_ACC +
|
||||
NIS_CREATE_ACC + NIS_DESTROY_ACC) << 16);
|
||||
result = result & ~((NIS_READ_ACC + NIS_MODIFY_ACC
|
||||
+ NIS_CREATE_ACC + NIS_DESTROY_ACC) << 16);
|
||||
if (g)
|
||||
result = result & ~((NIS_READ_ACC + NIS_MODIFY_ACC +
|
||||
NIS_CREATE_ACC + NIS_DESTROY_ACC) << 8);
|
||||
result = result & ~((NIS_READ_ACC + NIS_MODIFY_ACC
|
||||
+ NIS_CREATE_ACC + NIS_DESTROY_ACC) << 8);
|
||||
if (w)
|
||||
result = result & ~(NIS_READ_ACC + NIS_MODIFY_ACC +
|
||||
NIS_CREATE_ACC + NIS_DESTROY_ACC);
|
||||
result = result & ~(NIS_READ_ACC + NIS_MODIFY_ACC
|
||||
+ NIS_CREATE_ACC + NIS_DESTROY_ACC);
|
||||
while (*cptr != '\0' && *cptr != ',')
|
||||
{
|
||||
switch (*cptr)
|
||||
|
@ -97,9 +97,9 @@ __nis_findfastest_with_timeout (dir_binding *bind,
|
||||
for (i = 0; i < bind->server_len; i++)
|
||||
for (j = 0; j < bind->server_val[i].ep.ep_len; ++j)
|
||||
if (strcmp (bind->server_val[i].ep.ep_val[j].family, "inet") == 0)
|
||||
if ((bind->server_val[i].ep.ep_val[j].proto == NULL) ||
|
||||
(bind->server_val[i].ep.ep_val[j].proto[0] == '-') ||
|
||||
(bind->server_val[i].ep.ep_val[j].proto[0] == '\0'))
|
||||
if ((bind->server_val[i].ep.ep_val[j].proto == NULL)
|
||||
|| (bind->server_val[i].ep.ep_val[j].proto[0] == '-')
|
||||
|| (bind->server_val[i].ep.ep_val[j].proto[0] == '\0'))
|
||||
{
|
||||
sin.sin_addr.s_addr =
|
||||
inetstr2int (bind->server_val[i].ep.ep_val[j].uaddr);
|
||||
|
@ -51,8 +51,8 @@ internal_ismember (const_nis_name principal, const_nis_name group)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((NIS_RES_NUMOBJ (res) != 1) ||
|
||||
(__type_of (NIS_RES_OBJECT (res)) != NIS_GROUP_OBJ))
|
||||
if ((NIS_RES_NUMOBJ (res) != 1)
|
||||
|| (__type_of (NIS_RES_OBJECT (res)) != NIS_GROUP_OBJ))
|
||||
{
|
||||
nis_freeresult (res);
|
||||
return 0;
|
||||
|
@ -106,8 +106,8 @@ nis_local_principal (void)
|
||||
buf[len] = '\0';
|
||||
}
|
||||
|
||||
res = nis_list (buf, USE_DGRAM + NO_AUTHINFO + FOLLOW_LINKS +
|
||||
FOLLOW_PATH, NULL, NULL);
|
||||
res = nis_list (buf, USE_DGRAM + NO_AUTHINFO + FOLLOW_LINKS
|
||||
+ FOLLOW_PATH, NULL, NULL);
|
||||
|
||||
if (res == NULL)
|
||||
goto nobody;
|
||||
|
@ -197,9 +197,9 @@ _nss_nis_getrpcbyname_r (const char *name, struct rpcent *rpc,
|
||||
return status;
|
||||
|
||||
int found = 0;
|
||||
while (!found &&
|
||||
((status = internal_nis_getrpcent_r (rpc, buffer, buflen, errnop,
|
||||
&data)) == NSS_STATUS_SUCCESS))
|
||||
while (!found
|
||||
&& ((status = internal_nis_getrpcent_r (rpc, buffer, buflen, errnop,
|
||||
&data)) == NSS_STATUS_SUCCESS))
|
||||
{
|
||||
if (strcmp (rpc->r_name, name) == 0)
|
||||
found = 1;
|
||||
|
@ -87,9 +87,9 @@ _nss_nisplus_getnetgrent_r (struct __netgrent *result, char *buffer,
|
||||
|
||||
result->type = triple_val;
|
||||
|
||||
if (hostlen == 0 ||
|
||||
NISENTRYVAL (result->position, 2,
|
||||
(nis_result *) result->data)[0] == '\0')
|
||||
if (hostlen == 0
|
||||
|| NISENTRYVAL (result->position, 2,
|
||||
(nis_result *) result->data)[0] == '\0')
|
||||
result->val.triple.host = NULL;
|
||||
else
|
||||
{
|
||||
@ -100,9 +100,9 @@ _nss_nisplus_getnetgrent_r (struct __netgrent *result, char *buffer,
|
||||
*cp++ = '\0';
|
||||
}
|
||||
|
||||
if (userlen == 0 ||
|
||||
NISENTRYVAL (result->position, 3,
|
||||
(nis_result *) result->data)[0] == '\0')
|
||||
if (userlen == 0
|
||||
|| NISENTRYVAL (result->position, 3,
|
||||
(nis_result *) result->data)[0] == '\0')
|
||||
result->val.triple.user = NULL;
|
||||
else
|
||||
{
|
||||
@ -113,9 +113,9 @@ _nss_nisplus_getnetgrent_r (struct __netgrent *result, char *buffer,
|
||||
*cp++ = '\0';
|
||||
}
|
||||
|
||||
if (domainlen == 0 ||
|
||||
NISENTRYVAL (result->position, 4,
|
||||
(nis_result *) result->data)[0] == '\0')
|
||||
if (domainlen == 0
|
||||
|| NISENTRYVAL (result->position, 4,
|
||||
(nis_result *) result->data)[0] == '\0')
|
||||
result->val.triple.domain = NULL;
|
||||
else
|
||||
{
|
||||
|
24
nis/ypclnt.c
24
nis/ypclnt.c
@ -436,9 +436,9 @@ yp_match (const char *indomain, const char *inmap, const char *inkey,
|
||||
ypresp_val resp;
|
||||
enum clnt_stat result;
|
||||
|
||||
if (indomain == NULL || indomain[0] == '\0' ||
|
||||
inmap == NULL || inmap[0] == '\0' ||
|
||||
inkey == NULL || inkey[0] == '\0' || inkeylen <= 0)
|
||||
if (indomain == NULL || indomain[0] == '\0'
|
||||
|| inmap == NULL || inmap[0] == '\0'
|
||||
|| inkey == NULL || inkey[0] == '\0' || inkeylen <= 0)
|
||||
return YPERR_BADARGS;
|
||||
|
||||
req.domain = (char *) indomain;
|
||||
@ -481,8 +481,8 @@ yp_first (const char *indomain, const char *inmap, char **outkey,
|
||||
ypresp_key_val resp;
|
||||
enum clnt_stat result;
|
||||
|
||||
if (indomain == NULL || indomain[0] == '\0' ||
|
||||
inmap == NULL || inmap[0] == '\0')
|
||||
if (indomain == NULL || indomain[0] == '\0'
|
||||
|| inmap == NULL || inmap[0] == '\0')
|
||||
return YPERR_BADARGS;
|
||||
|
||||
req.domain = (char *) indomain;
|
||||
@ -537,9 +537,9 @@ yp_next (const char *indomain, const char *inmap, const char *inkey,
|
||||
ypresp_key_val resp;
|
||||
enum clnt_stat result;
|
||||
|
||||
if (indomain == NULL || indomain[0] == '\0' ||
|
||||
inmap == NULL || inmap[0] == '\0' ||
|
||||
inkeylen <= 0 || inkey == NULL || inkey[0] == '\0')
|
||||
if (indomain == NULL || indomain[0] == '\0'
|
||||
|| inmap == NULL || inmap[0] == '\0'
|
||||
|| inkeylen <= 0 || inkey == NULL || inkey[0] == '\0')
|
||||
return YPERR_BADARGS;
|
||||
|
||||
req.domain = (char *) indomain;
|
||||
@ -592,8 +592,8 @@ yp_master (const char *indomain, const char *inmap, char **outname)
|
||||
ypresp_master resp;
|
||||
enum clnt_stat result;
|
||||
|
||||
if (indomain == NULL || indomain[0] == '\0' ||
|
||||
inmap == NULL || inmap[0] == '\0')
|
||||
if (indomain == NULL || indomain[0] == '\0'
|
||||
|| inmap == NULL || inmap[0] == '\0')
|
||||
return YPERR_BADARGS;
|
||||
|
||||
req.domain = (char *) indomain;
|
||||
@ -622,8 +622,8 @@ yp_order (const char *indomain, const char *inmap, unsigned int *outorder)
|
||||
struct ypresp_order resp;
|
||||
enum clnt_stat result;
|
||||
|
||||
if (indomain == NULL || indomain[0] == '\0' ||
|
||||
inmap == NULL || inmap[0] == '\0')
|
||||
if (indomain == NULL || indomain[0] == '\0'
|
||||
|| inmap == NULL || inmap[0] == '\0')
|
||||
return YPERR_BADARGS;
|
||||
|
||||
req.domain = (char *) indomain;
|
||||
|
@ -134,9 +134,9 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
|
||||
const hst_response_header *resp = (errval == EAGAIN
|
||||
? &tryagain : ¬found);
|
||||
|
||||
if (fd != -1 &&
|
||||
TEMP_FAILURE_RETRY (send (fd, resp, total,
|
||||
MSG_NOSIGNAL)) != total)
|
||||
if (fd != -1
|
||||
&& TEMP_FAILURE_RETRY (send (fd, resp, total,
|
||||
MSG_NOSIGNAL)) != total)
|
||||
all_written = false;
|
||||
|
||||
/* If we have a transient error or cannot permanently store
|
||||
|
@ -366,8 +366,8 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
||||
// XXX async OK?
|
||||
uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1;
|
||||
msync ((void *) pval,
|
||||
((uintptr_t) dataset & pagesize_m1) + total +
|
||||
req->key_len, MS_ASYNC);
|
||||
((uintptr_t) dataset & pagesize_m1) + total
|
||||
+ req->key_len, MS_ASYNC);
|
||||
}
|
||||
|
||||
(void) cache_add (INITGROUPS, cp, req->key_len, &dataset->head, true,
|
||||
|
@ -138,8 +138,8 @@ copy_pwd_changes (struct passwd *dest, struct passwd *src,
|
||||
{
|
||||
if (buffer == NULL)
|
||||
dest->pw_passwd = strdup (src->pw_passwd);
|
||||
else if (dest->pw_passwd &&
|
||||
strlen (dest->pw_passwd) >= strlen (src->pw_passwd))
|
||||
else if (dest->pw_passwd
|
||||
&& strlen (dest->pw_passwd) >= strlen (src->pw_passwd))
|
||||
strcpy (dest->pw_passwd, src->pw_passwd);
|
||||
else
|
||||
{
|
||||
@ -154,8 +154,8 @@ copy_pwd_changes (struct passwd *dest, struct passwd *src,
|
||||
{
|
||||
if (buffer == NULL)
|
||||
dest->pw_gecos = strdup (src->pw_gecos);
|
||||
else if (dest->pw_gecos &&
|
||||
strlen (dest->pw_gecos) >= strlen (src->pw_gecos))
|
||||
else if (dest->pw_gecos
|
||||
&& strlen (dest->pw_gecos) >= strlen (src->pw_gecos))
|
||||
strcpy (dest->pw_gecos, src->pw_gecos);
|
||||
else
|
||||
{
|
||||
@ -184,8 +184,8 @@ copy_pwd_changes (struct passwd *dest, struct passwd *src,
|
||||
{
|
||||
if (buffer == NULL)
|
||||
dest->pw_shell = strdup (src->pw_shell);
|
||||
else if (dest->pw_shell &&
|
||||
strlen (dest->pw_shell) >= strlen (src->pw_shell))
|
||||
else if (dest->pw_shell
|
||||
&& strlen (dest->pw_shell) >= strlen (src->pw_shell))
|
||||
strcpy (dest->pw_shell, src->pw_shell);
|
||||
else
|
||||
{
|
||||
@ -943,8 +943,8 @@ internal_getpwuid_r (uid_t uid, struct passwd *result, ent_t *ent,
|
||||
memcpy (buf, &result->pw_name[2], len);
|
||||
|
||||
status = getpwuid_plususer (uid, result, buffer, buflen, errnop);
|
||||
if (status == NSS_STATUS_SUCCESS &&
|
||||
innetgr (buf, NULL, result->pw_name, NULL))
|
||||
if (status == NSS_STATUS_SUCCESS
|
||||
&& innetgr (buf, NULL, result->pw_name, NULL))
|
||||
return NSS_STATUS_NOTFOUND;
|
||||
|
||||
continue;
|
||||
@ -990,8 +990,8 @@ internal_getpwuid_r (uid_t uid, struct passwd *result, ent_t *ent,
|
||||
memcpy (buf, &result->pw_name[1], len);
|
||||
|
||||
status = getpwuid_plususer (uid, result, buffer, buflen, errnop);
|
||||
if (status == NSS_STATUS_SUCCESS &&
|
||||
innetgr (buf, NULL, result->pw_name, NULL))
|
||||
if (status == NSS_STATUS_SUCCESS
|
||||
&& innetgr (buf, NULL, result->pw_name, NULL))
|
||||
return NSS_STATUS_NOTFOUND;
|
||||
continue;
|
||||
}
|
||||
|
@ -127,8 +127,8 @@ copy_spwd_changes (struct spwd *dest, struct spwd *src,
|
||||
{
|
||||
if (buffer == NULL)
|
||||
dest->sp_pwdp = strdup (src->sp_pwdp);
|
||||
else if (dest->sp_pwdp &&
|
||||
strlen (dest->sp_pwdp) >= strlen (src->sp_pwdp))
|
||||
else if (dest->sp_pwdp
|
||||
&& strlen (dest->sp_pwdp) >= strlen (src->sp_pwdp))
|
||||
strcpy (dest->sp_pwdp, src->sp_pwdp);
|
||||
else
|
||||
{
|
||||
|
14
posix/glob.h
14
posix/glob.h
@ -54,14 +54,14 @@ typedef __SIZE_TYPE__ size_t;
|
||||
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
|
||||
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
|
||||
if the user name is not available. */
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS \
|
||||
|GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND \
|
||||
|GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE \
|
||||
|GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
|
||||
#else
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD)
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS \
|
||||
|GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND \
|
||||
|GLOB_PERIOD)
|
||||
#endif
|
||||
|
||||
/* Error returns from `glob'. */
|
||||
|
@ -1800,8 +1800,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
|
||||
token->word_char = 0;
|
||||
#ifdef RE_ENABLE_I18N
|
||||
token->mb_partial = 0;
|
||||
if (input->mb_cur_max > 1 &&
|
||||
!re_string_first_byte (input, re_string_cur_idx (input)))
|
||||
if (input->mb_cur_max > 1
|
||||
&& !re_string_first_byte (input, re_string_cur_idx (input)))
|
||||
{
|
||||
token->type = CHARACTER;
|
||||
token->mb_partial = 1;
|
||||
@ -1988,8 +1988,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
|
||||
token->type = OP_PERIOD;
|
||||
break;
|
||||
case '^':
|
||||
if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE)) &&
|
||||
re_string_cur_idx (input) != 0)
|
||||
if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE))
|
||||
&& re_string_cur_idx (input) != 0)
|
||||
{
|
||||
char prev = re_string_peek_byte (input, -1);
|
||||
if (!(syntax & RE_NEWLINE_ALT) || prev != '\n')
|
||||
@ -1999,8 +1999,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
|
||||
token->opr.ctx_type = LINE_FIRST;
|
||||
break;
|
||||
case '$':
|
||||
if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) &&
|
||||
re_string_cur_idx (input) + 1 != re_string_length (input))
|
||||
if (!(syntax & RE_CONTEXT_INDEP_ANCHORS)
|
||||
&& re_string_cur_idx (input) + 1 != re_string_length (input))
|
||||
{
|
||||
re_token_t next;
|
||||
re_string_skip_bytes (input, 1);
|
||||
@ -2034,8 +2034,8 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
|
||||
token->opr.c = c;
|
||||
|
||||
#ifdef RE_ENABLE_I18N
|
||||
if (input->mb_cur_max > 1 &&
|
||||
!re_string_first_byte (input, re_string_cur_idx (input)))
|
||||
if (input->mb_cur_max > 1
|
||||
&& !re_string_first_byte (input, re_string_cur_idx (input)))
|
||||
{
|
||||
token->type = CHARACTER;
|
||||
return 1;
|
||||
@ -2333,8 +2333,8 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
|
||||
}
|
||||
FALLTHROUGH;
|
||||
case OP_CLOSE_SUBEXP:
|
||||
if ((token->type == OP_CLOSE_SUBEXP) &&
|
||||
!(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
|
||||
if ((token->type == OP_CLOSE_SUBEXP)
|
||||
&& !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
|
||||
{
|
||||
*err = REG_ERPAREN;
|
||||
return NULL;
|
||||
|
@ -2204,9 +2204,9 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
|
||||
int naccepted;
|
||||
/* Check the node can accept "multi byte". */
|
||||
naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx);
|
||||
if (naccepted > 0 && str_idx + naccepted <= max_str_idx &&
|
||||
!STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
|
||||
dfa->nexts[node_idx]))
|
||||
if (naccepted > 0 && str_idx + naccepted <= max_str_idx
|
||||
&& !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
|
||||
dfa->nexts[node_idx]))
|
||||
/* The node can't accept the "multi byte", or the
|
||||
destination was already thrown away, then the node
|
||||
couldn't accept the current input "multi byte". */
|
||||
@ -3782,10 +3782,10 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
|
||||
/* FIXME: I don't think this if is needed, as both '\n'
|
||||
and '\0' are char_len == 1. */
|
||||
/* '.' accepts any one character except the following two cases. */
|
||||
if ((!(dfa->syntax & RE_DOT_NEWLINE) &&
|
||||
re_string_byte_at (input, str_idx) == '\n') ||
|
||||
((dfa->syntax & RE_DOT_NOT_NULL) &&
|
||||
re_string_byte_at (input, str_idx) == '\0'))
|
||||
if ((!(dfa->syntax & RE_DOT_NEWLINE)
|
||||
&& re_string_byte_at (input, str_idx) == '\n')
|
||||
|| ((dfa->syntax & RE_DOT_NOT_NULL)
|
||||
&& re_string_byte_at (input, str_idx) == '\0'))
|
||||
return 0;
|
||||
return char_len;
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ do_test (void)
|
||||
|
||||
/* Executes a /bin/sh echo $$ 2>&1 > ${objpfx}tst-spawn3.pid . */
|
||||
const char pidfile[] = OBJPFX "tst-spawn3.pid";
|
||||
if (posix_spawn_file_actions_addopen (&a, STDOUT_FILENO, pidfile, O_WRONLY |
|
||||
O_CREAT | O_TRUNC, 0644) != 0)
|
||||
if (posix_spawn_file_actions_addopen (&a, STDOUT_FILENO, pidfile, O_WRONLY
|
||||
| O_CREAT | O_TRUNC, 0644) != 0)
|
||||
FAIL_EXIT1 ("posix_spawn_file_actions_addopen");
|
||||
|
||||
if (posix_spawn_file_actions_adddup2 (&a, STDOUT_FILENO, STDERR_FILENO) != 0)
|
||||
|
@ -508,8 +508,8 @@ testit (struct test_case_struct *tc)
|
||||
}
|
||||
|
||||
for (i = 0; i < we.we_wordc; ++i)
|
||||
if (we.we_wordv[i+start_offs] == NULL ||
|
||||
strcmp (tc->wordv[i], we.we_wordv[i+start_offs]) != 0)
|
||||
if (we.we_wordv[i+start_offs] == NULL
|
||||
|| strcmp (tc->wordv[i], we.we_wordv[i+start_offs]) != 0)
|
||||
{
|
||||
bzzzt = 1;
|
||||
break;
|
||||
@ -534,10 +534,10 @@ testit (struct test_case_struct *tc)
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
else if (retval != 0 && retval != WRDE_NOSPACE &&
|
||||
(we.we_wordc != sav_we.we_wordc ||
|
||||
we.we_wordv != sav_we.we_wordv ||
|
||||
we.we_offs != sav_we.we_offs))
|
||||
else if (retval != 0 && retval != WRDE_NOSPACE
|
||||
&& (we.we_wordc != sav_we.we_wordc
|
||||
|| we.we_wordv != sav_we.we_wordv
|
||||
|| we.we_offs != sav_we.we_offs))
|
||||
{
|
||||
bzzzt = 1;
|
||||
printf ("FAILED to restore wordexp_t members\n");
|
||||
|
@ -285,8 +285,8 @@ parse_tilde (char **word, size_t *word_length, size_t *max_length,
|
||||
|
||||
for (i = 1 + *offset; words[i]; i++)
|
||||
{
|
||||
if (words[i] == ':' || words[i] == '/' || words[i] == ' ' ||
|
||||
words[i] == '\t' || words[i] == 0 )
|
||||
if (words[i] == ':' || words[i] == '/' || words[i] == ' '
|
||||
|| words[i] == '\t' || words[i] == 0 )
|
||||
break;
|
||||
|
||||
if (words[i] == '\\')
|
||||
@ -1070,8 +1070,8 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
|
||||
/* Chop off trailing newlines (required by POSIX.2) */
|
||||
/* Ensure we don't go back further than the beginning of the
|
||||
substitution (i.e. remove maxnewlines bytes at most) */
|
||||
while (maxnewlines-- != 0 &&
|
||||
*word_length > 0 && (*word)[*word_length - 1] == '\n')
|
||||
while (maxnewlines-- != 0
|
||||
&& *word_length > 0 && (*word)[*word_length - 1] == '\n')
|
||||
{
|
||||
(*word)[--*word_length] = '\0';
|
||||
|
||||
|
@ -33,8 +33,8 @@ enum
|
||||
WRDE_REUSE = (1 << 3), /* Reuse storage in PWORDEXP. */
|
||||
WRDE_SHOWERR = (1 << 4), /* Don't redirect stderr to /dev/null. */
|
||||
WRDE_UNDEF = (1 << 5), /* Error for expanding undefined variables. */
|
||||
__WRDE_FLAGS = (WRDE_DOOFFS | WRDE_APPEND | WRDE_NOCMD |
|
||||
WRDE_REUSE | WRDE_SHOWERR | WRDE_UNDEF)
|
||||
__WRDE_FLAGS = (WRDE_DOOFFS | WRDE_APPEND | WRDE_NOCMD
|
||||
| WRDE_REUSE | WRDE_SHOWERR | WRDE_UNDEF)
|
||||
};
|
||||
|
||||
/* Structure describing a word-expansion run. */
|
||||
|
@ -22,8 +22,8 @@
|
||||
/* Return the number of 1/VTIMES_UNITS_PER_SECOND-second
|
||||
units in the `struct timeval' TV. */
|
||||
#define TIMEVAL_TO_VTIMES(tv) \
|
||||
((tv.tv_sec * VTIMES_UNITS_PER_SECOND) + \
|
||||
(tv.tv_usec * VTIMES_UNITS_PER_SECOND / 1000000))
|
||||
((tv.tv_sec * VTIMES_UNITS_PER_SECOND) \
|
||||
+ (tv.tv_usec * VTIMES_UNITS_PER_SECOND / 1000000))
|
||||
|
||||
/* If VT is not NULL, write statistics for WHO into *VT.
|
||||
Return 0 for success, -1 for failure. */
|
||||
|
@ -26,9 +26,9 @@
|
||||
int
|
||||
__sigjmp_save (sigjmp_buf env, int savemask)
|
||||
{
|
||||
env[0].__mask_was_saved = (savemask &&
|
||||
__sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
|
||||
(sigset_t *) &env[0].__saved_mask) == 0);
|
||||
env[0].__mask_was_saved = (savemask
|
||||
&& __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
|
||||
(sigset_t *) &env[0].__saved_mask) == 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -459,8 +459,8 @@ __printf_fp_l (FILE *fp, locale_t loc,
|
||||
}
|
||||
else
|
||||
{
|
||||
cy = __mpn_lshift (p.frac +
|
||||
(p.exponent + to_shift) / BITS_PER_MP_LIMB,
|
||||
cy = __mpn_lshift (p.frac
|
||||
+ (p.exponent + to_shift) / BITS_PER_MP_LIMB,
|
||||
fp_input, p.fracsize,
|
||||
(p.exponent + to_shift) % BITS_PER_MP_LIMB);
|
||||
p.fracsize += (p.exponent + to_shift) / BITS_PER_MP_LIMB;
|
||||
@ -533,8 +533,8 @@ __printf_fp_l (FILE *fp, locale_t loc,
|
||||
&__tens[powers->arrayoff
|
||||
+ _FPIO_CONST_OFFSET],
|
||||
powers->arraysize - _FPIO_CONST_OFFSET);
|
||||
p.tmpsize = p.scalesize +
|
||||
powers->arraysize - _FPIO_CONST_OFFSET;
|
||||
p.tmpsize = p.scalesize
|
||||
+ powers->arraysize - _FPIO_CONST_OFFSET;
|
||||
if (cy == 0)
|
||||
--p.tmpsize;
|
||||
}
|
||||
@ -717,10 +717,10 @@ __printf_fp_l (FILE *fp, locale_t loc,
|
||||
multiplication was not valid. This is because we cannot
|
||||
determine the number of bits in the result in advance. */
|
||||
if (incr < p.exponent + 3
|
||||
|| (incr == p.exponent + 3 &&
|
||||
(p.tmp[p.tmpsize - 1] < topval[1]
|
||||
|| (p.tmp[p.tmpsize - 1] == topval[1]
|
||||
&& p.tmp[p.tmpsize - 2] < topval[0]))))
|
||||
|| (incr == p.exponent + 3
|
||||
&& (p.tmp[p.tmpsize - 1] < topval[1]
|
||||
|| (p.tmp[p.tmpsize - 1] == topval[1]
|
||||
&& p.tmp[p.tmpsize - 2] < topval[0]))))
|
||||
{
|
||||
/* The factor is right. Adapt binary and decimal
|
||||
exponents. */
|
||||
@ -809,8 +809,8 @@ __printf_fp_l (FILE *fp, locale_t loc,
|
||||
numbers are in the range of 1.0 <= |fp| < 8.0. We simply
|
||||
shift it to the right place and divide it by 1.0 to get the
|
||||
leading digit. (Of course this division is not really made.) */
|
||||
assert (0 <= p.exponent && p.exponent < 3 &&
|
||||
p.exponent + to_shift < BITS_PER_MP_LIMB);
|
||||
assert (0 <= p.exponent && p.exponent < 3
|
||||
&& p.exponent + to_shift < BITS_PER_MP_LIMB);
|
||||
|
||||
/* Now shift the input value to its right place. */
|
||||
cy = __mpn_lshift (p.frac, fp_input, p.fracsize, (p.exponent + to_shift));
|
||||
|
@ -31,9 +31,9 @@ check (const char *name, FILE *stream, int fd)
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
return (check ("stdin", stdin, STDIN_FILENO) ||
|
||||
check ("stdout", stdout, STDOUT_FILENO) ||
|
||||
check ("stderr", stderr, STDERR_FILENO));
|
||||
return (check ("stdin", stdin, STDIN_FILENO)
|
||||
|| check ("stdout", stdout, STDOUT_FILENO)
|
||||
|| check ("stderr", stderr, STDERR_FILENO));
|
||||
}
|
||||
|
||||
#define TEST_FUNCTION do_test ()
|
||||
|
@ -1290,8 +1290,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap, unsigned int mode_flags)
|
||||
|
||||
#ifdef ORIENT
|
||||
/* Check for correct orientation. */
|
||||
if (_IO_vtable_offset (s) == 0 &&
|
||||
_IO_fwide (s, sizeof (CHAR_T) == 1 ? -1 : 1)
|
||||
if (_IO_vtable_offset (s) == 0
|
||||
&& _IO_fwide (s, sizeof (CHAR_T) == 1 ? -1 : 1)
|
||||
!= (sizeof (CHAR_T) == 1 ? -1 : 1))
|
||||
/* The stream is already oriented otherwise. */
|
||||
return EOF;
|
||||
|
@ -386,17 +386,17 @@ __vstrfmon_l_internal (char *s, size_t maxsize, locale_t loc,
|
||||
/* Check for degenerate cases */
|
||||
if (sep_by_space == 2)
|
||||
{
|
||||
if (sign_posn == 0 ||
|
||||
(sign_posn == 1 && !cs_precedes) ||
|
||||
(sign_posn == 2 && cs_precedes))
|
||||
if (sign_posn == 0
|
||||
|| (sign_posn == 1 && !cs_precedes)
|
||||
|| (sign_posn == 2 && cs_precedes))
|
||||
/* sign and symbol are not adjacent, so no separator */
|
||||
sep_by_space = 0;
|
||||
}
|
||||
if (other_sep_by_space == 2)
|
||||
{
|
||||
if (other_sign_posn == 0 ||
|
||||
(other_sign_posn == 1 && !other_cs_precedes) ||
|
||||
(other_sign_posn == 2 && other_cs_precedes))
|
||||
if (other_sign_posn == 0
|
||||
|| (other_sign_posn == 1 && !other_cs_precedes)
|
||||
|| (other_sign_posn == 2 && other_cs_precedes))
|
||||
/* sign and symbol are not adjacent, so no separator */
|
||||
other_sep_by_space = 0;
|
||||
}
|
||||
@ -444,8 +444,8 @@ __vstrfmon_l_internal (char *s, size_t maxsize, locale_t loc,
|
||||
++other_left_bytes;
|
||||
else if (other_sign_posn == 1)
|
||||
other_left_bytes += strlen (other_sign_string);
|
||||
else if (other_cs_precedes &&
|
||||
(other_sign_posn == 3 || other_sign_posn == 4))
|
||||
else if (other_cs_precedes
|
||||
&& (other_sign_posn == 3 || other_sign_posn == 4))
|
||||
other_left_bytes += strlen (other_sign_string);
|
||||
|
||||
/* Compare the number of bytes preceding the value for
|
||||
|
@ -280,11 +280,12 @@ round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
|
||||
mp_limb_t cy = __mpn_add_1 (retval_normal, retval,
|
||||
RETURN_LIMB_SIZE, 1);
|
||||
|
||||
if (((MANT_DIG % BITS_PER_MP_LIMB) == 0 && cy) ||
|
||||
((MANT_DIG % BITS_PER_MP_LIMB) != 0 &&
|
||||
((retval_normal[RETURN_LIMB_SIZE - 1]
|
||||
& (((mp_limb_t) 1) << (MANT_DIG % BITS_PER_MP_LIMB)))
|
||||
!= 0)))
|
||||
if (((MANT_DIG % BITS_PER_MP_LIMB) == 0 && cy)
|
||||
|| ((MANT_DIG % BITS_PER_MP_LIMB) != 0
|
||||
&& ((retval_normal[RETURN_LIMB_SIZE - 1]
|
||||
& (((mp_limb_t) 1)
|
||||
<< (MANT_DIG % BITS_PER_MP_LIMB)))
|
||||
!= 0)))
|
||||
is_tiny = false;
|
||||
}
|
||||
}
|
||||
@ -325,10 +326,10 @@ round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
|
||||
{
|
||||
mp_limb_t cy = __mpn_add_1 (retval, retval, RETURN_LIMB_SIZE, 1);
|
||||
|
||||
if (((MANT_DIG % BITS_PER_MP_LIMB) == 0 && cy) ||
|
||||
((MANT_DIG % BITS_PER_MP_LIMB) != 0 &&
|
||||
(retval[RETURN_LIMB_SIZE - 1]
|
||||
& (((mp_limb_t) 1) << (MANT_DIG % BITS_PER_MP_LIMB))) != 0))
|
||||
if (((MANT_DIG % BITS_PER_MP_LIMB) == 0 && cy)
|
||||
|| ((MANT_DIG % BITS_PER_MP_LIMB) != 0
|
||||
&& (retval[RETURN_LIMB_SIZE - 1]
|
||||
& (((mp_limb_t) 1) << (MANT_DIG % BITS_PER_MP_LIMB))) != 0))
|
||||
{
|
||||
++exponent;
|
||||
(void) __mpn_rshift (retval, retval, RETURN_LIMB_SIZE, 1);
|
||||
@ -861,9 +862,9 @@ ____STRTOF_INTERNAL (const STRING_TYPE *nptr, STRING_TYPE **endptr, int group,
|
||||
{
|
||||
cp += decimal_len;
|
||||
c = *cp;
|
||||
while ((c >= L_('0') && c <= L_('9')) ||
|
||||
(base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
|
||||
lo >= L_('a') && lo <= L_('f'); })))
|
||||
while ((c >= L_('0') && c <= L_('9'))
|
||||
|| (base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
|
||||
lo >= L_('a') && lo <= L_('f'); })))
|
||||
{
|
||||
if (c != L_('0') && lead_zero == (size_t) -1)
|
||||
lead_zero = dig_no - int_no;
|
||||
|
@ -103,10 +103,10 @@ test_ ## FSUF (void) \
|
||||
for (i = 0; i < sizeof (htest) / sizeof (htest[0]); i++) \
|
||||
{ \
|
||||
rc = FTOSTR (buf, 50, htest[i].fmt, htest[i].t.FSUF); \
|
||||
if (strcmp (buf, htest[i].exp[0]) == 0 || \
|
||||
strcmp (buf, htest[i].exp[1]) == 0 || \
|
||||
strcmp (buf, htest[i].exp[2]) == 0 || \
|
||||
strcmp (buf, htest[i].exp[3]) == 0) \
|
||||
if (strcmp (buf, htest[i].exp[0]) == 0 \
|
||||
|| strcmp (buf, htest[i].exp[1]) == 0 \
|
||||
|| strcmp (buf, htest[i].exp[2]) == 0 \
|
||||
|| strcmp (buf, htest[i].exp[3]) == 0) \
|
||||
continue; \
|
||||
else \
|
||||
{ \
|
||||
|
@ -30,8 +30,8 @@
|
||||
size_t
|
||||
STRCSPN (const char *str, const char *reject)
|
||||
{
|
||||
if (__glibc_unlikely (reject[0] == '\0') ||
|
||||
__glibc_unlikely (reject[1] == '\0'))
|
||||
if (__glibc_unlikely (reject[0] == '\0')
|
||||
|| __glibc_unlikely (reject[1] == '\0'))
|
||||
return __strchrnul (str, reject [0]) - str;
|
||||
|
||||
/* Use multiple small memsets to enable inlining on most targets. */
|
||||
|
@ -48,10 +48,10 @@ simple_memmem (const void *haystack, size_t haystack_len, const void *needle,
|
||||
return NULL;
|
||||
|
||||
for (begin = (const char *) haystack; begin <= last_possible; ++begin)
|
||||
if (begin[0] == ((const char *) needle)[0] &&
|
||||
!memcmp ((const void *) &begin[1],
|
||||
(const void *) ((const char *) needle + 1),
|
||||
needle_len - 1))
|
||||
if (begin[0] == ((const char *) needle)[0]
|
||||
&& !memcmp ((const void *) &begin[1],
|
||||
(const void *) ((const char *) needle + 1),
|
||||
needle_len - 1))
|
||||
return (void *) begin;
|
||||
|
||||
return NULL;
|
||||
|
@ -46,9 +46,9 @@ tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (bad_speed(termios_p->__ospeed) ||
|
||||
bad_speed(termios_p->__ispeed == 0 ?
|
||||
termios_p->__ospeed : termios_p->__ispeed))
|
||||
if (bad_speed(termios_p->__ospeed)
|
||||
|| bad_speed(termios_p->__ispeed == 0
|
||||
? termios_p->__ospeed : termios_p->__ispeed))
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
|
@ -162,8 +162,8 @@ _nl_parse_alt_digit (const char **strp, struct __locale_data *current)
|
||||
|| ! current->private.time->alt_digits_initialized)
|
||||
_nl_init_alt_digit (current);
|
||||
|
||||
if (current->private.time != NULL &&
|
||||
current->private.time->alt_digits != NULL)
|
||||
if (current->private.time != NULL
|
||||
&& current->private.time->alt_digits != NULL)
|
||||
/* Matching is not unambiguous. The alternative digits could be like
|
||||
I, II, III, ... and the first one is a substring of the second
|
||||
and third. Therefore we must keep on searching until we found
|
||||
|
@ -54,10 +54,10 @@ asctime_internal (const struct tm *tp, char *buf, size_t buflen)
|
||||
}
|
||||
|
||||
int n = __snprintf (buf, buflen, format,
|
||||
(tp->tm_wday < 0 || tp->tm_wday >= 7 ?
|
||||
"???" : ab_day_name (tp->tm_wday)),
|
||||
(tp->tm_mon < 0 || tp->tm_mon >= 12 ?
|
||||
"???" : ab_month_name (tp->tm_mon)),
|
||||
(tp->tm_wday < 0 || tp->tm_wday >= 7
|
||||
? "???" : ab_day_name (tp->tm_wday)),
|
||||
(tp->tm_mon < 0 || tp->tm_mon >= 12
|
||||
? "???" : ab_month_name (tp->tm_mon)),
|
||||
tp->tm_mday, tp->tm_hour, tp->tm_min,
|
||||
tp->tm_sec, 1900 + tp->tm_year);
|
||||
if (n < 0)
|
||||
|
@ -495,8 +495,8 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s.decided == not &&
|
||||
strcmp (_NL_CURRENT (LC_TIME, D_T_FMT), HERE_D_T_FMT))
|
||||
if (s.decided == not
|
||||
&& strcmp (_NL_CURRENT (LC_TIME, D_T_FMT), HERE_D_T_FMT))
|
||||
s.decided = loc;
|
||||
s.want_xday = 1;
|
||||
break;
|
||||
@ -641,9 +641,9 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s.decided == not &&
|
||||
strcmp (_NL_CURRENT (LC_TIME, T_FMT_AMPM),
|
||||
HERE_T_FMT_AMPM))
|
||||
if (s.decided == not
|
||||
&& strcmp (_NL_CURRENT (LC_TIME, T_FMT_AMPM),
|
||||
HERE_T_FMT_AMPM))
|
||||
s.decided = loc;
|
||||
break;
|
||||
}
|
||||
|
@ -159,9 +159,9 @@ extern int futimesat (int __fd, const char *__file,
|
||||
# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
|
||||
# define timercmp(a, b, CMP) \
|
||||
(((a)->tv_sec == (b)->tv_sec) ? \
|
||||
((a)->tv_usec CMP (b)->tv_usec) : \
|
||||
((a)->tv_sec CMP (b)->tv_sec))
|
||||
(((a)->tv_sec == (b)->tv_sec) \
|
||||
? ((a)->tv_usec CMP (b)->tv_usec) \
|
||||
: ((a)->tv_sec CMP (b)->tv_sec))
|
||||
# define timeradd(a, b, result) \
|
||||
do { \
|
||||
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
|
||||
|
@ -765,8 +765,8 @@ __tzfile_compute (__time64_t timer, int use_localtime,
|
||||
*leap_correct = leaps[i].change;
|
||||
|
||||
if (timer == leaps[i].transition && /* Exactly at the transition time. */
|
||||
((i == 0 && leaps[i].change > 0) ||
|
||||
leaps[i].change > leaps[i - 1].change))
|
||||
((i == 0 && leaps[i].change > 0)
|
||||
|| leaps[i].change > leaps[i - 1].change))
|
||||
{
|
||||
*leap_hit = 1;
|
||||
while (i > 0
|
||||
|
Loading…
Reference in New Issue
Block a user