]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use glibc_likely instead __builtin_expect.
authorOndřej Bílka <neleai@seznam.cz>
Mon, 10 Feb 2014 13:45:42 +0000 (14:45 +0100)
committerOndřej Bílka <neleai@seznam.cz>
Mon, 10 Feb 2014 14:07:12 +0000 (15:07 +0100)
466 files changed:
ChangeLog
assert/assert.c
benchtests/bench-memmem.c
catgets/open_catalog.c
csu/libc-start.c
debug/confstr_chk.c
debug/fread_chk.c
debug/fread_u_chk.c
debug/getgroups_chk.c
debug/mbsnrtowcs_chk.c
debug/mbsrtowcs_chk.c
debug/mbstowcs_chk.c
debug/memcpy_chk.c
debug/memmove_chk.c
debug/mempcpy_chk.c
debug/memset_chk.c
debug/stpcpy_chk.c
debug/strcat_chk.c
debug/strcpy_chk.c
debug/strncat_chk.c
debug/vsnprintf_chk.c
debug/vswprintf_chk.c
debug/wcpcpy_chk.c
debug/wcpncpy_chk.c
debug/wcscat_chk.c
debug/wcscpy_chk.c
debug/wcsncat_chk.c
debug/wcsncpy_chk.c
debug/wcsnrtombs_chk.c
debug/wcsrtombs_chk.c
debug/wcstombs_chk.c
debug/wmemcpy_chk.c
debug/wmemmove_chk.c
debug/wmempcpy_chk.c
debug/wmemset_chk.c
dirent/scandirat.c
dlfcn/dladdr.c
dlfcn/dladdr1.c
dlfcn/dlclose.c
dlfcn/dlerror.c
dlfcn/dlinfo.c
dlfcn/dlmopen.c
dlfcn/dlopen.c
dlfcn/dlopenold.c
dlfcn/dlsym.c
dlfcn/dlvsym.c
elf/dl-cache.c
elf/dl-close.c
elf/dl-conflict.c
elf/dl-deps.c
elf/dl-dst.h
elf/dl-fini.c
elf/dl-fptr.c
elf/dl-hwcaps.c
elf/dl-init.c
elf/dl-libc.c
elf/dl-load.c
elf/dl-lookup.c
elf/dl-minimal.c
elf/dl-open.c
elf/dl-reloc.c
elf/dl-runtime.c
elf/dl-sym.c
elf/dl-tls.c
elf/dl-version.c
elf/dl-writev.h
elf/ldconfig.c
elf/rtld.c
elf/setup-vdso.h
grp/compat-initgroups.c
grp/fgetgrent.c
grp/initgroups.c
grp/putgrent.c
hesiod/nss_hesiod/hesiod-grp.c
hurd/hurdinit.c
iconv/gconv_cache.c
iconv/gconv_close.c
iconv/gconv_open.c
iconv/gconv_simple.c
iconv/iconv.c
iconv/iconv_close.c
iconv/loop.c
iconv/skeleton.c
iconvdata/8bit-gap.c
iconvdata/ansi_x3.110.c
iconvdata/big5.c
iconvdata/big5hkscs.c
iconvdata/cp1255.c
iconvdata/cp1258.c
iconvdata/cp932.c
iconvdata/euc-cn.c
iconvdata/euc-jisx0213.c
iconvdata/euc-jp-ms.c
iconvdata/euc-jp.c
iconvdata/euc-kr.c
iconvdata/gb18030.c
iconvdata/gbbig5.c
iconvdata/gbgbk.c
iconvdata/gbk.c
iconvdata/ibm1364.c
iconvdata/ibm930.c
iconvdata/ibm932.c
iconvdata/ibm933.c
iconvdata/ibm935.c
iconvdata/ibm937.c
iconvdata/ibm939.c
iconvdata/ibm943.c
iconvdata/iso-2022-cn-ext.c
iconvdata/iso-2022-cn.c
iconvdata/iso-2022-jp-3.c
iconvdata/iso-2022-jp.c
iconvdata/iso-2022-kr.c
iconvdata/iso646.c
iconvdata/iso8859-1.c
iconvdata/iso_11548-1.c
iconvdata/iso_6937-2.c
iconvdata/iso_6937.c
iconvdata/johab.c
iconvdata/shift_jisx0213.c
iconvdata/sjis.c
iconvdata/t.61.c
iconvdata/tcvn5712-1.c
iconvdata/tscii.c
iconvdata/uhc.c
iconvdata/unicode.c
iconvdata/utf-16.c
iconvdata/utf-32.c
iconvdata/utf-7.c
include/atomic.h
inet/inet6_option.c
intl/bindtextdom.c
intl/dcigettext.c
intl/loadmsgcat.c
intl/localealias.c
libio/filedoalloc.c
libio/fileops.c
libio/fmemopen.c
libio/iofgets.c
libio/iofgets_u.c
libio/iofgetws.c
libio/iofgetws_u.c
libio/iogetdelim.c
libio/wfileops.c
locale/findlocale.c
locale/loadarchive.c
locale/loadlocale.c
locale/setlocale.c
login/programs/pt_chown.c
malloc/arena.c
malloc/malloc.c
malloc/memusage.c
math/e_exp2l.c
math/e_scalb.c
math/e_scalbf.c
math/e_scalbl.c
math/s_catan.c
math/s_catanf.c
math/s_catanh.c
math/s_catanhf.c
math/s_catanhl.c
math/s_catanl.c
math/s_ccosh.c
math/s_ccoshf.c
math/s_ccoshl.c
math/s_cexp.c
math/s_cexpf.c
math/s_cexpl.c
math/s_clog.c
math/s_clog10.c
math/s_clog10f.c
math/s_clog10l.c
math/s_clogf.c
math/s_clogl.c
math/s_csin.c
math/s_csinf.c
math/s_csinh.c
math/s_csinhf.c
math/s_csinhl.c
math/s_csinl.c
math/s_csqrt.c
math/s_csqrtf.c
math/s_csqrtl.c
math/s_ctan.c
math/s_ctanf.c
math/s_ctanh.c
math/s_ctanhf.c
math/s_ctanhl.c
math/s_ctanl.c
math/w_pow.c
math/w_powf.c
math/w_powl.c
math/w_scalb.c
math/w_scalbf.c
math/w_scalbl.c
misc/error.c
misc/pselect.c
nis/nis_call.c
nis/nis_callback.c
nis/nis_creategroup.c
nis/nis_domain_of_r.c
nis/nis_findserv.c
nis/nis_getservlist.c
nis/nis_lookup.c
nis/nis_subr.c
nis/nis_table.c
nis/nis_xdr.c
nis/nss_compat/compat-grp.c
nis/nss_compat/compat-initgroups.c
nis/nss_compat/compat-pwd.c
nis/nss_compat/compat-spwd.c
nis/nss_nis/nis-alias.c
nis/nss_nis/nis-ethers.c
nis/nss_nis/nis-grp.c
nis/nss_nis/nis-hosts.c
nis/nss_nis/nis-initgroups.c
nis/nss_nis/nis-netgrp.c
nis/nss_nis/nis-network.c
nis/nss_nis/nis-proto.c
nis/nss_nis/nis-publickey.c
nis/nss_nis/nis-pwd.c
nis/nss_nis/nis-rpc.c
nis/nss_nis/nis-service.c
nis/nss_nis/nis-spwd.c
nis/nss_nisplus/nisplus-alias.c
nis/nss_nisplus/nisplus-ethers.c
nis/nss_nisplus/nisplus-grp.c
nis/nss_nisplus/nisplus-hosts.c
nis/nss_nisplus/nisplus-initgroups.c
nis/nss_nisplus/nisplus-network.c
nis/nss_nisplus/nisplus-proto.c
nis/nss_nisplus/nisplus-pwd.c
nis/nss_nisplus/nisplus-rpc.c
nis/nss_nisplus/nisplus-service.c
nis/nss_nisplus/nisplus-spwd.c
nis/ypclnt.c
nptl/ChangeLog
nptl/allocatestack.c
nptl/cancellation.c
nptl/cleanup_defer.c
nptl/cleanup_defer_compat.c
nptl/cond-perf.c
nptl/nptl-init.c
nptl/perf.c
nptl/pthread_barrier_destroy.c
nptl/pthread_barrier_init.c
nptl/pthread_cond_timedwait.c
nptl/pthread_cond_wait.c
nptl/pthread_create.c
nptl/pthread_getattr_np.c
nptl/pthread_getspecific.c
nptl/pthread_join.c
nptl/pthread_key_delete.c
nptl/pthread_mutex_init.c
nptl/pthread_mutex_lock.c
nptl/pthread_mutex_timedlock.c
nptl/pthread_mutex_trylock.c
nptl/pthread_mutex_unlock.c
nptl/pthread_rwlock_rdlock.c
nptl/pthread_rwlock_timedrdlock.c
nptl/pthread_rwlock_timedwrlock.c
nptl/pthread_rwlock_tryrdlock.c
nptl/pthread_setcancelstate.c
nptl/pthread_setcanceltype.c
nptl/pthread_setschedprio.c
nptl/pthread_setspecific.c
nptl/sem_init.c
nptl/sem_open.c
nptl/sigaction.c
nptl/sockperf.c
nptl/sysdeps/pthread/createthread.c
nptl/sysdeps/pthread/setxid.h
nptl/sysdeps/pthread/timer_create.c
nptl/sysdeps/pthread/unwind-forcedunwind.c
nptl/sysdeps/unix/sysv/linux/getpid.c
nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
nptl/sysdeps/unix/sysv/linux/mq_notify.c
nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/pt-raise.c
nptl/sysdeps/unix/sysv/linux/pthread_kill.c
nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c
nptl/sysdeps/unix/sysv/linux/pthread_sigqueue.c
nptl/sysdeps/unix/sysv/linux/raise.c
nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c
nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c
nptl/sysdeps/unix/sysv/linux/sparc/sem_init.c
nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c
nptl/unwind.c
nscd/aicache.c
nscd/cache.c
nscd/connections.c
nscd/grpcache.c
nscd/hstcache.c
nscd/initgrcache.c
nscd/mem.c
nscd/netgroupcache.c
nscd/nscd-client.h
nscd/nscd_getai.c
nscd/nscd_getgr_r.c
nscd/nscd_gethst_r.c
nscd/nscd_getpw_r.c
nscd/nscd_getserv_r.c
nscd/nscd_helper.c
nscd/nscd_initgroups.c
nscd/nscd_netgroup.c
nscd/pwdcache.c
nscd/selinux.c
nscd/servicescache.c
nss/nss_files/files-XXX.c
posix/fnmatch.c
posix/getopt.c
posix/glob.c
posix/wordexp.c
resolv/nss_dns/dns-host.c
resolv/nss_dns/dns-network.c
resolv/res_init.c
resolv/res_mkquery.c
resolv/res_query.c
resolv/res_send.c
stdio-common/_i18n_number.h
stdio-common/perror.c
stdio-common/printf_fp.c
stdio-common/tmpnam.c
stdio-common/vfscanf.c
stdlib/cxa_finalize.c
stdlib/cxa_thread_atexit_impl.c
stdlib/drand48-iter.c
stdlib/putenv.c
stdlib/setenv.c
stdlib/strtod_l.c
stdlib/strtol_l.c
string/memmem.c
string/strerror.c
string/strnlen.c
string/test-memmem.c
sunrpc/clnt_udp.c
sunrpc/pm_getport.c
sysdeps/gnu/unwind-resume.c
sysdeps/i386/dl-irel.h
sysdeps/i386/dl-machine.h
sysdeps/ieee754/dbl-64/e_atanh.c
sysdeps/ieee754/dbl-64/e_exp2.c
sysdeps/ieee754/dbl-64/e_fmod.c
sysdeps/ieee754/dbl-64/e_gamma_r.c
sysdeps/ieee754/dbl-64/e_hypot.c
sysdeps/ieee754/dbl-64/e_j1.c
sysdeps/ieee754/dbl-64/e_jn.c
sysdeps/ieee754/dbl-64/e_log.c
sysdeps/ieee754/dbl-64/e_log10.c
sysdeps/ieee754/dbl-64/e_log2.c
sysdeps/ieee754/dbl-64/e_sinh.c
sysdeps/ieee754/dbl-64/s_asinh.c
sysdeps/ieee754/dbl-64/s_fma.c
sysdeps/ieee754/dbl-64/s_log1p.c
sysdeps/ieee754/dbl-64/s_logb.c
sysdeps/ieee754/dbl-64/s_modf.c
sysdeps/ieee754/dbl-64/s_scalbln.c
sysdeps/ieee754/dbl-64/s_scalbn.c
sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
sysdeps/ieee754/flt-32/e_atanhf.c
sysdeps/ieee754/flt-32/e_gammaf_r.c
sysdeps/ieee754/flt-32/s_logbf.c
sysdeps/ieee754/ldbl-128/s_fmal.c
sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
sysdeps/ieee754/ldbl-128ibm/s_logbl.c
sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
sysdeps/ieee754/ldbl-96/e_gammal_r.c
sysdeps/ieee754/ldbl-96/e_j0l.c
sysdeps/ieee754/ldbl-96/e_j1l.c
sysdeps/ieee754/ldbl-96/e_jnl.c
sysdeps/ieee754/ldbl-96/s_fma.c
sysdeps/ieee754/ldbl-96/s_fmal.c
sysdeps/posix/clock_getres.c
sysdeps/posix/fdopendir.c
sysdeps/posix/getaddrinfo.c
sysdeps/posix/opendir.c
sysdeps/posix/sleep.c
sysdeps/posix/tempname.c
sysdeps/powerpc/powerpc32/dl-irel.h
sysdeps/powerpc/powerpc32/dl-machine.c
sysdeps/powerpc/powerpc32/dl-machine.h
sysdeps/powerpc/powerpc64/dl-irel.h
sysdeps/powerpc/powerpc64/dl-machine.h
sysdeps/pthread/aio_notify.c
sysdeps/pthread/aio_suspend.c
sysdeps/s390/dl-irel.h
sysdeps/s390/s390-32/dl-machine.h
sysdeps/s390/s390-64/dl-machine.h
sysdeps/s390/s390-64/utf16-utf32-z9.c
sysdeps/s390/s390-64/utf8-utf16-z9.c
sysdeps/s390/s390-64/utf8-utf32-z9.c
sysdeps/sh/dl-machine.h
sysdeps/sparc/sparc32/dl-irel.h
sysdeps/sparc/sparc32/dl-machine.h
sysdeps/sparc/sparc64/dl-irel.h
sysdeps/sparc/sparc64/dl-machine.h
sysdeps/sparc/sparc64/dl-plt.h
sysdeps/unix/clock_gettime.c
sysdeps/unix/clock_settime.c
sysdeps/unix/grantpt.c
sysdeps/unix/sysv/linux/accept4.c
sysdeps/unix/sysv/linux/adjtime.c
sysdeps/unix/sysv/linux/check_pf.c
sysdeps/unix/sysv/linux/dl-osinfo.h
sysdeps/unix/sysv/linux/faccessat.c
sysdeps/unix/sysv/linux/fchmodat.c
sysdeps/unix/sysv/linux/fchownat.c
sysdeps/unix/sysv/linux/futimesat.c
sysdeps/unix/sysv/linux/fxstatat.c
sysdeps/unix/sysv/linux/fxstatat64.c
sysdeps/unix/sysv/linux/i386/fallocate.c
sysdeps/unix/sysv/linux/i386/fallocate64.c
sysdeps/unix/sysv/linux/i386/fchownat.c
sysdeps/unix/sysv/linux/i386/fxstatat.c
sysdeps/unix/sysv/linux/i386/get_clockfreq.c
sysdeps/unix/sysv/linux/i386/posix_fallocate.c
sysdeps/unix/sysv/linux/i386/posix_fallocate64.c
sysdeps/unix/sysv/linux/i386/scandir64.c
sysdeps/unix/sysv/linux/i386/sysdep.h
sysdeps/unix/sysv/linux/ifaddrs.c
sysdeps/unix/sysv/linux/linkat.c
sysdeps/unix/sysv/linux/mkdirat.c
sysdeps/unix/sysv/linux/mq_unlink.c
sysdeps/unix/sysv/linux/openat.c
sysdeps/unix/sysv/linux/posix_fallocate.c
sysdeps/unix/sysv/linux/posix_fallocate64.c
sysdeps/unix/sysv/linux/powerpc/fchownat.c
sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
sysdeps/unix/sysv/linux/readlinkat.c
sysdeps/unix/sysv/linux/recvmmsg.c
sysdeps/unix/sysv/linux/renameat.c
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
sysdeps/unix/sysv/linux/sched_setaffinity.c
sysdeps/unix/sysv/linux/sendmmsg.c
sysdeps/unix/sysv/linux/shm_open.c
sysdeps/unix/sysv/linux/sleep.c
sysdeps/unix/sysv/linux/symlinkat.c
sysdeps/unix/sysv/linux/tcgetattr.c
sysdeps/unix/sysv/linux/ttyname.c
sysdeps/unix/sysv/linux/ttyname_r.c
sysdeps/unix/sysv/linux/unlinkat.c
sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
sysdeps/unix/sysv/linux/x86_64/sysdep.h
sysdeps/unix/sysv/linux/xmknodat.c
sysdeps/x86_64/dl-irel.h
sysdeps/x86_64/dl-machine.h
time/asctime.c
time/tzfile.c
time/tzset.c
wcsmbs/mbrtoc16.c
wcsmbs/mbrtowc.c
wcsmbs/wcsmbsload.c
wcsmbs/wcsmbsload.h

index cf1b17d161826cf2dd7363898cefb762e19a3992..eadce522e85892137d1e805cb50327c5457e98b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,499 @@
+2014-02-10  Ondřej Bílka  <neleai@seznam.cz>
+
+       * assert/assert.c (__assert_fail_base): Use glibc_likely instead __builtin_expect.
+       * benchtests/bench-memmem.c (simple_memmem): Likewise.
+       * catgets/open_catalog.c (__open_catalog): Likewise.
+       * csu/libc-start.c (LIBC_START_MAIN): Likewise.
+       * debug/confstr_chk.c: Likewise.
+       * debug/fread_chk.c (__fread_chk): Likewise.
+       * debug/fread_u_chk.c (__fread_unlocked_chk): Likewise.
+       * debug/getgroups_chk.c: Likewise.
+       * debug/mbsnrtowcs_chk.c: Likewise.
+       * debug/mbsrtowcs_chk.c: Likewise.
+       * debug/mbstowcs_chk.c: Likewise.
+       * debug/memcpy_chk.c: Likewise.
+       * debug/memmove_chk.c: Likewise.
+       * debug/mempcpy_chk.c: Likewise.
+       * debug/memset_chk.c: Likewise.
+       * debug/stpcpy_chk.c (__stpcpy_chk): Likewise.
+       * debug/strcat_chk.c (__strcat_chk): Likewise.
+       * debug/strcpy_chk.c (__strcpy_chk): Likewise.
+       * debug/strncat_chk.c (__strncat_chk): Likewise.
+       * debug/vsnprintf_chk.c (___vsnprintf_chk): Likewise.
+       * debug/vswprintf_chk.c (__vswprintf_chk): Likewise.
+       * debug/wcpcpy_chk.c (__wcpcpy_chk): Likewise.
+       * debug/wcpncpy_chk.c: Likewise.
+       * debug/wcscat_chk.c (__wcscat_chk): Likewise.
+       * debug/wcscpy_chk.c (__wcscpy_chk): Likewise.
+       * debug/wcsncat_chk.c (__wcsncat_chk): Likewise.
+       * debug/wcsncpy_chk.c: Likewise.
+       * debug/wcsnrtombs_chk.c: Likewise.
+       * debug/wcsrtombs_chk.c: Likewise.
+       * debug/wcstombs_chk.c: Likewise.
+       * debug/wmemcpy_chk.c: Likewise.
+       * debug/wmemmove_chk.c: Likewise.
+       * debug/wmempcpy_chk.c: Likewise.
+       * debug/wmemset_chk.c: Likewise.
+       * dirent/scandirat.c (SCANDIRAT): Likewise.
+       * dlfcn/dladdr1.c (dladdr1): Likewise.
+       * dlfcn/dladdr.c (dladdr): Likewise.
+       * dlfcn/dlclose.c (dlclose_doit): Likewise.
+       * dlfcn/dlerror.c (__dlerror): Likewise.
+       * dlfcn/dlinfo.c (dlinfo_doit): Likewise.
+       * dlfcn/dlmopen.c (dlmopen_doit): Likewise.
+       * dlfcn/dlopen.c (dlopen_doit): Likewise.
+       * dlfcn/dlopenold.c (__dlopen_nocheck): Likewise.
+       * dlfcn/dlsym.c (dlsym_doit): Likewise.
+       * dlfcn/dlvsym.c (dlvsym_doit): Likewise.
+       * elf/dl-cache.c (_dl_load_cache_lookup): Likewise.
+       * elf/dl-close.c (remove_slotinfo, _dl_close_worker, _dl_close):
+       Likewise.
+       * elf/dl-conflict.c: Likewise.
+       * elf/dl-deps.c (_dl_build_local_scope, _dl_map_object_deps): Likewise.
+       * elf/dl-dst.h: Likewise.
+       * elf/dl-fini.c (_dl_sort_fini, _dl_fini): Likewise.
+       * elf/dl-fptr.c (_dl_make_fptr): Likewise.
+       * elf/dl-hwcaps.c (_dl_important_hwcaps): Likewise.
+       * elf/dl-init.c (call_init, _dl_init): Likewise.
+       * elf/dl-libc.c (__libc_dlopen_mode, __libc_dlsym): Likewise.
+       * elf/dl-load.c (_dl_dst_substitute, fillin_rpath, _dl_init_paths,
+       _dl_map_object_from_fd, open_verify, open_path,
+       _dl_map_object): Likewise.
+       * elf/dl-lookup.c (do_lookup_x, add_dependency, _dl_lookup_symbol_x):
+       Likewise.
+       * elf/dl-minimal.c (__libc_memalign): Likewise.
+       * elf/dl-open.c (add_to_global, dl_open_worker, _dl_open): Likewise.
+       * elf/dl-reloc.c (_dl_relocate_object): Likewise.
+       * elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Likewise.
+       * elf/dl-sym.c (do_sym): Likewise.
+       * elf/dl-tls.c (tls_get_addr_tail, update_get_addr, __tls_get_addr,
+       _dl_tls_get_addr_soft): Likewise.
+       * elf/dl-version.c (match_symbol, _dl_check_map_versions): Likewise.
+       * elf/dl-writev.h (_dl_writev): Likewise.
+       * elf/ldconfig.c (search_dir): Likewise.
+       * elf/rtld.c (_dl_start_final, _dl_start, init_tls, do_preload,
+       dl_main): Likewise.
+       * elf/setup-vdso.h (setup_vdso): Likewise.
+       * grp/compat-initgroups.c (compat_call): Likewise.
+       * grp/fgetgrent.c (fgetgrent): Likewise.
+       * grp/initgroups.c (getgrouplist, initgroups): Likewise.
+       * grp/putgrent.c (putgrent): Likewise.
+       * hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn):
+       Likewise.
+       * hurd/hurdinit.c: Likewise.
+       * iconvdata/8bit-gap.c (struct): Likewise.
+       * iconvdata/ansi_x3.110.c : Likewise.
+       * iconvdata/big5.c : Likewise.
+       * iconvdata/big5hkscs.c : Likewise.
+       * iconvdata/cp1255.c: Likewise.
+       * iconvdata/cp1258.c : Likewise.
+       * iconvdata/cp932.c : Likewise.
+       * iconvdata/euc-cn.c: Likewise.
+       * iconvdata/euc-jisx0213.c : Likewise.
+       * iconvdata/euc-jp.c: Likewise.
+       * iconvdata/euc-jp-ms.c : Likewise.
+       * iconvdata/euc-kr.c (euckr_from_ucs4): Likewise.
+       * iconvdata/gb18030.c : Likewise.
+       * iconvdata/gbbig5.c (const): Likewise.
+       * iconvdata/gbgbk.c: Likewise.
+       * iconvdata/gbk.c : Likewise.
+       * iconvdata/ibm1364.c : Likewise.
+       * iconvdata/ibm930.c : Likewise.
+       * iconvdata/ibm932.c: Likewise.
+       * iconvdata/ibm933.c : Likewise.
+       * iconvdata/ibm935.c : Likewise.
+       * iconvdata/ibm937.c : Likewise.
+       * iconvdata/ibm939.c : Likewise.
+       * iconvdata/ibm943.c: Likewise.
+       * iconvdata/iso_11548-1.c: Likewise.
+       * iconvdata/iso-2022-cn.c : Likewise.
+       * iconvdata/iso-2022-cn-ext.c : Likewise.
+       * iconvdata/iso-2022-jp-3.c: Likewise.
+       * iconvdata/iso-2022-jp.c (gconv_end): Likewise.
+       * iconvdata/iso-2022-kr.c : Likewise.
+       * iconvdata/iso646.c (gconv_end): Likewise.
+       * iconvdata/iso_6937-2.c : Likewise.
+       * iconvdata/iso_6937.c : Likewise.
+       * iconvdata/iso8859-1.c: Likewise.
+       * iconvdata/johab.c (johab_sym_hanja_to_ucs): Likewise.
+       * iconvdata/shift_jisx0213.c : Likewise.
+       * iconvdata/sjis.c : Likewise.
+       * iconvdata/t.61.c : Likewise.
+       * iconvdata/tcvn5712-1.c : Likewise.
+       * iconvdata/tscii.c: Likewise.
+       * iconvdata/uhc.c : Likewise.
+       * iconvdata/unicode.c (gconv_end): Likewise.
+       * iconvdata/utf-16.c (gconv_end): Likewise.
+       * iconvdata/utf-32.c (gconv_end): Likewise.
+       * iconvdata/utf-7.c (base64): Likewise.
+       * iconv/gconv_cache.c (__gconv_load_cache): Likewise.
+       * iconv/gconv_close.c (__gconv_close): Likewise.
+       * iconv/gconv_open.c (__gconv_open): Likewise.
+       * iconv/gconv_simple.c (internal_ucs4_loop_single, ucs4_internal_loop,
+       ucs4_internal_loop_unaligned, ucs4_internal_loop_single,
+       internal_ucs4le_loop_single, ucs4le_internal_loop,
+       ucs4le_internal_loop_unaligned, ucs4le_internal_loop_single): Likewise.
+       * iconv/iconv.c (iconv): Likewise.
+       * iconv/iconv_close.c: Likewise.
+       * iconv/loop.c (SINGLE): Likewise.
+       * iconv/skeleton.c (FUNCTION_NAME): Likewise.
+       * include/atomic.h: Likewise.
+       * inet/inet6_option.c (option_alloc): Likewise.
+       * intl/bindtextdom.c (set_binding_values): Likewise.
+       * intl/dcigettext.c (DCIGETTEXT, _nl_find_msg): Likewise.
+       * intl/loadmsgcat.c (_nl_load_domain): Likewise.
+       * intl/localealias.c (read_alias_file): Likewise.
+       * libio/filedoalloc.c (_IO_file_doallocate): Likewise.
+       * libio/fileops.c (_IO_file_open, _IO_file_underflow_mmap,
+       _IO_new_file_overflow, _IO_file_xsgetn_mmap): Likewise.
+       * libio/fmemopen.c (fmemopen): Likewise.
+       * libio/iofgets.c (_IO_fgets): Likewise.
+       * libio/iofgets_u.c (fgets_unlocked): Likewise.
+       * libio/iofgetws.c (fgetws): Likewise.
+       * libio/iofgetws_u.c (fgetws_unlocked): Likewise.
+       * libio/iogetdelim.c (_IO_getdelim): Likewise.
+       * libio/wfileops.c (_IO_wfile_underflow, _IO_wfile_underflow_mmap,
+       adjust_wide_data, _IO_wfile_seekoff): Likewise.
+       * locale/findlocale.c (_nl_find_locale): Likewise.
+       * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise.
+       * locale/loadlocale.c (_nl_intern_locale_data, _nl_load_locale):
+       Likewise.
+       * locale/setlocale.c (setlocale): Likewise.
+       * login/programs/pt_chown.c (main): Likewise.
+       * malloc/arena.c (ptmalloc_init, shrink_heap, arena_get2): Likewise.
+       * malloc/malloc.c (_int_malloc, _int_free): Likewise.
+       * malloc/memusage.c (update_data, malloc, realloc, calloc, free,
+       mmap, mmap64, mremap, munmap): Likewise.
+       * math/e_exp2l.c: Likewise.
+       * math/e_scalb.c (invalid_fn, __ieee754_scalb): Likewise.
+       * math/e_scalbf.c (invalid_fn, __ieee754_scalbf): Likewise.
+       * math/e_scalbl.c (invalid_fn, __ieee754_scalbl): Likewise.
+       * math/s_catan.c (__catan): Likewise.
+       * math/s_catanf.c (__catanf): Likewise.
+       * math/s_catanh.c (__catanh): Likewise.
+       * math/s_catanhf.c (__catanhf): Likewise.
+       * math/s_catanhl.c (__catanhl): Likewise.
+       * math/s_catanl.c (__catanl): Likewise.
+       * math/s_ccosh.c (__ccosh): Likewise.
+       * math/s_ccoshf.c (__ccoshf): Likewise.
+       * math/s_ccoshl.c (__ccoshl): Likewise.
+       * math/s_cexp.c (__cexp): Likewise.
+       * math/s_cexpf.c (__cexpf): Likewise.
+       * math/s_cexpl.c (__cexpl): Likewise.
+       * math/s_clog10.c (__clog10): Likewise.
+       * math/s_clog10f.c (__clog10f): Likewise.
+       * math/s_clog10l.c (__clog10l): Likewise.
+       * math/s_clog.c (__clog): Likewise.
+       * math/s_clogf.c (__clogf): Likewise.
+       * math/s_clogl.c (__clogl): Likewise.
+       * math/s_csin.c (__csin): Likewise.
+       * math/s_csinf.c (__csinf): Likewise.
+       * math/s_csinh.c (__csinh): Likewise.
+       * math/s_csinhf.c (__csinhf): Likewise.
+       * math/s_csinhl.c (__csinhl): Likewise.
+       * math/s_csinl.c (__csinl): Likewise.
+       * math/s_csqrt.c (__csqrt): Likewise.
+       * math/s_csqrtf.c (__csqrtf): Likewise.
+       * math/s_csqrtl.c (__csqrtl): Likewise.
+       * math/s_ctan.c (__ctan): Likewise.
+       * math/s_ctanf.c (__ctanf): Likewise.
+       * math/s_ctanh.c (__ctanh): Likewise.
+       * math/s_ctanhf.c (__ctanhf): Likewise.
+       * math/s_ctanhl.c (__ctanhl): Likewise.
+       * math/s_ctanl.c (__ctanl): Likewise.
+       * math/w_pow.c: Likewise.
+       * math/w_powf.c: Likewise.
+       * math/w_powl.c: Likewise.
+       * math/w_scalb.c (sysv_scalb): Likewise.
+       * math/w_scalbf.c (sysv_scalbf): Likewise.
+       * math/w_scalbl.c (sysv_scalbl): Likewise.
+       * misc/error.c (error_tail): Likewise.
+       * misc/pselect.c (__pselect): Likewise.
+       * nis/nis_callback.c (__nis_create_callback): Likewise.
+       * nis/nis_call.c (__nisfind_server): Likewise.
+       * nis/nis_creategroup.c (nis_creategroup): Likewise.
+       * nis/nis_domain_of_r.c (nis_domain_of_r): Likewise.
+       * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise.
+       * nis/nis_getservlist.c (nis_getservlist): Likewise.
+       * nis/nis_lookup.c (nis_lookup): Likewise.
+       * nis/nis_subr.c (nis_leaf_of_r, nis_getnames): Likewise.
+       * nis/nis_table.c (__create_ib_request, nis_list, nis_add_entry,
+       nis_modify_entry, nis_first_entry, nis_next_entry): Likewise.
+       * nis/nis_xdr.c (xdr_endpoint): Likewise.
+       * nis/nss_compat/compat-grp.c (getgrent_next_file, internal_getgrnam_r,
+       internal_getgrgid_r): Likewise.
+       * nis/nss_compat/compat-initgroups.c (add_group, internal_getgrent_r):
+       Likewise.
+       * nis/nss_compat/compat-pwd.c (getpwent_next_file, internal_getpwnam_r,
+       internal_getpwuid_r): Likewise.
+       * nis/nss_compat/compat-spwd.c (getspent_next_file,
+       internal_getspnam_r): Likewise.
+       * nis/nss_nis/nis-alias.c (internal_nis_getaliasent_r,
+       _nss_nis_getaliasbyname_r): Likewise.
+       * nis/nss_nis/nis-ethers.c (_nss_nis_gethostton_r,
+       _nss_nis_getntohost_r): Likewise.
+       * nis/nss_nis/nis-grp.c (internal_nis_setgrent,
+       internal_nis_getgrent_r, _nss_nis_getgrnam_r, _nss_nis_getgrgid_r):
+       Likewise.
+       * nis/nss_nis/nis-hosts.c (_nss_nis_sethostent,
+       internal_nis_gethostent_r, internal_gethostbyname2_r,
+       _nss_nis_gethostbyname_r, _nss_nis_gethostbyaddr_r,
+       _nss_nis_gethostbyname4_r): Likewise.
+       * nis/nss_nis/nis-initgroups.c (internal_getgrent_r,
+       initgroups_netid): Likewise.
+       * nis/nss_nis/nis-netgrp.c (_nss_nis_setnetgrent): Likewise.
+       * nis/nss_nis/nis-network.c (internal_nis_getnetent_r,
+       _nss_nis_getnetbyname_r, _nss_nis_getnetbyaddr_r): Likewise.
+       * nis/nss_nis/nis-proto.c (_nss_nis_getprotobyname_r,
+       _nss_nis_getprotobynumber_r): Likewise.
+       * nis/nss_nis/nis-publickey.c (_nss_nis_getpublickey,
+       _nss_nis_getsecretkey): Likewise.
+       * nis/nss_nis/nis-pwd.c (_nis_saveit, internal_nis_setpwent,
+       internal_nis_getpwent_r, _nss_nis_getpwnam_r, _nss_nis_getpwuid_r):
+       Likewise.
+       * nis/nss_nis/nis-rpc.c (internal_nis_getrpcent_r,
+       _nss_nis_getrpcbyname_r, _nss_nis_getrpcbynumber_r): Likewise.
+       * nis/nss_nis/nis-service.c (dosearch, internal_nis_getservent_r,
+       _nss_nis_getservbyname_r, _nss_nis_getservbyport_r): Likewise.
+       * nis/nss_nis/nis-spwd.c (_nss_nis_setspent, internal_nis_getspent_r,
+       _nss_nis_getspnam_r): Likewise.
+       * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+       Likewise.
+       * nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_gethostton_r,
+       _nss_nisplus_getntohost_r): Likewise.
+       * nis/nss_nisplus/nisplus-grp.c (internal_nisplus_getgrent_r,
+       _nss_nisplus_getgrnam_r, _nss_nisplus_getgrgid_r): Likewise.
+       * nis/nss_nisplus/nisplus-hosts.c (internal_gethostbyname2_r,
+       _nss_nisplus_gethostbyaddr_r, _nss_nisplus_gethostbyname4_r): Likewise.
+       * nis/nss_nisplus/nisplus-initgroups.c (_nss_nisplus_initgroups_dyn):
+       Likewise.
+       * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyname_r,
+       _nss_nisplus_getnetbyaddr_r): Likewise.
+       * nis/nss_nisplus/nisplus-proto.c (_nss_nisplus_getprotobyname_r,
+       _nss_nisplus_getprotobynumber_r): Likewise.
+       * nis/nss_nisplus/nisplus-pwd.c (internal_nisplus_getpwent_r,
+       _nss_nisplus_getpwnam_r, _nss_nisplus_getpwuid_r): Likewise.
+       * nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_getrpcbyname_r):
+       Likewise.
+       * nis/nss_nisplus/nisplus-service.c (internal_nisplus_getservent_r,
+       _nss_nisplus_getservbyname_r, _nss_nisplus_getservbyport_r): Likewise.
+       * nis/nss_nisplus/nisplus-spwd.c (internal_nisplus_getspent_r,
+       _nss_nisplus_getspnam_r): Likewise.
+       * nis/ypclnt.c (__yp_bind, yp_match, yp_all, yp_maplist): Likewise.
+       * nscd/aicache.c (addhstaiX): Likewise.
+       * nscd/cache.c (cache_search, prune_cache): Likewise.
+       * nscd/connections.c (register_traced_file, send_ro_fd, handle_request,
+       nscd_run_prune, nscd_run_worker, fd_ready, main_loop_epoll): Likewise.
+       * nscd/grpcache.c (addgrbyX): Likewise.
+       * nscd/hstcache.c (addhstbyX): Likewise.
+       * nscd/initgrcache.c (addinitgroupsX): Likewise.
+       * nscd/mem.c (gc, mempool_alloc): Likewise.
+       * nscd/netgroupcache.c (do_notfound, addgetnetgrentX, addinnetgrX):
+       Likewise.
+       * nscd/nscd-client.h (__nscd_acquire_maplock, __nscd_drop_map_ref):
+       Likewise.
+       * nscd/nscd_getai.c (__nscd_getai): Likewise.
+       * nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise.
+       * nscd/nscd_gethst_r.c (__nscd_get_nl_timestamp, nscd_gethst_r):
+       Likewise.
+       * nscd/nscd_getpw_r.c (nscd_getpw_r): Likewise.
+       * nscd/nscd_getserv_r.c (nscd_getserv_r): Likewise.
+       * nscd/nscd_helper.c (__readvall, open_socket,
+       __nscd_get_mapping, __nscd_get_map_ref): Likewise.
+       * nscd/nscd_initgroups.c (__nscd_getgrouplist): Likewise.
+       * nscd/nscd_netgroup.c (__nscd_setnetgrent, __nscd_innetgr): Likewise.
+       * nscd/pwdcache.c (addpwbyX): Likewise.
+       * nscd/selinux.c (preserve_capabilities): Likewise.
+       * nscd/servicescache.c (addservbyX): Likewise.
+       * nss/nss_files/files-XXX.c (internal_getent): Likewise.
+       * posix/fnmatch.c (fnmatch): Likewise.
+       * posix/getopt.c (_getopt_internal_r): Likewise.
+       * posix/glob.c (glob, glob_in_dir): Likewise.
+       * posix/wordexp.c (exec_comm_child): Likewise.
+       * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r, getanswer_r,
+       gaih_getanswer_slice): Likewise.
+       * resolv/nss_dns/dns-network.c (getanswer_r): Likewise.
+       * resolv/res_init.c: Likewise.
+       * resolv/res_mkquery.c (res_nmkquery): Likewise.
+       * resolv/res_query.c (__libc_res_nquery): Likewise.
+       * resolv/res_send.c (__libc_res_nsend, send_vc, reopen, send_dg):
+       Likewise.
+       * stdio-common/_i18n_number.h (_i18n_number_rewrite): Likewise.
+       * stdio-common/perror.c (perror): Likewise.
+       * stdio-common/printf_fp.c (___printf_fp): Likewise.
+       * stdio-common/tmpnam.c (tmpnam): Likewise.
+       * stdio-common/vfscanf.c (_IO_vfscanf_internal): Likewise.
+       * stdlib/cxa_finalize.c (__cxa_finalize): Likewise.
+       * stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl): Likewise.
+       * stdlib/drand48-iter.c (__drand48_iterate): Likewise.
+       * stdlib/putenv.c (putenv): Likewise.
+       * stdlib/setenv.c (__add_to_environ): Likewise.
+       * stdlib/strtod_l.c (____STRTOF_INTERNAL): Likewise.
+       * stdlib/strtol_l.c (INTERNAL): Likewise.
+       * string/memmem.c (memmem): Likewise.
+       * string/strerror.c (strerror): Likewise.
+       * string/strnlen.c (__strnlen): Likewise.
+       * string/test-memmem.c (simple_memmem): Likewise.
+       * sunrpc/clnt_udp.c (__libc_clntudp_bufcreate): Likewise.
+       * sunrpc/pm_getport.c (__get_socket): Likewise.
+       * sysdeps/gnu/unwind-resume.c (init, _Unwind_Resume): Likewise.
+       * sysdeps/i386/dl-irel.h (elf_irel): Likewise.
+       * sysdeps/i386/dl-machine.h (elf_machine_runtime_setup,
+       elf_machine_rel, elf_machine_lazy_rel, elf_machine_lazy_rela):
+       Likewise.
+       * sysdeps/ieee754/dbl-64/e_atanh.c (__ieee754_atanh): Likewise.
+       * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Likewise.
+       * sysdeps/ieee754/dbl-64/e_fmod.c (__ieee754_fmod): Likewise.
+       * sysdeps/ieee754/dbl-64/e_gamma_r.c (__ieee754_gamma_r): Likewise.
+       * sysdeps/ieee754/dbl-64/e_hypot.c (__ieee754_hypot): Likewise.
+       * sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_j1, __ieee754_y1): Likewise.
+       * sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_jn, __ieee754_yn): Likewise.
+       * sysdeps/ieee754/dbl-64/e_log10.c (__ieee754_log10): Likewise.
+       * sysdeps/ieee754/dbl-64/e_log2.c (__ieee754_log2): Likewise.
+       * sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Likewise.
+       * sysdeps/ieee754/dbl-64/e_sinh.c (__ieee754_sinh): Likewise.
+       * sysdeps/ieee754/dbl-64/s_asinh.c (__asinh): Likewise.
+       * sysdeps/ieee754/dbl-64/s_fma.c (__fma): Likewise.
+       * sysdeps/ieee754/dbl-64/s_log1p.c (__log1p): Likewise.
+       * sysdeps/ieee754/dbl-64/s_logb.c (__logb): Likewise.
+       * sysdeps/ieee754/dbl-64/s_modf.c (__modf): Likewise.
+       * sysdeps/ieee754/dbl-64/s_scalbln.c (__scalbln): Likewise.
+       * sysdeps/ieee754/dbl-64/s_scalbn.c (__scalbn): Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c (__ieee754_acosh):
+       Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c (__ieee754_log10):
+       Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c (__ieee754_log2):
+       Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c (__frexp): Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c (__logb): Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c (__remquo): Likewise.
+       * sysdeps/ieee754/dbl-64/wordsize-64/s_round.c (__round): Likewise.
+       * sysdeps/ieee754/flt-32/e_atanhf.c (__ieee754_atanhf): Likewise.
+       * sysdeps/ieee754/flt-32/e_gammaf_r.c (__ieee754_gammaf_r): Likewise.
+       * sysdeps/ieee754/flt-32/s_logbf.c (__logbf): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_nearbyint): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_llrintl.c (__llrintl): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_llroundl.c (__llroundl): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_logbl.c (__logbl): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_lrintl.c (__lrintl): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/s_lroundl.c (__lroundl): Likewise.
+       * sysdeps/ieee754/ldbl-128/s_fmal.c (__fmal): Likewise.
+       * sysdeps/ieee754/ldbl-96/e_gammal_r.c (__ieee754_gammal_r): Likewise.
+       * sysdeps/ieee754/ldbl-96/e_j0l.c (__ieee754_j0l, __ieee754_y0l):
+       Likewise.
+       * sysdeps/ieee754/ldbl-96/e_j1l.c (__ieee754_j1l, __ieee754_y1l):
+       Likewise.
+       * sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_jnl, __ieee754_ynl):
+       Likewise.
+       * sysdeps/ieee754/ldbl-96/s_fma.c (__fma): Likewise.
+       * sysdeps/ieee754/ldbl-96/s_fmal.c (__fmal): Likewise.
+       * sysdeps/posix/clock_getres.c (hp_timing_getres, realtime_getres):
+       Likewise.
+       * sysdeps/posix/fdopendir.c (__fdopendir): Likewise.
+       * sysdeps/posix/getaddrinfo.c (gaih_inet, getaddrinfo): Likewise.
+       * sysdeps/posix/opendir.c (__opendirat): Likewise.
+       * sysdeps/posix/sleep.c: Likewise.
+       * sysdeps/posix/tempname.c: Likewise.
+       * sysdeps/powerpc/powerpc32/dl-irel.h (elf_irela): Likewise.
+       * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
+       Likewise.
+       * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_runtime_setup,
+       elf_machine_rela): Likewise.
+       * sysdeps/powerpc/powerpc64/dl-irel.h (elf_irela): Likewise.
+       * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.
+       * sysdeps/pthread/aio_notify.c (__aio_notify_only): Likewise.
+       * sysdeps/pthread/aio_suspend.c (do_aio_misc_wait, aio_suspend):
+       Likewise.
+       * sysdeps/s390/dl-irel.h (elf_irela): Likewise.
+       * sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup,
+       elf_machine_rela, elf_machine_lazy_rel): Likewise.
+       * sysdeps/s390/s390-64/dl-machine.h (elf_machine_runtime_setup,
+       elf_machine_rela, elf_machine_lazy_rel): Likewise.
+       * sysdeps/s390/s390-64/utf16-utf32-z9.c (gconv_end): Likewise.
+       * sysdeps/s390/s390-64/utf8-utf16-z9.c (gconv_end): Likewise.
+       * sysdeps/s390/s390-64/utf8-utf32-z9.c (gconv_end): Likewise.
+       * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
+       * sysdeps/sparc/sparc32/dl-irel.h (elf_irela): Likewise.
+       * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela,
+       elf_machine_lazy_rel): Likewise.
+       * sysdeps/sparc/sparc64/dl-irel.h (elf_irela): Likewise.
+       * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela,
+       elf_machine_lazy_rel): Likewise.
+       * sysdeps/sparc/sparc64/dl-plt.h (sparc64_fixup_plt): Likewise.
+       * sysdeps/unix/clock_gettime.c (hp_timing_gettime): Likewise.
+       * sysdeps/unix/clock_settime.c (hp_timing_settime): Likewise.
+       * sysdeps/unix/grantpt.c (grantpt): Likewise.
+       * sysdeps/unix/sysv/linux/accept4.c (accept4): Likewise.
+       * sysdeps/unix/sysv/linux/adjtime.c (ADJTIME): Likewise.
+       * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): Likewise.
+       * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard):
+       Likewise.
+       * sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise.
+       * sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise.
+       * sysdeps/unix/sysv/linux/fchownat.c (fchownat): Likewise.
+       * sysdeps/unix/sysv/linux/futimesat.c (futimesat): Likewise.
+       * sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise.
+       * sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
+       * sysdeps/unix/sysv/linux/i386/fallocate64.c (fallocate64): Likewise.
+       * sysdeps/unix/sysv/linux/i386/fallocate.c (fallocate): Likewise.
+       * sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat): Likewise.
+       * sysdeps/unix/sysv/linux/i386/fxstatat.c (__fxstatat): Likewise.
+       * sysdeps/unix/sysv/linux/i386/get_clockfreq.c (__get_clockfreq):
+       Likewise.
+       * sysdeps/unix/sysv/linux/i386/posix_fallocate64.c
+       (__posix_fallocate64_l64): Likewise.
+       * sysdeps/unix/sysv/linux/i386/posix_fallocate.c
+       (posix_fallocate): Likewise.
+       * sysdeps/unix/sysv/linux/i386/scandir64.c (__old_scandir64): Likewise.
+       * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request,
+       getifaddrs_internal): Likewise.
+       * sysdeps/unix/sysv/linux/linkat.c (linkat): Likewise.
+       * sysdeps/unix/sysv/linux/mkdirat.c (mkdirat): Likewise.
+       * sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Likewise.
+       * sysdeps/unix/sysv/linux/openat.c (OPENAT_NOT_CANCEL): Likewise.
+       * sysdeps/unix/sysv/linux/posix_fallocate64.c
+       (__posix_fallocate64_l64): Likewise.
+       * sysdeps/unix/sysv/linux/posix_fallocate.c (posix_fallocate):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/fchownat.c (fchownat): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c (__get_clockfreq):
+       Likewise.
+       * sysdeps/unix/sysv/linux/readlinkat.c (readlinkat): Likewise.
+       * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Likewise.
+       * sysdeps/unix/sysv/linux/renameat.c (renameat): Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/sched_setaffinity.c: Likewise.
+       * sysdeps/unix/sysv/linux/sendmmsg.c (__sendmmsg): Likewise.
+       * sysdeps/unix/sysv/linux/shm_open.c (where_is_shmfs, shm_open):
+       Likewise.
+       * sysdeps/unix/sysv/linux/sleep.c (__sleep): Likewise.
+       * sysdeps/unix/sysv/linux/symlinkat.c (symlinkat): Likewise.
+       * sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Likewise.
+       * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Likewise.
+       * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
+       * sysdeps/unix/sysv/linux/unlinkat.c (unlinkat): Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c (__fxstatat):
+       Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
+       (posix_fallocate): Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/xmknodat.c (__xmknodat): Likewise.
+       * sysdeps/x86_64/dl-irel.h (elf_irela): Likewise.
+       * sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup,
+       elf_machine_rela, elf_machine_rela_relative, elf_machine_lazy_rel):
+       Likewise.
+       * time/asctime.c (asctime_internal): Likewise.
+       * time/tzfile.c (__tzfile_read, __tzfile_compute): Likewise.
+       * time/tzset.c (__tzset_parse_tz): Likewise.
+       * wcsmbs/mbrtoc16.c (mbrtoc16): Likewise.
+       * wcsmbs/mbrtowc.c (__mbrtowc): Likewise.
+       * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Likewise.
+       * wcsmbs/wcsmbsload.h: Likewise.
+
 2014-02-10  Ondřej Bílka  <neleai@seznam.cz>
 
        [BZ #15894]
index 2b85993e679f9b1abc3d875d57d0f0fbd8cf17de..da7356a824b7e1c459933184a226a421dd2893cc 100644 (file)
@@ -67,7 +67,7 @@ __assert_fail_base (const char *fmt, const char *assertion, const char *file,
       total = (total + 1 + GLRO(dl_pagesize) - 1) & ~(GLRO(dl_pagesize) - 1);
       struct abort_msg_s *buf = __mmap (NULL, total, PROT_READ | PROT_WRITE,
                                        MAP_ANON | MAP_PRIVATE, -1, 0);
-      if (__builtin_expect (buf != MAP_FAILED, 1))
+      if (__glibc_likely (buf != MAP_FAILED))
        {
          buf->size = total;
          strcpy (buf->msg, str);
index 6fe3bc666b5186ce97c1019b0909caaf5b9fb90b..763fb5c5da43f62f0e25bde6a9ced21c2cc2f7f1 100644 (file)
@@ -43,7 +43,7 @@ simple_memmem (const void *haystack, size_t haystack_len, const void *needle,
 
   /* Sanity check, otherwise the loop might search through the whole
      memory.  */
-  if (__builtin_expect (haystack_len < needle_len, 0))
+  if (__glibc_unlikely (haystack_len < needle_len))
     return NULL;
 
   for (begin = (const char *) haystack; begin <= last_possible; ++begin)
index bc44f98247d31816d43bc2eb80b6ac80c5826382..d582270601174de7c7f55a327634dd3782b27842 100644 (file)
@@ -54,7 +54,7 @@ __open_catalog (const char *cat_name, const char *nlspath, const char *env_var,
     {
       const char *run_nlspath = nlspath;
 #define ENOUGH(n)                                                            \
-  if (__builtin_expect (bufact + (n) >= bufmax, 0))                          \
+  if (__glibc_unlikely (bufact + (n) >= bufmax))                             \
     {                                                                        \
       char *old_buf = buf;                                                   \
       bufmax += 256 + (n);                                                   \
@@ -253,7 +253,7 @@ __open_catalog (const char *cat_name, const char *nlspath, const char *env_var,
   /* Determine whether the file is a catalog file and if yes whether
      it is written using the correct byte order.  Else we have to swap
      the values.  */
-  if (__builtin_expect (catalog->file_ptr->magic == CATGETS_MAGIC, 1))
+  if (__glibc_likely (catalog->file_ptr->magic == CATGETS_MAGIC))
     swapping = 0;
   else if (catalog->file_ptr->magic == SWAPU32 (CATGETS_MAGIC))
     swapping = 1;
index 146e16ba461727ebad59ff9885d8d4598832efb3..3b7092b359451b77b22a40b68062a1284f931d37 100644 (file)
@@ -214,7 +214,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 #endif
 
   /* Register the destructor of the dynamic linker if there is any.  */
-  if (__builtin_expect (rtld_fini != NULL, 1))
+  if (__glibc_likely (rtld_fini != NULL))
     __cxa_atexit ((void (*) (void *)) rtld_fini, NULL, NULL);
 
 #ifndef SHARED
@@ -245,7 +245,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 
 #ifdef SHARED
   /* Auditing checkpoint: we have a new object.  */
-  if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+  if (__glibc_unlikely (GLRO(dl_naudit) > 0))
     {
       struct audit_ifaces *afct = GLRO(dl_audit);
       struct link_map *head = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
@@ -260,7 +260,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 #endif
 
 #ifdef SHARED
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS))
     GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
 #endif
 
@@ -270,7 +270,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
 
   int not_first_call;
   not_first_call = setjmp ((struct __jmp_buf_tag *) unwind_buf.cancel_jmp_buf);
-  if (__builtin_expect (! not_first_call, 1))
+  if (__glibc_likely (! not_first_call))
     {
       struct pthread *self = THREAD_SELF;
 
index 4253540c5704241d14c6af35e937d7b0b40d7463..5807380faf7f1409de4fe6401c7169f65b0e929f 100644 (file)
@@ -22,7 +22,7 @@
 size_t
 __confstr_chk (int name, char *buf, size_t len, size_t buflen)
 {
-  if (__builtin_expect (buflen < len, 0))
+  if (__glibc_unlikely (buflen < len))
     __chk_fail ();
 
   return confstr (name, buf, len);
index 0f77a180299c15d6bd9523923f9809b8486a6560..44e96e868bf15cd74061b403b5f3cd7bf7499967 100644 (file)
@@ -39,7 +39,7 @@ __fread_chk (void *__restrict ptr, size_t ptrlen,
        __chk_fail ();
     }
 
-  if (__builtin_expect (bytes_requested > ptrlen, 0))
+  if (__glibc_unlikely (bytes_requested > ptrlen))
     __chk_fail ();
 
   CHECK_FILE (stream, 0);
index 6d4d9693ea0943a9777f78af20b7b95347f0551e..f8a5bdbf2ae1ad4d10018d7d9bab7f52caf01dfc 100644 (file)
@@ -39,7 +39,7 @@ __fread_unlocked_chk (void *__restrict ptr, size_t ptrlen,
        __chk_fail ();
     }
 
-  if (__builtin_expect (bytes_requested > ptrlen, 0))
+  if (__glibc_unlikely (bytes_requested > ptrlen))
     __chk_fail ();
 
   CHECK_FILE (stream, 0);
index ec5728e43e6de4d15f9ab72e66efb364a52ab03e..e4261020962c0f5240aa2ffa74f5c4f6292f821a 100644 (file)
 int
 __getgroups_chk (int size, __gid_t list[], size_t listlen)
 {
-  if (__builtin_expect (size < 0, 0))
+  if (__glibc_unlikely (size < 0))
     {
       __set_errno (EINVAL);
       return -1;
     }
 
-  if (__builtin_expect (size * sizeof (__gid_t) > listlen, 0))
+  if (__glibc_unlikely (size * sizeof (__gid_t) > listlen))
     __chk_fail ();
 
   return __getgroups (size, list);
index 4445f98fe8f4c5ed0a076fbed58c73e5f9e6bfe3..aeb1c276a5ed2b3883455361a94296b227944ca7 100644 (file)
@@ -23,7 +23,7 @@ size_t
 __mbsnrtowcs_chk (wchar_t *dst, const char **src, size_t nmc, size_t len,
                  mbstate_t *ps, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return __mbsnrtowcs (dst, src, nmc, len, ps);
index 32ff7b244314295c037e326dc38b6de4f24a8daf..a5459b94cf32c10f03928e77556046fa90a8bc8c 100644 (file)
@@ -23,7 +23,7 @@ size_t
 __mbsrtowcs_chk (wchar_t *dst, const char **src, size_t len,
                 mbstate_t *ps, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return __mbsrtowcs (dst, src, len, ps);
index 4359e194f2bbd6c7c6bbd704d41207f1847ab112..d624a79c56eb445643eb2cf8ae9803e899f6649f 100644 (file)
@@ -23,7 +23,7 @@
 size_t
 __mbstowcs_chk (wchar_t *dst, const char *src, size_t len, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   mbstate_t state;
index ab5adab6be7fa4f3442294d89aa1a39dd67ad0a7..9bf5d9f6c0b9cf3d52375ea91204e080fff878d9 100644 (file)
@@ -29,7 +29,7 @@ __memcpy_chk (dstpp, srcpp, len, dstlen)
      size_t len;
      size_t dstlen;
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return memcpy (dstpp, srcpp, len);
index aa0287384b3be2d771b15953472972c849f3adce..f8c445446297e83bde842897f4a71a8f9523e861 100644 (file)
@@ -33,7 +33,7 @@ MEMMOVE_CHK (dest, src, len, destlen)
      size_t len;
      size_t destlen;
 {
-  if (__builtin_expect (destlen < len, 0))
+  if (__glibc_unlikely (destlen < len))
     __chk_fail ();
 
   return memmove (dest, src, len);
index 87db7e1e10d3335add61761c2cdcf2388b754841..105356f978ab33ee7ba500c42830da8fc9d75379 100644 (file)
@@ -30,7 +30,7 @@ __mempcpy_chk (dstpp, srcpp, len, dstlen)
      size_t len;
      size_t dstlen;
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return __mempcpy (dstpp, srcpp, len);
index b48f740fb5cef106d7efcfb371482e03344652c7..28e7faed5eef80fd1709848a9c4dab579e2248ad 100644 (file)
@@ -25,7 +25,7 @@ __memset_chk (dstpp, c, len, dstlen)
      size_t len;
      size_t dstlen;
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return memset (dstpp, c, len);
index d7228ec91bebb49be67a0a0f98a6563331f71d86..4516137937af5f02267f5aee8eb16c2db87b85fb 100644 (file)
@@ -34,7 +34,7 @@ __stpcpy_chk (dest, src, destlen)
 
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       *d++ = *s;
     }
index e4e91d30d7d391231ca62ef1b999e091ba5c8059..653efb47be5bbbda9a083ceee92ac45354fbd630 100644 (file)
@@ -33,7 +33,7 @@ __strcat_chk (dest, src, destlen)
   /* Find the end of the string.  */
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = *s1++;
     }
@@ -46,7 +46,7 @@ __strcat_chk (dest, src, destlen)
 
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = *s2++;
       *++s1 = c;
index 92549ae71acbcb08698ef04efd63091b492ea4ee..5df98a0a4abb3a7088313c4e376c735ada73c8b8 100644 (file)
@@ -56,7 +56,7 @@ __strcpy_chk (dest, src, destlen)
 
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
         __chk_fail ();
       c = *s;
       *(s++ + off) = c;
index 955fc830c276c18ffc049ce3eee00b3fa42c0254..ff8b33f367c7f1cd19e8a5b9736629aa28efb274 100644 (file)
@@ -33,7 +33,7 @@ __strncat_chk (s1, s2, n, s1len)
   /* Find the end of S1.  */
   do
     {
-      if (__builtin_expect (s1len-- == 0, 0))
+      if (__glibc_unlikely (s1len-- == 0))
        __chk_fail ();
       c = *s1++;
     }
@@ -49,25 +49,25 @@ __strncat_chk (s1, s2, n, s1len)
       size_t n4 = n >> 2;
       do
        {
-         if (__builtin_expect (s1len-- == 0, 0))
+         if (__glibc_unlikely (s1len-- == 0))
            __chk_fail ();
          c = *s2++;
          *++s1 = c;
          if (c == '\0')
            return s;
-         if (__builtin_expect (s1len-- == 0, 0))
+         if (__glibc_unlikely (s1len-- == 0))
            __chk_fail ();
          c = *s2++;
          *++s1 = c;
          if (c == '\0')
            return s;
-         if (__builtin_expect (s1len-- == 0, 0))
+         if (__glibc_unlikely (s1len-- == 0))
            __chk_fail ();
          c = *s2++;
          *++s1 = c;
          if (c == '\0')
            return s;
-         if (__builtin_expect (s1len-- == 0, 0))
+         if (__glibc_unlikely (s1len-- == 0))
            __chk_fail ();
          c = *s2++;
          *++s1 = c;
@@ -79,7 +79,7 @@ __strncat_chk (s1, s2, n, s1len)
 
   while (n > 0)
     {
-      if (__builtin_expect (s1len-- == 0, 0))
+      if (__glibc_unlikely (s1len-- == 0))
        __chk_fail ();
       c = *s2++;
       *++s1 = c;
@@ -90,7 +90,7 @@ __strncat_chk (s1, s2, n, s1len)
 
   if (c != '\0')
     {
-      if (__builtin_expect (s1len-- == 0, 0))
+      if (__glibc_unlikely (s1len-- == 0))
        __chk_fail ();
       *++s1 = '\0';
     }
index f28d98ed473accb1bc693a8ef557e210439425a1..25631ef1a3397cd0933004228ff67c7ae312ca2e 100644 (file)
@@ -33,7 +33,7 @@ ___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
      Though, maxlen is supposed to be the size of buffer pointed
      to by s, so a conforming program can't pass such maxlen
      to *snprintf.  */
-  if (__builtin_expect (slen < maxlen, 0))
+  if (__glibc_unlikely (slen < maxlen))
     __chk_fail ();
 
   _IO_strnfile sf;
index c8e6e4455b50e1687258560b20fa486cdb7f8839..d5262dce186a7a05331dbc34acc123225dbaa8ff 100644 (file)
@@ -32,7 +32,7 @@ __vswprintf_chk (wchar_t *s, size_t maxlen, int flags, size_t slen,
      Though, maxlen is supposed to be the size of buffer pointed
      to by s, so a conforming program can't pass such maxlen
      to *snprintf.  */
-  if (__builtin_expect (slen < maxlen, 0))
+  if (__glibc_unlikely (slen < maxlen))
     __chk_fail ();
 
   _IO_wstrnfile sf;
@@ -44,7 +44,7 @@ __vswprintf_chk (wchar_t *s, size_t maxlen, int flags, size_t slen,
 
   /* We need to handle the special case where MAXLEN is 0.  Use the
      overflow buffer right from the start.  */
-  if (__builtin_expect (maxlen == 0, 0))
+  if (__glibc_unlikely (maxlen == 0))
     /* Since we have to write at least the terminating L'\0' a buffer
        length of zero always makes the function fail.  */
     return -1;
index 3972680e2e4e54e8e11ec7eb35fd92d56df2e552..aaf573cf5553bb3f2f9cd53b33a5e7069a88589c 100644 (file)
@@ -33,7 +33,7 @@ __wcpcpy_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
 
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = wcp[off];
       *++wcp = c;
index b552a2ece8177cde6bc8001aa7031a883d155c89..e03bee6ebd5838eb298ea8a91234e77dab3348d0 100644 (file)
@@ -23,7 +23,7 @@
 wchar_t *
 __wcpncpy_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
 {
-  if (__builtin_expect (destlen < n, 0))
+  if (__glibc_unlikely (destlen < n))
     __chk_fail ();
 
   /* This function is not often enough used to justify not using a
index 2ee577ce1697df8d4dc6417506f1c7b14be8d05d..1ad8c746bd38b6456d2ef04f6598250ec68d1756 100644 (file)
@@ -30,7 +30,7 @@ __wcscat_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
   /* Find the end of the string.  */
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = *s1++;
     }
@@ -43,7 +43,7 @@ __wcscat_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
 
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = *s2++;
       *++s1 = c;
index c64a9f67d20ce3b82cd8e67b12ea44f620475ab9..3164e401cb9a2adb6f8a8e5641016a9c11508810 100644 (file)
@@ -35,7 +35,7 @@ __wcscpy_chk (wchar_t *dest, const wchar_t *src, size_t n)
 
       do
        {
-         if (__builtin_expect (n-- == 0, 0))
+         if (__glibc_unlikely (n-- == 0))
            __chk_fail ();
          c = *wcp++;
          wcp[off] = c;
@@ -48,7 +48,7 @@ __wcscpy_chk (wchar_t *dest, const wchar_t *src, size_t n)
 
       do
        {
-         if (__builtin_expect (n-- == 0, 0))
+         if (__glibc_unlikely (n-- == 0))
            __chk_fail ();
          c = *src++;
          *wcp++ = c;
index 0de4e11d63485abcb998f3c7e4f7aed056b37f5b..ec990248fb452eca87196270fd2ab9e707a9a266 100644 (file)
@@ -29,7 +29,7 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
   /* Find the end of DEST.  */
   do
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = *dest++;
     }
@@ -45,25 +45,25 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
       size_t n4 = n >> 2;
       do
        {
-         if (__builtin_expect (destlen-- == 0, 0))
+         if (__glibc_unlikely (destlen-- == 0))
            __chk_fail ();
          c = *src++;
          *++dest = c;
          if (c == L'\0')
            return s;
-         if (__builtin_expect (destlen-- == 0, 0))
+         if (__glibc_unlikely (destlen-- == 0))
            __chk_fail ();
          c = *src++;
          *++dest = c;
          if (c == L'\0')
            return s;
-         if (__builtin_expect (destlen-- == 0, 0))
+         if (__glibc_unlikely (destlen-- == 0))
            __chk_fail ();
          c = *src++;
          *++dest = c;
          if (c == L'\0')
            return s;
-         if (__builtin_expect (destlen-- == 0, 0))
+         if (__glibc_unlikely (destlen-- == 0))
            __chk_fail ();
          c = *src++;
          *++dest = c;
@@ -75,7 +75,7 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
 
   while (n > 0)
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       c = *src++;
       *++dest = c;
@@ -86,7 +86,7 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
 
   if (c != L'\0')
     {
-      if (__builtin_expect (destlen-- == 0, 0))
+      if (__glibc_unlikely (destlen-- == 0))
        __chk_fail ();
       *++dest = L'\0';
     }
index abecabf0da59203308a9d258e7f0eb2e4f0ade05..3eac236a4f26097fd1491d9ff13d5ad482c163d8 100644 (file)
@@ -23,7 +23,7 @@
 wchar_t *
 __wcsncpy_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
 {
-  if (__builtin_expect (destlen < n, 0))
+  if (__glibc_unlikely (destlen < n))
     __chk_fail ();
 
   /* This function is not often enough used to justify not using a
index 122cd4b7f8b2b4083ac5fcdbbf560898edbbbf87..f8bde89da6818ba950e5a5ac24dacd2c807d32f7 100644 (file)
@@ -23,7 +23,7 @@ size_t
 __wcsnrtombs_chk (char *dst, const wchar_t **src, size_t nwc, size_t len,
                  mbstate_t *ps, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return __wcsnrtombs (dst, src, nwc, len, ps);
index 48ae91df41774c8b56e606ad39cbb79a13b6054f..9d8ea5d8c29bef5192eb4295b437b70ac43b2ae4 100644 (file)
@@ -23,7 +23,7 @@ size_t
 __wcsrtombs_chk (char *dst, const wchar_t **src, size_t len,
                 mbstate_t *ps, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   return __wcsrtombs (dst, src, len, ps);
index f704cdc3effdfd6ec148479daa1f3dda68af6239..cb7ed9a5ff722358776563ffa786cfe2726fa585 100644 (file)
@@ -23,7 +23,7 @@
 size_t
 __wcstombs_chk (char *dst, const wchar_t *src, size_t len, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < len, 0))
+  if (__glibc_unlikely (dstlen < len))
     __chk_fail ();
 
   mbstate_t state;
index daeb44e037753373528d69e6465940da908e685b..40c7d0b02af70ae2caa0ca96df30750707a5c0ae 100644 (file)
@@ -23,7 +23,7 @@
 wchar_t *
 __wmemcpy_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
 {
-  if (__builtin_expect (ns1 < n, 0))
+  if (__glibc_unlikely (ns1 < n))
     __chk_fail ();
   return (wchar_t *) memcpy ((char *) s1, (char *) s2, n * sizeof (wchar_t));
 }
index 59462cda3bf043bae9dc5273f0d0155ee39eb6ac..c82b4d0d23dcc5c480691248421c0406e61a20e7 100644 (file)
@@ -23,7 +23,7 @@
 wchar_t *
 __wmemmove_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
 {
-  if (__builtin_expect (ns1 < n, 0))
+  if (__glibc_unlikely (ns1 < n))
     __chk_fail ();
   return (wchar_t *) memmove ((char *) s1, (char *) s2, n * sizeof (wchar_t));
 }
index 10be83c68c9a4ab06971fdc5c6486bc4423a78b2..cb62ab9478e0c8c209d6924b3a935ac1ecb01181 100644 (file)
@@ -23,7 +23,7 @@
 wchar_t *
 __wmempcpy_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
 {
-  if (__builtin_expect (ns1 < n, 0))
+  if (__glibc_unlikely (ns1 < n))
     __chk_fail ();
   return (wchar_t *) __mempcpy ((char *) s1, (char *) s2,
                                n * sizeof (wchar_t));
index 4caabbe420e17f896c2d43bd4863948b0aa5abf2..025b3c14d235d4e1f706b08d1c4321cc14831fd0 100644 (file)
@@ -22,7 +22,7 @@
 wchar_t *
 __wmemset_chk (wchar_t *s, wchar_t c, size_t n, size_t dstlen)
 {
-  if (__builtin_expect (dstlen < n, 0))
+  if (__glibc_unlikely (dstlen < n))
     __chk_fail ();
 
   return wmemset (s, c, n);
index 1076f28d26b68a71bf09f1dae6aa1e07135b7391..01fc046864e501370a72b909372b243893eb0bb0 100644 (file)
@@ -98,7 +98,7 @@ SCANDIRAT (dfd, dir, namelist, select, cmp)
          /* Ignore errors from select or readdir */
          __set_errno (0);
 
-         if (__builtin_expect (c.cnt == vsize, 0))
+         if (__glibc_unlikely (c.cnt == vsize))
            {
              DIRENT_TYPE **new;
              if (vsize == 0)
index 2b93cec2103af55abc8694bf7a5f2ed937f80c2c..922ca44daea38466335d9798e0e0197507440d18 100644 (file)
@@ -32,7 +32,7 @@ int
 __dladdr (const void *address, Dl_info *info)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dladdr (address, info);
 # endif
   return _dl_addr (address, info, NULL, NULL);
index a8f10beed3efc8f88fe2a3b3a2f1bb3784db9e93..0efc0dcd3d98747c82e32be7d97cdb1bbcee8fb1 100644 (file)
@@ -32,7 +32,7 @@ int
 __dladdr1 (const void *address, Dl_info *info, void **extra, int flags)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dladdr1 (address, info, extra, flags);
 # endif
 
index 8b5decc46c8d3938e1b52bb3c46f1a1431f91c28..ca55b5f293be7681897f3ca03ca80c979f1176ba 100644 (file)
@@ -39,7 +39,7 @@ int
 __dlclose (void *handle)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlclose (handle);
 # endif
 
index d9bbecf49552157711f71ee3df9314f1d62609fc..6dd47a7eaf76792324fc955ce76c72c1ddbcfaa7 100644 (file)
@@ -63,7 +63,7 @@ __dlerror (void)
   struct dl_action_result *result;
 
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlerror ();
 # endif
 
index f2527fee72f59cf1ffb443f8e34f2fc5d9f3e18c..1876d9dfe7ac6ec84c9f116e5acd043b879dffb6 100644 (file)
@@ -111,7 +111,7 @@ int
 __dlinfo (void *handle, int request, void *arg DL_CALLER_DECL)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlinfo (handle, request, arg,
                                DL_CALLER);
 # endif
index 1e2cbcfdb492752f327fe61884501a185679e4d0..115f6e9e28416903f1509a5f4e43f6bbe07182dc 100644 (file)
@@ -64,7 +64,7 @@ dlmopen_doit (void *a)
 
       /* It makes no sense to use RTLD_GLOBAL when loading a DSO into
         a namespace other than the base namespace.  */
-      if (__builtin_expect (args->mode & RTLD_GLOBAL, 0))
+      if (__glibc_unlikely (args->mode & RTLD_GLOBAL))
        GLRO(dl_signal_error) (EINVAL, NULL, NULL, N_("invalid mode"));
     }
 
@@ -79,7 +79,7 @@ void *
 __dlmopen (Lmid_t nsid, const char *file, int mode DL_CALLER_DECL)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlmopen (nsid, file, mode, RETURN_ADDRESS (0));
 # endif
 
index 2db6610a77e6bf432a02f5274478cbd95f98cd2b..fa58c4cebff4bc5d2f087b216a6d2c15b1ffa64b 100644 (file)
@@ -74,7 +74,7 @@ void *
 __dlopen (const char *file, int mode DL_CALLER_DECL)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlopen (file, mode, DL_CALLER);
 # endif
 
index 6d3a430cf68a6ea6a1b9d31c4b0aa020b30b1e87..67fac16d1dfd2a34f0894a2f8efa4c9b74aaa92d 100644 (file)
@@ -70,7 +70,7 @@ __dlopen_nocheck (const char *file, int mode)
     mode |= RTLD_LAZY;
   args.mode = mode;
 
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlopen (file, mode, RETURN_ADDRESS (0));
 
   return _dlerror_run (dlopen_doit, &args) ? NULL : args.new;
index a1e2e01775411e4c7fa9a8c64b399533a98d37fb..7bcc78d50edf3f65ad7c6ad24cbcd122a03d2927 100644 (file)
@@ -55,7 +55,7 @@ void *
 __dlsym (void *handle, const char *name DL_CALLER_DECL)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlsym (handle, name, DL_CALLER);
 # endif
 
index 5d05d979639a65295e91639068f2815757af0aca..d7a766b283935a5e31cf0c35cc5ece2934d1c398 100644 (file)
@@ -58,7 +58,7 @@ __dlvsym (void *handle, const char *name, const char *version_str
          DL_CALLER_DECL)
 {
 # ifdef SHARED
-  if (__builtin_expect (_dlfcn_hook != NULL, 0))
+  if (__glibc_unlikely (_dlfcn_hook != NULL))
     return _dlfcn_hook->dlvsym (handle, name, version_str, DL_CALLER);
 # endif
 
index d36623f09e87f98d0c548f63b24b68ab0f17d0c1..91fef9578e1e509693aad0d31ebc5bdcf0cb9a24 100644 (file)
@@ -65,7 +65,7 @@ do                                                                          \
                                                                              \
        /* Actually compare the entry with the key.  */                       \
        cmpres = _dl_cache_libcmp (name, cache_data + key);                   \
-       if (__builtin_expect (cmpres == 0, 0))                                \
+       if (__glibc_unlikely (cmpres == 0))                                   \
          {                                                                   \
            /* Found it.  LEFT now marks the last entry for which we          \
               know the name is correct.  */                                  \
@@ -187,7 +187,7 @@ _dl_load_cache_lookup (const char *name)
   const char *best;
 
   /* Print a message if the loading of libs is traced.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
     _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
 
   if (cache == NULL)
index 5bf1de7d280f3ac541de1b258340bf259a7ffb2d..f36ea0f779a2d8a23eaf05819fd44279d9bb628e 100644 (file)
@@ -73,7 +73,7 @@ remove_slotinfo (size_t idx, struct dtv_slotinfo_list *listp, size_t disp,
 
       /* The entry might still be in its unused state if we are closing an
         object that wasn't fully set up.  */
-      if (__builtin_expect (old_map != NULL, 1))
+      if (__glibc_likely (old_map != NULL))
        {
          assert (old_map->l_tls_modid == idx);
 
@@ -123,7 +123,7 @@ _dl_close_worker (struct link_map *map)
        dl_close_state = rerun;
 
       /* There are still references to this object.  Do nothing more.  */
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
        _dl_debug_printf ("\nclosing file=%s; direct_opencount=%u\n",
                          map->l_name, map->l_direct_opencount);
 
@@ -280,7 +280,7 @@ _dl_close_worker (struct link_map *map)
 
 #ifdef SHARED
          /* Auditing checkpoint: we remove an object.  */
-         if (__builtin_expect (do_audit, 0))
+         if (__glibc_unlikely (do_audit))
            {
              struct audit_ifaces *afct = GLRO(dl_audit);
              for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
@@ -452,7 +452,7 @@ _dl_close_worker (struct link_map *map)
 
 #ifdef SHARED
   /* Auditing checkpoint: we will start deleting objects.  */
-  if (__builtin_expect (do_audit, 0))
+  if (__glibc_unlikely (do_audit))
     {
       struct link_map *head = ns->_ns_loaded;
       struct audit_ifaces *afct = GLRO(dl_audit);
@@ -536,7 +536,7 @@ _dl_close_worker (struct link_map *map)
             object.  We can unmap it.  */
 
          /* Remove the object from the dtv slotinfo array if it uses TLS.  */
-         if (__builtin_expect (imap->l_tls_blocksize > 0, 0))
+         if (__glibc_unlikely (imap->l_tls_blocksize > 0))
            {
              any_tls = true;
 
@@ -662,7 +662,7 @@ _dl_close_worker (struct link_map *map)
          free (imap->l_reldeps);
 
          /* Print debugging message.  */
-         if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+         if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
            _dl_debug_printf ("\nfile=%s [%lu];  destroying link map\n",
                              imap->l_name, imap->l_ns);
 
@@ -704,7 +704,7 @@ _dl_close_worker (struct link_map *map)
   /* If we removed any object which uses TLS bump the generation counter.  */
   if (any_tls)
     {
-      if (__builtin_expect (++GL(dl_tls_generation) == 0, 0))
+      if (__glibc_unlikely (++GL(dl_tls_generation) == 0))
        _dl_fatal_printf ("TLS generation counter wrapped!  Please report as described in "REPORT_BUGS_TO".\n");
 
       if (tls_free_end == GL(dl_tls_static_used))
@@ -713,7 +713,7 @@ _dl_close_worker (struct link_map *map)
 
 #ifdef SHARED
   /* Auditing checkpoint: we have deleted all objects.  */
-  if (__builtin_expect (do_audit, 0))
+  if (__glibc_unlikely (do_audit))
     {
       struct link_map *head = ns->_ns_loaded;
       /* Do not call the functions for any auditing object.  */
@@ -757,7 +757,7 @@ _dl_close (void *_map)
   struct link_map *map = _map;
 
   /* First see whether we can remove the object at all.  */
-  if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0))
+  if (__glibc_unlikely (map->l_flags_1 & DF_1_NODELETE))
     {
       assert (map->l_init_called);
       /* Nope.  Do nothing.  */
index 8034077567dcf5ab348e609fa1c9da37ba10a31b..d0f25e34368cdd0ecb5010c55f545b3dbcd48ba7 100644 (file)
@@ -32,7 +32,7 @@ _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
                       ElfW(Rela) *conflictend)
 {
 #if ! ELF_MACHINE_NO_RELA
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_RELOC, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_RELOC))
     _dl_debug_printf ("\nconflict processing: %s\n", DSO_FILENAME (l->l_name));
 
   {
index 20c294e5b889dda30204a69e4a2ba39ec8dcc755..9c83c8177955f9caada4bbd36eadfae82c10ebfa 100644 (file)
@@ -127,7 +127,7 @@ empty dynamic string token substitution"));                               \
            else                                                              \
              {                                                               \
                /* This is for DT_AUXILIARY.  */                              \
-               if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))\
+               if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))   \
                  _dl_debug_printf (N_("\
 cannot load auxiliary `%s' because of empty dynamic string token "           \
                                            "substitution\n"), __str);        \
@@ -253,7 +253,7 @@ _dl_map_object_deps (struct link_map *map,
                bool malloced;
                int err = _dl_catch_error (&objname, &errstring, &malloced,
                                           openaux, &args);
-               if (__builtin_expect (errstring != NULL, 0))
+               if (__glibc_unlikely (errstring != NULL))
                  {
                    char *new_errstring = strdupa (errstring);
                    objname = strdupa (objname);
@@ -317,7 +317,7 @@ _dl_map_object_deps (struct link_map *map,
                    bool malloced;
                    (void) _dl_catch_error (&objname, &errstring, &malloced,
                                            openaux, &args);
-                   if (__builtin_expect (errstring != NULL, 0))
+                   if (__glibc_unlikely (errstring != NULL))
                      {
                        /* We are not interested in the error message.  */
                        assert (errstring != NULL);
@@ -342,7 +342,7 @@ _dl_map_object_deps (struct link_map *map,
                    bool malloced;
                    int err = _dl_catch_error (&objname, &errstring, &malloced,
                                               openaux, &args);
-                   if (__builtin_expect (errstring != NULL, 0))
+                   if (__glibc_unlikely (errstring != NULL))
                      {
                        char *new_errstring = strdupa (errstring);
                        objname = strdupa (objname);
@@ -622,7 +622,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
      itself will always be initialize last.  */
   memcpy (l_initfini, map->l_searchlist.r_list,
          nlist * sizeof (struct link_map *));
-  if (__builtin_expect (nlist > 1, 1))
+  if (__glibc_likely (nlist > 1))
     {
       /* We can skip looking for the binary itself which is at the front
         of the search list.  */
@@ -645,7 +645,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
              if (runp != NULL)
                /* Look through the dependencies of the object.  */
                while (*runp != NULL)
-                 if (__builtin_expect (*runp++ == thisp, 0))
+                 if (__glibc_unlikely (*runp++ == thisp))
                    {
                      /* Move the current object to the back past the last
                         object with it as the dependency.  */
index a00e9215833bdac12f499bce1bab420193864d66..cbc59d42dd3972c1f63014f3bb209337bfcaf540 100644 (file)
@@ -25,7 +25,7 @@
     size_t __cnt = 0;                                                        \
     const char *__sf = strchr (name, '$');                                   \
                                                                              \
-    if (__builtin_expect (__sf != NULL, 0))                                  \
+    if (__glibc_unlikely (__sf != NULL))                                     \
       __cnt = _dl_dst_count (__sf, is_path);                         \
                                                                              \
     __cnt; })
index 05bbd68aee9197237182c6c94b83b008a53b4f30..c35577565eb66ac241365c05efe7c7fb791e0df2 100644 (file)
@@ -60,7 +60,7 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
          if (runp != NULL)
            /* Look through the dependencies of the object.  */
            while (*runp != NULL)
-             if (__builtin_expect (*runp++ == thisp, 0))
+             if (__glibc_unlikely (*runp++ == thisp))
                {
                move:
                  /* Move the current object to the back past the last
@@ -90,21 +90,21 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
                  goto next;
                }
 
-         if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
+         if (__glibc_unlikely (maps[k]->l_reldeps != NULL))
            {
              unsigned int m = maps[k]->l_reldeps->act;
              struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
 
              /* Look through the relocation dependencies of the object.  */
              while (m-- > 0)
-               if (__builtin_expect (relmaps[m] == thisp, 0))
+               if (__glibc_unlikely (relmaps[m] == thisp))
                  {
                    /* If a cycle exists with a link time dependency,
                       preserve the latter.  */
                    struct link_map **runp = thisp->l_initfini;
                    if (runp != NULL)
                      while (*runp != NULL)
-                       if (__builtin_expect (*runp++ == maps[k], 0))
+                       if (__glibc_unlikely (*runp++ == maps[k]))
                          goto ignore;
                    goto move;
                  }
@@ -286,7 +286,7 @@ _dl_fini (void)
       goto again;
     }
 
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS))
     _dl_debug_printf ("\nruntime linker statistics:\n"
                      "           final number of relocations: %lu\n"
                      "final number of relocations from cache: %lu\n",
index 8088db3d4fc19412a99f57d6c016965aff0bbca4..40cb40a3f1143b0ca76d95ab7691ed1e605341c6 100644 (file)
@@ -209,7 +209,7 @@ _dl_make_fptr (struct link_map *map, const ElfW(Sym) *sym,
   Elf_Symndx symidx;
   struct local *l;
 
-  if (__builtin_expect (ftab == NULL, 0))
+  if (__glibc_unlikely (ftab == NULL))
     ftab = make_fptr_table (map);
 
   symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
index 86d9e9cd6dcd551aa716fd1a5e6a6d959d3ed7d4..e7c60f2fbfb004309945d13b566daa39d8617fb2 100644 (file)
@@ -133,7 +133,7 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
          len = strlen (p);
 
          /* Skip entries that are not enabled in the mask word.  */
-         if (__builtin_expect (mask & ((ElfW(Word)) 1 << bit), 1))
+         if (__glibc_likely (mask & ((ElfW(Word)) 1 << bit)))
            {
              temp[m].str = p;
              temp[m].len = len;
index 28a6ff6d8ac2fe0c835b09513f3ad903f7263fba..598df3b4aad5d01ccaf1967e439f979ad29c7094 100644 (file)
@@ -52,7 +52,7 @@ call_init (struct link_map *l, int argc, char **argv, char **env)
     return;
 
   /* Print a debug message if wanted.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS))
     _dl_debug_printf ("\ncalling init: %s\n\n",
                      DSO_FILENAME (l->l_name));
 
@@ -88,7 +88,7 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
   ElfW(Dyn) *preinit_array_size = main_map->l_info[DT_PREINIT_ARRAYSZ];
   unsigned int i;
 
-  if (__builtin_expect (GL(dl_initfirst) != NULL, 0))
+  if (__glibc_unlikely (GL(dl_initfirst) != NULL))
     {
       call_init (GL(dl_initfirst), argc, argv, env);
       GL(dl_initfirst) = NULL;
@@ -102,7 +102,7 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
       ElfW(Addr) *addrs;
       unsigned int cnt;
 
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS))
        _dl_debug_printf ("\ncalling preinit: %s\n\n",
                          DSO_FILENAME (main_map->l_name));
 
index ceac3caeb27a0ff33b868ae69a462442c3650c07..6d1e9819dcbf69a058398f98b92d8f1090559985 100644 (file)
@@ -158,7 +158,7 @@ __libc_dlopen_mode (const char *name, int mode)
   args.caller_dlopen = RETURN_ADDRESS (0);
 
 #ifdef SHARED
-  if (__builtin_expect (_dl_open_hook != NULL, 0))
+  if (__glibc_unlikely (_dl_open_hook != NULL))
     return _dl_open_hook->dlopen_mode (name, mode);
   return (dlerror_run (do_dlopen, &args) ? NULL : (void *) args.map);
 #else
@@ -204,7 +204,7 @@ __libc_dlsym (void *map, const char *name)
   args.name = name;
 
 #ifdef SHARED
-  if (__builtin_expect (_dl_open_hook != NULL, 0))
+  if (__glibc_unlikely (_dl_open_hook != NULL))
     return _dl_open_hook->dlsym (map, name);
 #endif
   return (dlerror_run (do_dlsym, &args) ? NULL
@@ -216,7 +216,7 @@ int
 __libc_dlclose (void *map)
 {
 #ifdef SHARED
-  if (__builtin_expect (_dl_open_hook != NULL, 0))
+  if (__glibc_unlikely (_dl_open_hook != NULL))
     return _dl_open_hook->dlclose (map);
 #endif
   return dlerror_run (do_dlclose, map);
index 1be7a3ca967d2c7d463583bd9f1ced036b3c075a..6501ff2dca2afb7e474d5204d2b3042709eaca4b 100644 (file)
@@ -333,7 +333,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
 
   do
     {
-      if (__builtin_expect (*name == '$', 0))
+      if (__glibc_unlikely (*name == '$'))
        {
          const char *repl = NULL;
          size_t len;
@@ -565,7 +565,7 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
            dirp->status[cnt] = init_val;
 
          dirp->what = what;
-         if (__builtin_expect (where != NULL, 1))
+         if (__glibc_likely (where != NULL))
            dirp->where = memcpy ((char *) dirp + sizeof (*dirp) + len + 1
                                  + (ncapstr * sizeof (enum r_dir_status)),
                                  where, where_len);
@@ -836,7 +836,7 @@ _dl_init_paths (const char *llp)
 #ifdef SHARED
       /* Expand DSTs.  */
       size_t cnt = DL_DST_COUNT (llp, 1);
-      if (__builtin_expect (cnt == 0, 1))
+      if (__glibc_likely (cnt == 0))
        llp_tmp = strdupa (llp);
       else
        {
@@ -935,7 +935,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
   bool make_consistent = false;
 
   /* Get file information.  */
-  if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st) < 0, 0))
+  if (__glibc_unlikely (__fxstat64 (_STAT_VER, fd, &st) < 0))
     {
       errstring = N_("cannot stat shared object");
     call_lose_errno:
@@ -999,7 +999,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
     }
 
   /* Print debugging message.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
     _dl_debug_printf ("file=%s [%lu];  generating link map\n", name, nsid);
 
   /* This is the ELF header.  We read it in `open_verify'.  */
@@ -1057,7 +1057,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
 
   /* Enter the new object in the list of loaded objects.  */
   l = _dl_new_object (realname, name, l_type, loader, mode, nsid);
-  if (__builtin_expect (l == NULL, 0))
+  if (__glibc_unlikely (l == NULL))
     {
 #ifdef SHARED
     fail_new:
@@ -1226,7 +1226,7 @@ cannot allocate TLS data structures for initial thread");
 
              /* Now we install the TCB in the thread register.  */
              errstring = TLS_INIT_TP (tcb, 0);
-             if (__builtin_expect (errstring == NULL, 1))
+             if (__glibc_likely (errstring == NULL))
                {
                  /* Now we are all good.  */
                  l->l_tls_modid = ++GL(dl_tls_max_dtv_idx);
@@ -1256,7 +1256,7 @@ cannot allocate TLS data structures for initial thread");
          break;
        }
 
-    if (__builtin_expect (nloadcmds == 0, 0))
+    if (__glibc_unlikely (nloadcmds == 0))
       {
        /* This only happens for a bogus object that will be caught with
           another error below.  But we don't want to go through the
@@ -1294,7 +1294,7 @@ cannot allocate TLS data structures for initial thread");
                                              c->prot,
                                              MAP_COPY|MAP_FILE,
                                              fd, c->mapoff);
-       if (__builtin_expect ((void *) l->l_map_start == MAP_FAILED, 0))
+       if (__glibc_unlikely ((void *) l->l_map_start == MAP_FAILED))
          {
          map_error:
            errstring = N_("failed to map segment from shared object");
@@ -1321,7 +1321,7 @@ cannot allocate TLS data structures for initial thread");
 
     /* This object is loaded at a fixed address.  This must never
        happen for objects loaded with dlopen().  */
-    if (__builtin_expect ((mode & __RTLD_OPENEXEC) == 0, 0))
+    if (__glibc_unlikely ((mode & __RTLD_OPENEXEC) == 0))
       {
        errstring = N_("cannot dynamically load executable");
        goto call_lose;
@@ -1379,7 +1379,7 @@ cannot allocate TLS data structures for initial thread");
            if (zeropage > zero)
              {
                /* Zero the final part of the last page of the segment.  */
-               if (__builtin_expect ((c->prot & PROT_WRITE) == 0, 0))
+               if (__glibc_unlikely ((c->prot & PROT_WRITE) == 0))
                  {
                    /* Dag nab it.  */
                    if (__mprotect ((caddr_t) (zero
@@ -1391,7 +1391,7 @@ cannot allocate TLS data structures for initial thread");
                      }
                  }
                memset ((void *) zero, '\0', zeropage - zero);
-               if (__builtin_expect ((c->prot & PROT_WRITE) == 0, 0))
+               if (__glibc_unlikely ((c->prot & PROT_WRITE) == 0))
                  __mprotect ((caddr_t) (zero & ~(GLRO(dl_pagesize) - 1)),
                              GLRO(dl_pagesize), c->prot);
              }
@@ -1403,7 +1403,7 @@ cannot allocate TLS data structures for initial thread");
                mapat = __mmap ((caddr_t) zeropage, zeroend - zeropage,
                                c->prot, MAP_ANON|MAP_PRIVATE|MAP_FIXED,
                                -1, 0);
-               if (__builtin_expect (mapat == MAP_FAILED, 0))
+               if (__glibc_unlikely (mapat == MAP_FAILED))
                  {
                    errstring = N_("cannot map zero-fill pages");
                    goto call_lose_errno;
@@ -1417,7 +1417,7 @@ cannot allocate TLS data structures for initial thread");
 
   if (l->l_ld == 0)
     {
-      if (__builtin_expect (type == ET_DYN, 0))
+      if (__glibc_unlikely (type == ET_DYN))
        {
          errstring = N_("object file has no dynamic section");
          goto call_lose;
@@ -1467,7 +1467,7 @@ cannot allocate TLS data structures for initial thread");
     /* Adjust the PT_PHDR value by the runtime load address.  */
     l->l_phdr = (ElfW(Phdr) *) ((ElfW(Addr)) l->l_phdr + l->l_addr);
 
-  if (__builtin_expect ((stack_flags &~ GL(dl_stack_flags)) & PF_X, 0))
+  if (__glibc_unlikely ((stack_flags &~ GL(dl_stack_flags)) & PF_X))
     {
       if (__builtin_expect (__check_caller (RETURN_ADDRESS (0), allow_ldso),
                            0) != 0)
@@ -1490,7 +1490,7 @@ cannot allocate TLS data structures for initial thread");
          const uintptr_t relro_end = ((m->l_addr + m->l_relro_addr
                                        + m->l_relro_size)
                                       & -GLRO(dl_pagesize));
-         if (__builtin_expect (p + s <= relro_end, 1))
+         if (__glibc_likely (p + s <= relro_end))
            {
              /* The variable lies in the region protected by RELRO.  */
              if (__mprotect ((void *) p, s, PROT_READ|PROT_WRITE) < 0)
@@ -1526,7 +1526,7 @@ cannot enable executable stack as shared object requires");
     l->l_tls_initimage = (char *) l->l_tls_initimage + l->l_addr;
 
   /* We are done mapping in the file.  We no longer need the descriptor.  */
-  if (__builtin_expect (__close (fd) != 0, 0))
+  if (__glibc_unlikely (__close (fd) != 0))
     {
       errstring = N_("cannot close file descriptor");
       goto call_lose_errno;
@@ -1539,7 +1539,7 @@ cannot enable executable stack as shared object requires");
 
   l->l_entry += l->l_addr;
 
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
     _dl_debug_printf ("\
   dynamic: 0x%0*lx  base: 0x%0*lx   size: 0x%0*Zx\n\
     entry: 0x%0*lx  phdr: 0x%0*lx  phnum:   %*u\n\n",
@@ -1754,7 +1754,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
       ehdr = (ElfW(Ehdr) *) fbp->buf;
 
       /* Now run the tests.  */
-      if (__builtin_expect (fbp->len < (ssize_t) sizeof (ElfW(Ehdr)), 0))
+      if (__glibc_unlikely (fbp->len < (ssize_t) sizeof (ElfW(Ehdr))))
        {
          errval = errno;
          errstring = (errval == 0
@@ -1939,7 +1939,7 @@ open_path (const char *name, size_t namelen, int secure,
   const char *current_what = NULL;
   int any = 0;
 
-  if (__builtin_expect (dirs == NULL, 0))
+  if (__glibc_unlikely (dirs == NULL))
     /* We're called before _dl_init_paths when loading the main executable
        given on the command line when rtld is run directly.  */
     return -1;
@@ -1977,7 +1977,7 @@ open_path (const char *name, size_t namelen, int secure,
             - buf);
 
          /* Print name we try if this is wanted.  */
-         if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
+         if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
            _dl_debug_printf ("  trying file=%s\n", buf);
 
          fd = open_verify (buf, fbp, loader, whatcode, found_other_class,
@@ -2059,7 +2059,7 @@ open_path (const char *name, size_t namelen, int secure,
   while (*++dirs != NULL);
 
   /* Remove the whole path if none of the directories exists.  */
-  if (__builtin_expect (! any, 0))
+  if (__glibc_unlikely (! any))
     {
       /* Paths which were allocated using the minimal malloc() in ld.so
         must not be freed using the general free() in libc.  */
@@ -2165,7 +2165,7 @@ _dl_map_object (struct link_map *loader, const char *name,
 
       size_t namelen = strlen (name) + 1;
 
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
        _dl_debug_printf ("find library=%s [%lu]; searching\n", name, nsid);
 
       fd = -1;
@@ -2268,7 +2268,7 @@ _dl_map_object (struct link_map *loader, const char *name,
                  fd = open_verify (cached,
                                    &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
                                    LA_SER_CONFIG, &found_other_class, false);
-                 if (__builtin_expect (fd != -1, 1))
+                 if (__glibc_likely (fd != -1))
                    {
                      realname = local_strdup (cached);
                      if (realname == NULL)
@@ -2291,7 +2291,7 @@ _dl_map_object (struct link_map *loader, const char *name,
                        &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
 
       /* Add another newline when we are tracing the library loading.  */
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
        _dl_debug_printf ("\n");
     }
   else
index a58e5bc72a08bd600139935140e8fe1c762d59c9..690f4046c5fc419b91034b671f8aaf6b68380020 100644 (file)
@@ -110,7 +110,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
        continue;
 
       /* Print some debugging info if wanted.  */
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS))
        _dl_debug_printf ("symbol=%s;  lookup in file=%s [%lu]\n",
                          undef_name, DSO_FILENAME (map->l_name),
                          map->l_ns);
@@ -143,7 +143,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
 #define ALLOWED_STT \
        ((1 << STT_NOTYPE) | (1 << STT_OBJECT) | (1 << STT_FUNC) \
         | (1 << STT_COMMON) | (1 << STT_TLS) | (1 << STT_GNU_IFUNC))
-       if (__builtin_expect (((1 << stt) & ALLOWED_STT) == 0, 0))
+       if (__glibc_unlikely (((1 << stt) & ALLOWED_STT) == 0))
          return NULL;
 
        if (sym != ref && strcmp (strtab + sym->st_name, undef_name))
@@ -153,7 +153,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
        const ElfW(Half) *verstab = map->l_versyms;
        if (version != NULL)
          {
-           if (__builtin_expect (verstab == NULL, 0))
+           if (__glibc_unlikely (verstab == NULL))
              {
                /* We need a versioned symbol but haven't found any.  If
                   this is the object which is referenced in the verneed
@@ -223,7 +223,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
 
       const ElfW(Sym) *sym;
       const ElfW(Addr) *bitmask = map->l_gnu_bitmask;
-      if (__builtin_expect (bitmask != NULL, 1))
+      if (__glibc_likely (bitmask != NULL))
        {
          ElfW(Addr) bitmask_word
            = bitmask[(new_hash / __ELF_NATIVE_CLASS)
@@ -287,7 +287,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
            {
            case STB_WEAK:
              /* Weak definition.  Use this value if we don't find another.  */
-             if (__builtin_expect (GLRO(dl_dynamic_weak), 0))
+             if (__glibc_unlikely (GLRO(dl_dynamic_weak)))
                {
                  if (! result->s)
                    {
@@ -412,7 +412,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
                     LD_TRACE_PRELINKING in _dl_debug_bindings.  Don't
                     allocate anything and don't enter anything into the
                     hash table.  */
-                 if (__builtin_expect (tab->size, 0))
+                 if (__glibc_unlikely (tab->size))
                    {
                      assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK);
                      __rtld_lock_unlock_recursive (tab->lock);
@@ -530,7 +530,7 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
   unsigned long long serial = map->l_serial;
 
   /* Make sure nobody can unload the object while we are at it.  */
-  if (__builtin_expect (flags & DL_LOOKUP_GSCOPE_LOCK, 0))
+  if (__glibc_unlikely (flags & DL_LOOKUP_GSCOPE_LOCK))
     {
       /* We can't just call __rtld_lock_lock_recursive (GL(dl_load_lock))
         here, that can result in ABBA deadlock.  */
@@ -617,7 +617,7 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
        }
 
       /* Add the reference now.  */
-      if (__builtin_expect (l_reldepsact >= undef_map->l_reldepsmax, 0))
+      if (__glibc_unlikely (l_reldepsact >= undef_map->l_reldepsmax))
        {
          /* Allocate more memory for the dependency list.  Since this
             can never happen during the startup phase we can use
@@ -663,7 +663,7 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
        }
 
       /* Display information if we are debugging.  */
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
        _dl_debug_printf ("\
 \nfile=%s [%lu];  needed by %s [%lu] (relocation dependency)\n\n",
                          DSO_FILENAME (map->l_name),
@@ -679,7 +679,7 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
   /* Release the lock.  */
   __rtld_lock_unlock_recursive (GL(dl_load_lock));
 
-  if (__builtin_expect (flags & DL_LOOKUP_GSCOPE_LOCK, 0))
+  if (__glibc_unlikely (flags & DL_LOOKUP_GSCOPE_LOCK))
     THREAD_GSCOPE_SET_FLAG ();
 
   return result;
@@ -726,7 +726,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
             == 0);
 
   size_t i = 0;
-  if (__builtin_expect (skip_map != NULL, 0))
+  if (__glibc_unlikely (skip_map != NULL))
     /* Search the relevant loaded objects for a definition.  */
     while ((*scope)->r_list[i] != skip_map)
       ++i;
@@ -763,7 +763,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
        }
     }
 
-  if (__builtin_expect (current_value.s == NULL, 0))
+  if (__glibc_unlikely (current_value.s == NULL))
     {
       if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
          && skip_map == NULL
@@ -787,7 +787,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
 
   int protected = (*ref
                   && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED);
-  if (__builtin_expect (protected != 0, 0))
+  if (__glibc_unlikely (protected != 0))
     {
       /* It is very tricky.  We need to figure out what value to
         return for the protected symbol.  */
@@ -835,7 +835,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
                                  version, type_class, flags, skip_map);
 
   /* The object is used.  */
-  if (__builtin_expect (current_value.m->l_used == 0, 0))
+  if (__glibc_unlikely (current_value.m->l_used == 0))
     current_value.m->l_used = 1;
 
   if (__builtin_expect (GLRO(dl_debug_mask)
index 22d0b3c8af5f857f2da4ccaaefdbda5e91c9247d..20a672ae41c7774224bc5b0661c68d2f6e759f4d 100644 (file)
@@ -68,7 +68,7 @@ __libc_memalign (size_t align, size_t n)
       /* Insufficient space left; allocate another page.  */
       caddr_t page;
       size_t nup = (n + GLRO(dl_pagesize) - 1) & ~(GLRO(dl_pagesize) - 1);
-      if (__builtin_expect (nup == 0, 0))
+      if (__glibc_unlikely (nup == 0))
        {
          if (n)
            return NULL;
index a9ca6b3b44c297e9ddda3dd008652ec4b1d2d4e1..7cc4cc16e196dd0cc4073eba07f01d247ae29635 100644 (file)
@@ -147,7 +147,7 @@ add_to_global (struct link_map *new)
          ns->_ns_main_searchlist->r_list[new_nlist++] = map;
 
          /* We modify the global scope.  Report this.  */
-         if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
+         if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
            _dl_debug_printf ("\nadd %s [%lu] to global scope\n",
                              map->l_name, map->l_ns);
        }
@@ -232,7 +232,7 @@ dl_open_worker (void *a)
       return;
     }
 
-  if (__builtin_expect (mode & __RTLD_SPROF, 0))
+  if (__glibc_unlikely (mode & __RTLD_SPROF))
     /* This happens only if we load a DSO for 'sprof'.  */
     return;
 
@@ -240,10 +240,10 @@ dl_open_worker (void *a)
   ++new->l_direct_opencount;
 
   /* It was already open.  */
-  if (__builtin_expect (new->l_searchlist.r_list != NULL, 0))
+  if (__glibc_unlikely (new->l_searchlist.r_list != NULL))
     {
       /* Let the user know about the opencount.  */
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
        _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n",
                          new->l_name, new->l_ns, new->l_direct_opencount);
 
@@ -269,7 +269,7 @@ dl_open_worker (void *a)
 
 #ifdef SHARED
   /* Auditing checkpoint: we have added all objects.  */
-  if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+  if (__glibc_unlikely (GLRO(dl_naudit) > 0))
     {
       struct link_map *head = GL(dl_ns)[new->l_ns]._ns_loaded;
       /* Do not call the functions for any auditing object.  */
@@ -294,7 +294,7 @@ dl_open_worker (void *a)
   LIBC_PROBE (map_complete, 3, args->nsid, r, new);
 
   /* Print scope information.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
     _dl_show_scope (new, 0);
 
   /* Only do lazy relocation if `LD_BIND_NOW' is not set.  */
@@ -344,7 +344,7 @@ dl_open_worker (void *a)
              if (runp != NULL)
                /* Look through the dependencies of the object.  */
                while (*runp != NULL)
-                 if (__builtin_expect (*runp++ == thisp, 0))
+                 if (__glibc_unlikely (*runp++ == thisp))
                    {
                      /* Move the current object to the back past the last
                         object with it as the dependency.  */
@@ -391,7 +391,7 @@ dl_open_worker (void *a)
        }
 
 #ifdef SHARED
-      if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
+      if (__glibc_unlikely (GLRO(dl_profile) != NULL))
        {
          /* If this here is the shared object which we want to profile
             make sure the profile is started.  We can find out whether
@@ -444,7 +444,7 @@ dl_open_worker (void *a)
            /* Avoid duplicates.  */
            continue;
 
-         if (__builtin_expect (cnt + 1 >= imap->l_scope_max, 0))
+         if (__glibc_unlikely (cnt + 1 >= imap->l_scope_max))
            {
              /* The 'r_scope' array is too small.  Allocate a new one
                 dynamically.  */
@@ -511,7 +511,7 @@ dl_open_worker (void *a)
        }
 
       /* Print scope information.  */
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
        _dl_show_scope (imap, from_scope);
     }
 
@@ -574,7 +574,7 @@ cannot load any more object with static TLS"));
 
   /* Mark the object as not deletable if the RTLD_NODELETE flags was
      passed.  */
-  if (__builtin_expect (mode & RTLD_NODELETE, 0))
+  if (__glibc_unlikely (mode & RTLD_NODELETE))
     new->l_flags_1 |= DF_1_NODELETE;
 
 #ifndef SHARED
@@ -584,7 +584,7 @@ cannot load any more object with static TLS"));
 #endif
 
   /* Let the user know about the opencount.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
     _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n",
                      new->l_name, new->l_ns, new->l_direct_opencount);
 }
@@ -601,14 +601,14 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
   /* Make sure we are alone.  */
   __rtld_lock_lock_recursive (GL(dl_load_lock));
 
-  if (__builtin_expect (nsid == LM_ID_NEWLM, 0))
+  if (__glibc_unlikely (nsid == LM_ID_NEWLM))
     {
       /* Find a new namespace.  */
       for (nsid = 1; DL_NNS > 1 && nsid < GL(dl_nns); ++nsid)
        if (GL(dl_ns)[nsid]._ns_loaded == NULL)
          break;
 
-      if (__builtin_expect (nsid == DL_NNS, 0))
+      if (__glibc_unlikely (nsid == DL_NNS))
        {
          /* No more namespace available.  */
          __rtld_lock_unlock_recursive (GL(dl_load_lock));
@@ -656,7 +656,7 @@ no more namespaces available for dlmopen()"));
 #endif
 
   /* See if an error occurred during loading.  */
-  if (__builtin_expect (errstring != NULL, 0))
+  if (__glibc_unlikely (errstring != NULL))
     {
       /* Remove the object from memory.  It may be in an inconsistent
         state if relocation failed, for example.  */
index 1f66fccee2ed3be53507cf69e92e3be478cd28e5..d2c6dac69e479b1120b490162b4eccc8ca044554 100644 (file)
@@ -183,14 +183,14 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
       && __builtin_expect (l->l_info[DT_BIND_NOW] != NULL, 0))
     lazy = 0;
 
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_RELOC, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_RELOC))
     _dl_debug_printf ("\nrelocation processing: %s%s\n",
                      DSO_FILENAME (l->l_name), lazy ? " (lazy)" : "");
 
   /* DT_TEXTREL is now in level 2 and might phase out at some time.
      But we rewrite the DT_FLAGS entry to a DT_TEXTREL entry to make
      testing easier and therefore it will be available at all time.  */
-  if (__builtin_expect (l->l_info[DT_TEXTREL] != NULL, 0))
+  if (__glibc_unlikely (l->l_info[DT_TEXTREL] != NULL))
     {
       /* Bletch.  We must make read-only segments writable
         long enough to relocate them.  */
@@ -264,7 +264,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
     ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
 
 #ifndef PROF
-    if (__builtin_expect (consider_profiling, 0))
+    if (__glibc_unlikely (consider_profiling))
       {
        /* Allocate the array which will contain the already found
           relocations.  If the shared object lacks a PLT (for example
index 655623b425c9a78c9392d92ca37ece84fb6273d0..773cb42610350e26c18e607764a34d7b7efe6d43 100644 (file)
@@ -142,7 +142,7 @@ _dl_fixup (
     value = elf_ifunc_invoke (DL_FIXUP_VALUE_ADDR (value));
 
   /* Finally, fix up the plt itself.  */
-  if (__builtin_expect (GLRO(dl_bind_not), 0))
+  if (__glibc_unlikely (GLRO(dl_bind_not)))
     return value;
 
   return elf_machine_fixup_plt (l, result, reloc, rel_addr, value);
@@ -347,7 +347,7 @@ _dl_profile_fixup (
 #endif
 
       /* Store the result for later runs.  */
-      if (__builtin_expect (! GLRO(dl_bind_not), 1))
+      if (__glibc_likely (! GLRO(dl_bind_not)))
        *resultp = value;
     }
 
index f00975de770108ee5924a3593bbebb671e694c56..69671c172fd3d04ac02c76184e0a92cdca907405 100644 (file)
@@ -128,7 +128,7 @@ do_sym (void *handle, const char *name, void *who,
 
          THREAD_GSCOPE_RESET_FLAG ();
 
-         if (__builtin_expect (errstring != NULL, 0))
+         if (__glibc_unlikely (errstring != NULL))
            {
              /* The lookup was unsuccessful.  Rethrow the error.  */
              char *errstring_dup = strdupa (errstring);
@@ -145,7 +145,7 @@ do_sym (void *handle, const char *name, void *who,
     }
   else if (handle == RTLD_NEXT)
     {
-      if (__builtin_expect (match == GL(dl_ns)[LM_ID_BASE]._ns_loaded, 0))
+      if (__glibc_unlikely (match == GL(dl_ns)[LM_ID_BASE]._ns_loaded))
        {
          if (match == NULL
              || caller < match->l_map_start
@@ -183,7 +183,7 @@ RTLD_NEXT used in code not dynamically loaded"));
        value = DL_SYMBOL_ADDRESS (result, ref);
 
       /* Resolve indirect function address.  */
-      if (__builtin_expect (ELFW(ST_TYPE) (ref->st_info) == STT_GNU_IFUNC, 0))
+      if (__glibc_unlikely (ELFW(ST_TYPE) (ref->st_info) == STT_GNU_IFUNC))
        {
          DL_FIXUP_VALUE_TYPE fixup
            = DL_FIXUP_MAKE_VALUE (result, (ElfW(Addr)) value);
@@ -195,7 +195,7 @@ RTLD_NEXT used in code not dynamically loaded"));
       /* Auditing checkpoint: we have a new binding.  Provide the
         auditing libraries the possibility to change the value and
         tell us whether further auditing is wanted.  */
-      if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+      if (__glibc_unlikely (GLRO(dl_naudit) > 0))
        {
          const char *strtab = (const char *) D_PTR (result,
                                                     l_info[DT_STRTAB]);
index dbaea0aa913e566b4516aeb134012643e5009754..9454d06d723997603088fe0001ca9ade240eafb1 100644 (file)
@@ -720,7 +720,7 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map)
                        != FORCED_DYNAMIC_TLS_OFFSET, 0))
     {
       __rtld_lock_lock_recursive (GL(dl_load_lock));
-      if (__builtin_expect (the_map->l_tls_offset == NO_TLS_OFFSET, 1))
+      if (__glibc_likely (the_map->l_tls_offset == NO_TLS_OFFSET))
        {
          the_map->l_tls_offset = FORCED_DYNAMIC_TLS_OFFSET;
          __rtld_lock_unlock_recursive (GL(dl_load_lock));
@@ -732,7 +732,7 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map)
                                != FORCED_DYNAMIC_TLS_OFFSET, 1))
            {
              void *p = dtv[GET_ADDR_MODULE].pointer.val;
-             if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
+             if (__glibc_unlikely (p == TLS_DTV_UNALLOCATED))
                goto again;
 
              return (char *) p + GET_ADDR_OFFSET;
@@ -755,7 +755,7 @@ update_get_addr (GET_ADDR_ARGS)
 
   void *p = dtv[GET_ADDR_MODULE].pointer.val;
 
-  if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
+  if (__glibc_unlikely (p == TLS_DTV_UNALLOCATED))
     return tls_get_addr_tail (GET_ADDR_PARAM, dtv, the_map);
 
   return (void *) p + GET_ADDR_OFFSET;
@@ -769,12 +769,12 @@ __tls_get_addr (GET_ADDR_ARGS)
 {
   dtv_t *dtv = THREAD_DTV ();
 
-  if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0))
+  if (__glibc_unlikely (dtv[0].counter != GL(dl_tls_generation)))
     return update_get_addr (GET_ADDR_PARAM);
 
   void *p = dtv[GET_ADDR_MODULE].pointer.val;
 
-  if (__builtin_expect (p == TLS_DTV_UNALLOCATED, 0))
+  if (__glibc_unlikely (p == TLS_DTV_UNALLOCATED))
     return tls_get_addr_tail (GET_ADDR_PARAM, dtv, NULL);
 
   return (char *) p + GET_ADDR_OFFSET;
@@ -787,12 +787,12 @@ __tls_get_addr (GET_ADDR_ARGS)
 void *
 _dl_tls_get_addr_soft (struct link_map *l)
 {
-  if (__builtin_expect (l->l_tls_modid == 0, 0))
+  if (__glibc_unlikely (l->l_tls_modid == 0))
     /* This module has no TLS segment.  */
     return NULL;
 
   dtv_t *dtv = THREAD_DTV ();
-  if (__builtin_expect (dtv[0].counter != GL(dl_tls_generation), 0))
+  if (__glibc_unlikely (dtv[0].counter != GL(dl_tls_generation)))
     {
       /* This thread's DTV is not completely current,
         but it might already cover this module.  */
@@ -817,7 +817,7 @@ _dl_tls_get_addr_soft (struct link_map *l)
     }
 
   void *data = dtv[l->l_tls_modid].pointer.val;
-  if (__builtin_expect (data == TLS_DTV_UNALLOCATED, 0))
+  if (__glibc_unlikely (data == TLS_DTV_UNALLOCATED))
     /* The DTV is current, but this thread has not yet needed
        to allocate this module's segment.  */
     data = NULL;
index 651d4cf4edc643c10dbbbc334155c3f6b43052cf..525e9d52e541d223cb0a94ef06f8e258d107c517 100644 (file)
@@ -82,13 +82,13 @@ match_symbol (const char *name, Lmid_t ns, ElfW(Word) hash, const char *string,
   int result = 0;
 
   /* Display information about what we are doing while debugging.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_VERSIONS, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_VERSIONS))
     _dl_debug_printf ("\
 checking for version `%s' in file %s [%lu] required by file %s [%lu]\n",
                      string, DSO_FILENAME (map->l_name),
                      map->l_ns, name, ns);
 
-  if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0))
+  if (__glibc_unlikely (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL))
     {
       /* The file has no symbol versioning.  I.e., the dependent
         object was linked against another version of this file.  We
@@ -145,7 +145,7 @@ no version information available (required by ", name, ")");
     }
 
   /* Symbol not found.  If it was a weak reference it is not fatal.  */
-  if (__builtin_expect (weak, 1))
+  if (__glibc_likely (weak))
     {
       if (verbose)
        {
@@ -291,7 +291,7 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
         section.  */
       map->l_versions = (struct r_found_version *)
        calloc (ndx_high + 1, sizeof (*map->l_versions));
-      if (__builtin_expect (map->l_versions == NULL, 0))
+      if (__glibc_unlikely (map->l_versions == NULL))
        {
          errstring = N_("cannot allocate version reference table");
          errval = ENOMEM;
@@ -316,7 +316,7 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
                {
                  ElfW(Half) ndx = aux->vna_other & 0x7fff;
                  /* In trace mode, dependencies may be missing.  */
-                 if (__builtin_expect (ndx < map->l_nversions, 1))
+                 if (__glibc_likely (ndx < map->l_nversions))
                    {
                      map->l_versions[ndx].hash = aux->vna_hash;
                      map->l_versions[ndx].hidden = aux->vna_other & 0x8000;
index ad67c1d82c8aeab88954d307d6a2ed4f16b97e37..a5ce6c51666c34c4de2d27c6999416600b769fa7 100644 (file)
@@ -42,7 +42,7 @@ _dl_writev (int fd, const struct iovec *iov, size_t niov)
      errno when it's being used by another thread that cares about it.
      Yet we must be sure not to try calling the lock functions before
      the thread library is fully initialized.  */
-  if (__builtin_expect (INTUSE (_dl_starting_up), 0))
+  if (__glibc_unlikely (INTUSE (_dl_starting_up)))
     __writev (fd, iov, niov);
   else
     {
index 46d295064f4b3d01052732174c73e8910d8c1d87..4211f4c9cf7dfa17d670d19432030b264e6eb6c5 100644 (file)
@@ -770,7 +770,7 @@ search_dir (const struct dir_entry *entry)
        lstat_buf.st_mode = DTTOIF (direntry->d_type);
       else
 #endif
-       if (__builtin_expect (lstat64 (real_file_name, &lstat_buf), 0))
+       if (__glibc_unlikely (lstat64 (real_file_name, &lstat_buf)))
          {
            error (0, errno, _("Cannot lstat %s"), file_name);
            continue;
@@ -794,7 +794,7 @@ search_dir (const struct dir_entry *entry)
                  continue;
                }
            }
-         if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
+         if (__glibc_unlikely (stat64 (target_name, &stat_buf)))
            {
              if (opt_verbose)
                error (0, errno, _("Cannot stat %s"), file_name);
index 6dcbabc2847b04ca1a313301cad4831cf4d46d95..aa50cab0a96df44258f640f8542bebdf5577b18c 100644 (file)
@@ -344,7 +344,7 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
     }
 #endif
 
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS))
     {
 #ifndef HP_TIMING_NONAVAIL
       print_statistics (&rtld_total_time);
@@ -517,7 +517,7 @@ _dl_start (void *arg)
 # else
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 # endif
-       if (__builtin_expect (lossage != NULL, 0))
+       if (__glibc_unlikely (lossage != NULL))
          _dl_fatal_printf ("cannot set up thread-local storage: %s\n",
                            lossage);
 
@@ -779,7 +779,7 @@ cannot allocate TLS data structures for initial thread");
 #else
     = TLS_INIT_TP (tcbp, 0);
 #endif
-  if (__builtin_expect (lossage != NULL, 0))
+  if (__glibc_unlikely (lossage != NULL))
     _dl_fatal_printf ("cannot set up thread-local storage: %s\n", lossage);
   tls_init_tp_called = true;
 
@@ -813,7 +813,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where)
   unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
 
   (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit, &args);
-  if (__builtin_expect (err_str != NULL, 0))
+  if (__glibc_unlikely (err_str != NULL))
     {
       _dl_error_printf ("\
 ERROR: ld.so: object '%s' from %s cannot be preloaded (%s): ignored.\n",
@@ -1067,7 +1067,7 @@ of this helper program; chances are you did not intend to run this program.\n\
          args.mode = __RTLD_OPENEXEC;
          (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
                                  &args);
-         if (__builtin_expect (err_str != NULL, 0))
+         if (__glibc_unlikely (err_str != NULL))
            /* We don't free the returned string, the programs stops
               anyway.  */
            _exit (EXIT_FAILURE);
@@ -1394,7 +1394,7 @@ of this helper program; chances are you did not intend to run this program.\n\
     GL(dl_rtld_map).l_tls_modid = _dl_next_tls_modid ();
 
   /* If we have auditing DSOs to load, do it now.  */
-  if (__builtin_expect (audit_list != NULL, 0))
+  if (__glibc_unlikely (audit_list != NULL))
     {
       /* Iterate over all entries in the list.  The order is important.  */
       struct audit_ifaces *last_audit = NULL;
@@ -1428,7 +1428,7 @@ of this helper program; chances are you did not intend to run this program.\n\
          bool malloced;
          (void) _dl_catch_error (&objname, &err_str, &malloced, dlmopen_doit,
                                  &dlmargs);
-         if (__builtin_expect (err_str != NULL, 0))
+         if (__glibc_unlikely (err_str != NULL))
            {
            not_loaded:
              _dl_error_printf ("\
@@ -1544,7 +1544,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 
       /* If we have any auditing modules, announce that we already
         have two objects loaded.  */
-      if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+      if (__glibc_unlikely (GLRO(dl_naudit) > 0))
        {
          struct link_map *ls[2] = { main_map, &GL(dl_rtld_map) };
 
@@ -1593,7 +1593,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 
   /* Auditing checkpoint: we are ready to signal that the initial map
      is being constructed.  */
-  if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+  if (__glibc_unlikely (GLRO(dl_naudit) > 0))
     {
       struct audit_ifaces *afct = GLRO(dl_audit);
       for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
@@ -1612,7 +1612,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
   struct link_map **preloads = NULL;
   unsigned int npreloads = 0;
 
-  if (__builtin_expect (preloadlist != NULL, 0))
+  if (__glibc_unlikely (preloadlist != NULL))
     {
       /* The LD_PRELOAD environment variable gives list of libraries
         separated by white space or colons that are loaded before the
@@ -1643,12 +1643,12 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
      the work but this does not matter, since it is not for production
      use.  */
   static const char preload_file[] = "/etc/ld.so.preload";
-  if (__builtin_expect (__access (preload_file, R_OK) == 0, 0))
+  if (__glibc_unlikely (__access (preload_file, R_OK) == 0))
     {
       /* Read the contents of the file.  */
       file = _dl_sysdep_read_whole_file (preload_file, &file_size,
                                         PROT_READ | PROT_WRITE);
-      if (__builtin_expect (file != MAP_FAILED, 0))
+      if (__glibc_unlikely (file != MAP_FAILED))
        {
          /* Parse the file.  It contains names of libraries to be loaded,
             separated by white spaces or `:'.  It may also contain
@@ -1720,7 +1720,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
        }
     }
 
-  if (__builtin_expect (*first_preload != NULL, 0))
+  if (__glibc_unlikely (*first_preload != NULL))
     {
       /* Set up PRELOADS with a vector of the preloaded libraries.  */
       struct link_map *l = *first_preload;
@@ -1757,7 +1757,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
       break;
 
   bool rtld_multiple_ref = false;
-  if (__builtin_expect (i < main_map->l_searchlist.r_nlist, 1))
+  if (__glibc_likely (i < main_map->l_searchlist.r_nlist))
     {
       /* Some DT_NEEDED entry referred to the interpreter object itself, so
         put it back in the list of visible objects.  We insert it into the
@@ -1815,7 +1815,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
   if (tcbp == NULL)
     tcbp = init_tls ();
 
-  if (__builtin_expect (audit_list == NULL, 1))
+  if (__glibc_likely (audit_list == NULL))
     /* Initialize security features.  But only if we have not done it
        earlier.  */
     security_init ();
@@ -2099,7 +2099,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
       if (r_list == r_listend && liblist == liblistend)
        prelinked = true;
 
-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
+      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
        _dl_debug_printf ("\nprelink checking: %s\n",
                          prelinked ? "ok" : "failed");
     }
@@ -2117,7 +2117,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
   GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
 
   /* Print scope information.  */
-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
+  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
     {
       _dl_debug_printf ("\nInitial object scopes\n");
 
@@ -2215,7 +2215,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
         this has to go here because the calls it makes should use the
         rtld versions of the functions (particularly calloc()), but it
         needs to have _dl_profile_map set up by the relocator.  */
-      if (__builtin_expect (GL(dl_profile_map) != NULL, 0))
+      if (__glibc_unlikely (GL(dl_profile_map) != NULL))
        /* We must prepare the profiling.  */
        _dl_start_profile ();
     }
@@ -2238,7 +2238,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 #else
        = TLS_INIT_TP (tcbp, 0);
 #endif
-      if (__builtin_expect (lossage != NULL, 0))
+      if (__glibc_unlikely (lossage != NULL))
        _dl_fatal_printf ("cannot set up thread-local storage: %s\n",
                          lossage);
     }
@@ -2279,7 +2279,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 
 #ifdef SHARED
   /* Auditing checkpoint: we have added all objects.  */
-  if (__builtin_expect (GLRO(dl_naudit) > 0, 0))
+  if (__glibc_unlikely (GLRO(dl_naudit) > 0))
     {
       struct link_map *head = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
       /* Do not call the functions for any auditing object.  */
index f3716b693dc89ae645f76411929aa13e3775f4f4..1057cf000357b98bac187a01460d97dbf16d3a00 100644 (file)
@@ -31,7 +31,7 @@ setup_vdso (struct link_map *main_map __attribute__ ((unused)),
      mapped and relocated it normally.  */
   struct link_map *l = _dl_new_object ((char *) "", "", lt_library, NULL,
                                       0, LM_ID_BASE);
-  if (__builtin_expect (l != NULL, 1))
+  if (__glibc_likely (l != NULL))
     {
       static ElfW(Dyn) dyn_temp[DL_RO_DYN_TEMP_CNT] attribute_relro;
 
index 260c4826c2c2991bb0db584c4e7d5245b13a35ad..ff10e247f4c776e942fb855bd75cec820d0f0d87 100644 (file)
@@ -82,7 +82,7 @@ compat_call (service_user *nip, const char *user, gid_t group, long int *start,
                  {
                    /* Matches user and not yet on the list.  Insert
                       this group.  */
-                   if (__builtin_expect (*start == *size, 0))
+                   if (__glibc_unlikely (*start == *size))
                      {
                        /* Need a bigger buffer.  */
                        gid_t *newgroups;
index 2ab64d23fd4fc8dbbb52c981b2ef0187b99f857b..38c83833ae931a7b137c5512d574729504539e0d 100644 (file)
@@ -57,7 +57,7 @@ fgetgrent (FILE *stream)
       char *new_buf;
       buffer_size += NSS_BUFLEN_GROUP;
       new_buf = realloc (buffer, buffer_size);
-      if (__builtin_expect (new_buf == NULL, 0))
+      if (__glibc_unlikely (new_buf == NULL))
        {
          /* We are out of memory.  Free the current buffer so that the
             process gets a chance for a normal termination.  */
index a2b6d31fd91455b75420bd0d9307222027e8739c..bdde097b0f58fa3f5b2af4fdc0c14ee1cb9ff562 100644 (file)
@@ -159,7 +159,7 @@ getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups)
   long int size = MAX (1, *ngroups);
 
   gid_t *newgroups = (gid_t *) malloc (size * sizeof (gid_t));
-  if (__builtin_expect (newgroups == NULL, 0))
+  if (__glibc_unlikely (newgroups == NULL))
     /* No more memory.  */
     // XXX This is wrong.  The user provided memory, we have to use
     // XXX it.  The internal functions must be called with the user
@@ -212,7 +212,7 @@ initgroups (const char *user, gid_t group)
     size = 16;
 
   groups = (gid_t *) malloc (size * sizeof (gid_t));
-  if (__builtin_expect (groups == NULL, 0))
+  if (__glibc_unlikely (groups == NULL))
     /* No more memory.  */
     return -1;
 
index bb429277e52eec7f6f77a23729ad2cfea984c96e..029415fcbd6e2a7ac54c8e94e288673021df518d 100644 (file)
@@ -33,7 +33,7 @@ putgrent (gr, stream)
 {
   int retval;
 
-  if (__builtin_expect (gr == NULL, 0) || __builtin_expect (stream == NULL, 0))
+  if (__glibc_unlikely (gr == NULL) || __glibc_unlikely (stream == NULL))
     {
       __set_errno (EINVAL);
       return -1;
index 9f66a3b857ba61efb48a443e478f9790b893c191..327bbf48880ea8622fb462b9f1b40966415f1565 100644 (file)
@@ -227,7 +227,7 @@ _nss_hesiod_initgroups_dyn (const char *user, gid_t group, long int *start,
          if (status == NSS_STATUS_SUCCESS
              && !internal_gid_in_list (groups, group, *start))
            {
-             if (__builtin_expect (*start == *size, 0))
+             if (__glibc_unlikely (*start == *size))
                {
                  /* Need a bigger buffer.  */
                  gid_t *newgroups;
index 81d94eab0edee8a26a84f88a8ae127b9e7838ca1..132e20bbd72e6cfe992734da18da8adc19072e73 100644 (file)
@@ -38,7 +38,7 @@ int __libc_argc;
 error_t
 _hurd_ports_use (int which, error_t (*operate) (mach_port_t))
 {
-  if (__builtin_expect (_hurd_ports == NULL, 0))
+  if (__glibc_unlikely (_hurd_ports == NULL))
     /* This means that _hurd_init has not been called yet, which is
        normally only the case in the bootstrap filesystem, and there
        only in the early phases of booting.  */
index 41a4688f2a9ea2d595b5fc16116df73f5ca83cd9..f3a4337812cb0891a73f93978eeda13fce1785f5 100644 (file)
@@ -79,7 +79,7 @@ __gconv_load_cache (void)
   cache_size = st.st_size;
 #ifdef _POSIX_MAPPED_FILES
   gconv_cache = __mmap (NULL, cache_size, PROT_READ, MAP_SHARED, fd, 0);
-  if (__builtin_expect (gconv_cache == MAP_FAILED, 0))
+  if (__glibc_unlikely (gconv_cache == MAP_FAILED))
 #endif
     {
       size_t already_read;
index 9d01f146cca7469d5bf31b1507b44bb9e4fafa85..81f0e0b3198b45091ba372c2587242dcebf1b0ed 100644 (file)
@@ -45,7 +45,7 @@ __gconv_close (__gconv_t cd)
          struct __gconv_trans_data *curp = transp;
          transp = transp->__next;
 
-         if (__builtin_expect (curp->__trans_end_fct != NULL, 0))
+         if (__glibc_unlikely (curp->__trans_end_fct != NULL))
            curp->__trans_end_fct (curp->__data);
 
          free (curp);
index 69a1f65eb20fa64ab6ffb143f9668edec6855193..bfbe22bff6ad1675ad91415d98a0cf824524bf9e 100644 (file)
@@ -45,7 +45,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
   errhand = strchr (toset, '/');
   if (errhand != NULL)
     errhand = strchr (errhand + 1, '/');
-  if (__builtin_expect (errhand != NULL, 1))
+  if (__glibc_likely (errhand != NULL))
     {
       if (*++errhand == '\0')
        errhand = NULL;
@@ -318,7 +318,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
                      struct __gconv_trans_data *curp = transp;
                      transp = transp->__next;
 
-                     if (__builtin_expect (curp->__trans_end_fct != NULL, 0))
+                     if (__glibc_unlikely (curp->__trans_end_fct != NULL))
                        curp->__trans_end_fct (curp->__data);
 
                      free (curp);
index 27acb5e8929433d3937900d3a5f020b14ef3224c..e11e2eea2dd583440c9342f95e888e81ffb39999 100644 (file)
@@ -177,7 +177,7 @@ internal_ucs4_loop_single (struct __gconv_step *step,
   while (*inptrp < inend && cnt < 4)
     state->__value.__wchb[cnt++] = *(*inptrp)++;
 
-  if (__builtin_expect (cnt < 4, 0))
+  if (__glibc_unlikely (cnt < 4))
     {
       /* Still not enough bytes.  Store the ones in the input buffer.  */
       state->__count &= ~7;
@@ -249,7 +249,7 @@ ucs4_internal_loop (struct __gconv_step *step,
       inval = *(const uint32_t *) inptr;
 #endif
 
-      if (__builtin_expect (inval > 0x7fffffff, 0))
+      if (__glibc_unlikely (inval > 0x7fffffff))
        {
          /* The value is too large.  We don't try transliteration here since
             this is not an error because of the lack of possibilities to
@@ -308,7 +308,7 @@ ucs4_internal_loop_unaligned (struct __gconv_step *step,
 
   for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
     {
-      if (__builtin_expect (inptr[0] > 0x80, 0))
+      if (__glibc_unlikely (inptr[0] > 0x80))
        {
          /* The value is too large.  We don't try transliteration here since
             this is not an error because of the lack of possibilities to
@@ -376,7 +376,7 @@ ucs4_internal_loop_single (struct __gconv_step *step,
   while (*inptrp < inend && cnt < 4)
     state->__value.__wchb[cnt++] = *(*inptrp)++;
 
-  if (__builtin_expect (cnt < 4, 0))
+  if (__glibc_unlikely (cnt < 4))
     {
       /* Still not enough bytes.  Store the ones in the input buffer.  */
       state->__count &= ~7;
@@ -546,7 +546,7 @@ internal_ucs4le_loop_single (struct __gconv_step *step,
   while (*inptrp < inend && cnt < 4)
     state->__value.__wchb[cnt++] = *(*inptrp)++;
 
-  if (__builtin_expect (cnt < 4, 0))
+  if (__glibc_unlikely (cnt < 4))
     {
       /* Still not enough bytes.  Store the ones in the input buffer.  */
       state->__count &= ~7;
@@ -617,7 +617,7 @@ ucs4le_internal_loop (struct __gconv_step *step,
       inval = *(const uint32_t *) inptr;
 #endif
 
-      if (__builtin_expect (inval > 0x7fffffff, 0))
+      if (__glibc_unlikely (inval > 0x7fffffff))
        {
          /* The value is too large.  We don't try transliteration here since
             this is not an error because of the lack of possibilities to
@@ -677,7 +677,7 @@ ucs4le_internal_loop_unaligned (struct __gconv_step *step,
 
   for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
     {
-      if (__builtin_expect (inptr[3] > 0x80, 0))
+      if (__glibc_unlikely (inptr[3] > 0x80))
        {
          /* The value is too large.  We don't try transliteration here since
             this is not an error because of the lack of possibilities to
@@ -749,7 +749,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
   while (*inptrp < inend && cnt < 4)
     state->__value.__wchb[cnt++] = *(*inptrp)++;
 
-  if (__builtin_expect (cnt < 4, 0))
+  if (__glibc_unlikely (cnt < 4))
     {
       /* Still not enough bytes.  Store the ones in the input buffer.  */
       state->__count &= ~7;
@@ -810,7 +810,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
 #define LOOPFCT                        FROM_LOOP
 #define BODY \
   {                                                                          \
-    if (__builtin_expect (*inptr > '\x7f', 0))                               \
+    if (__glibc_unlikely (*inptr > '\x7f'))                                  \
       {                                                                              \
        /* The value is too large.  We don't try transliteration here since   \
           this is not an error because of the lack of possibilities to       \
@@ -846,7 +846,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
 #define LOOPFCT                        FROM_LOOP
 #define BODY \
   {                                                                          \
-    if (__builtin_expect (*((const uint32_t *) inptr) > 0x7f, 0))            \
+    if (__glibc_unlikely (*((const uint32_t *) inptr) > 0x7f))               \
       {                                                                              \
        UNICODE_TAG_HANDLER (*((const uint32_t *) inptr), 4);                 \
        STANDARD_TO_LOOP_ERR_HANDLER (4);                                     \
@@ -883,10 +883,10 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
   {                                                                          \
     uint32_t wc = *((const uint32_t *) inptr);                               \
                                                                              \
-    if (__builtin_expect (wc < 0x80, 1))                                     \
+    if (__glibc_likely (wc < 0x80))                                          \
       /* It's an one byte sequence.  */                                              \
       *outptr++ = (unsigned char) wc;                                        \
-    else if (__builtin_expect (wc <= 0x7fffffff, 1))                         \
+    else if (__glibc_likely (wc <= 0x7fffffff))                                      \
       {                                                                              \
        size_t step;                                                          \
        unsigned char *start;                                                 \
@@ -895,7 +895,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
          if ((wc & (~(uint32_t)0 << (5 * step + 1))) == 0)                   \
            break;                                                            \
                                                                              \
-       if (__builtin_expect (outptr + step > outend, 0))                     \
+       if (__glibc_unlikely (outptr + step > outend))                        \
          {                                                                   \
            /* Too long.  */                                                  \
            result = __GCONV_FULL_OUTPUT;                                     \
@@ -946,7 +946,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
     /* Next input byte.  */                                                  \
     uint32_t ch = *inptr;                                                    \
                                                                              \
-    if (__builtin_expect (ch < 0x80, 1))                                     \
+    if (__glibc_likely (ch < 0x80))                                          \
       {                                                                              \
        /* One byte sequence.  */                                             \
        ++inptr;                                                              \
@@ -964,25 +964,25 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
            cnt = 2;                                                          \
            ch &= 0x1f;                                                       \
          }                                                                   \
-       else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))                   \
+       else if (__glibc_likely ((ch & 0xf0) == 0xe0))                        \
          {                                                                   \
            /* We expect three bytes.  */                                     \
            cnt = 3;                                                          \
            ch &= 0x0f;                                                       \
          }                                                                   \
-       else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))                   \
+       else if (__glibc_likely ((ch & 0xf8) == 0xf0))                        \
          {                                                                   \
            /* We expect four bytes.  */                                      \
            cnt = 4;                                                          \
            ch &= 0x07;                                                       \
          }                                                                   \
-       else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1))                   \
+       else if (__glibc_likely ((ch & 0xfc) == 0xf8))                        \
          {                                                                   \
            /* We expect five bytes.  */                                      \
            cnt = 5;                                                          \
            ch &= 0x03;                                                       \
          }                                                                   \
-       else if (__builtin_expect ((ch & 0xfe) == 0xfc, 1))                   \
+       else if (__glibc_likely ((ch & 0xfe) == 0xfc))                        \
          {                                                                   \
            /* We expect six bytes.  */                                       \
            cnt = 6;                                                          \
@@ -1003,7 +1003,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
            STANDARD_FROM_LOOP_ERR_HANDLER (i);                               \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (inptr + cnt > inend, 0))                        \
+       if (__glibc_unlikely (inptr + cnt > inend))                           \
          {                                                                   \
            /* We don't have enough input.  But before we report that check   \
               that all the bytes are correct.  */                            \
@@ -1011,7 +1011,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
              if ((inptr[i] & 0xc0) != 0x80)                                  \
                break;                                                        \
                                                                              \
-           if (__builtin_expect (inptr + i == inend, 1))                     \
+           if (__glibc_likely (inptr + i == inend))                          \
              {                                                               \
                result = __GCONV_INCOMPLETE_INPUT;                            \
                break;                                                        \
@@ -1073,19 +1073,19 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
        cnt = 2;                                                              \
        ch &= 0x1f;                                                           \
       }                                                                              \
-    else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))                              \
+    else if (__glibc_likely ((ch & 0xf0) == 0xe0))                           \
       {                                                                              \
        /* We expect three bytes.  */                                         \
        cnt = 3;                                                              \
        ch &= 0x0f;                                                           \
       }                                                                              \
-    else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))                              \
+    else if (__glibc_likely ((ch & 0xf8) == 0xf0))                           \
       {                                                                              \
        /* We expect four bytes.  */                                          \
        cnt = 4;                                                              \
        ch &= 0x07;                                                           \
       }                                                                              \
-    else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1))                              \
+    else if (__glibc_likely ((ch & 0xfc) == 0xf8))                           \
       {                                                                              \
        /* We expect five bytes.  */                                          \
        cnt = 5;                                                              \
@@ -1164,7 +1164,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
   {                                                                          \
     uint16_t u1 = get16 (inptr);                                             \
                                                                              \
-    if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0))                   \
+    if (__glibc_unlikely (u1 >= 0xd800 && u1 < 0xe000))                              \
       {                                                                              \
        /* Surrogate characters in UCS-2 input are not valid.  Reject         \
           them.  (Catching this here is not security relevant.)  */          \
@@ -1198,12 +1198,12 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
   {                                                                          \
     uint32_t val = *((const uint32_t *) inptr);                                      \
                                                                              \
-    if (__builtin_expect (val >= 0x10000, 0))                                \
+    if (__glibc_unlikely (val >= 0x10000))                                   \
       {                                                                              \
        UNICODE_TAG_HANDLER (val, 4);                                         \
        STANDARD_TO_LOOP_ERR_HANDLER (4);                                     \
       }                                                                              \
-    else if (__builtin_expect (val >= 0xd800 && val < 0xe000, 0))            \
+    else if (__glibc_unlikely (val >= 0xd800 && val < 0xe000))               \
       {                                                                              \
        /* Surrogate characters in UCS-4 input are not valid.                 \
           We must catch this, because the UCS-2 output might be              \
@@ -1248,7 +1248,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
   {                                                                          \
     uint16_t u1 = bswap_16 (get16 (inptr));                                  \
                                                                              \
-    if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0))                   \
+    if (__glibc_unlikely (u1 >= 0xd800 && u1 < 0xe000))                              \
       {                                                                              \
        /* Surrogate characters in UCS-2 input are not valid.  Reject         \
           them.  (Catching this here is not security relevant.)  */          \
@@ -1288,12 +1288,12 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
 #define BODY \
   {                                                                          \
     uint32_t val = *((const uint32_t *) inptr);                                      \
-    if (__builtin_expect (val >= 0x10000, 0))                                \
+    if (__glibc_unlikely (val >= 0x10000))                                   \
       {                                                                              \
        UNICODE_TAG_HANDLER (val, 4);                                         \
        STANDARD_TO_LOOP_ERR_HANDLER (4);                                     \
       }                                                                              \
-    else if (__builtin_expect (val >= 0xd800 && val < 0xe000, 0))            \
+    else if (__glibc_unlikely (val >= 0xd800 && val < 0xe000))               \
       {                                                                              \
        /* Surrogate characters in UCS-4 input are not valid.                 \
           We must catch this, because the UCS-2 output might be              \
index 30b3564df5fd37e2085171079e6efb732242b97a..a45b90ea4f3ec231e17f51a314ddee88b6af2cab 100644 (file)
@@ -36,7 +36,7 @@ iconv (iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf,
   size_t irreversible;
   int result;
 
-  if (__builtin_expect (inbuf == NULL || *inbuf == NULL, 0))
+  if (__glibc_unlikely (inbuf == NULL || *inbuf == NULL))
     {
       if (outbuf == NULL || *outbuf == NULL)
        result = __gconv (gcd, NULL, NULL, NULL, NULL, &irreversible);
index 1bf17939bfeb5c155a0dc1b6ef13237c34c8c380..304b4126b95f21f3d0a7213b793450f7272c7f7d 100644 (file)
@@ -26,7 +26,7 @@
 int
 iconv_close (iconv_t cd)
 {
-  if (__builtin_expect (cd == (iconv_t *) -1L, 0))
+  if (__glibc_unlikely (cd == (iconv_t *) -1L))
     {
       __set_errno (EBADF);
       return -1;
index b4af6d418ba09b0e8bf2bb7c954e52078b701e2d..f836d08c37ea6ce745565491f9f6c9c244ba9bb7 100644 (file)
     /* If any of them recognized the input continue with the loop.  */       \
     if (result != __GCONV_ILLEGAL_INPUT)                                     \
       {                                                                              \
-       if (__builtin_expect (result == __GCONV_FULL_OUTPUT, 0))              \
+       if (__glibc_unlikely (result == __GCONV_FULL_OUTPUT))                 \
          break;                                                              \
                                                                              \
        continue;                                                             \
@@ -442,7 +442,7 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
      bytes from the state and at least one more, or the character is still
      incomplete, or we have some other error (like illegal input character,
      no space in output buffer).  */
-  if (__builtin_expect (inptr != bytebuf, 1))
+  if (__glibc_likely (inptr != bytebuf))
     {
       /* We found a new character.  */
       assert (inptr - bytebuf > (state->__count & 7));
index 7743216835e4c37e67f704afb1834d026bc5d43b..14318a6a5303ebf9343c210c63e0e56fe5d55fac 100644 (file)
@@ -410,7 +410,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
   /* If the function is called with no input this means we have to reset
      to the initial state.  The possibly partly converted input is
      dropped.  */
-  if (__builtin_expect (do_flush, 0))
+  if (__glibc_unlikely (do_flush))
     {
       /* This should never happen during error handling.  */
       assert (outbufstart == NULL);
@@ -461,7 +461,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
 
                      if (result != __GCONV_EMPTY_INPUT)
                        {
-                         if (__builtin_expect (outerr != outbuf, 0))
+                         if (__glibc_unlikely (outerr != outbuf))
                            {
                              /* We have a problem.  Undo the conversion.  */
                              outbuf = outstart;
@@ -604,7 +604,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
          SAVE_RESET_STATE (1);
 #endif
 
-         if (__builtin_expect (!unaligned, 1))
+         if (__glibc_likely (!unaligned))
            {
              if (FROM_DIRECTION)
                /* Run the conversion loop.  */
@@ -635,7 +635,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
 
          /* If we were called as part of an error handling module we
             don't do anything else here.  */
-         if (__builtin_expect (outbufstart != NULL, 0))
+         if (__glibc_unlikely (outbufstart != NULL))
            {
              *outbufstart = outbuf;
              return status;
@@ -653,7 +653,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
 
          /* If this is the last step leave the loop, there is nothing
             we can do.  */
-         if (__builtin_expect (data->__flags & __GCONV_IS_LAST, 0))
+         if (__glibc_unlikely (data->__flags & __GCONV_IS_LAST))
            {
              /* Store information about how many bytes are available.  */
              data->__outbuf = outbuf;
@@ -666,7 +666,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
            }
 
          /* Write out all output which was produced.  */
-         if (__builtin_expect (outbuf > outstart, 1))
+         if (__glibc_likely (outbuf > outstart))
            {
              const unsigned char *outerr = data->__outbuf;
              int result;
@@ -677,7 +677,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
 
              if (result != __GCONV_EMPTY_INPUT)
                {
-                 if (__builtin_expect (outerr != outbuf, 0))
+                 if (__glibc_unlikely (outerr != outbuf))
                    {
 #ifdef RESET_INPUT_BUFFER
                      RESET_INPUT_BUFFER;
@@ -695,7 +695,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
                      SAVE_RESET_STATE (0);
 # endif
 
-                     if (__builtin_expect (!unaligned, 1))
+                     if (__glibc_likely (!unaligned))
                        {
                          if (FROM_DIRECTION)
                            /* Run the conversion loop.  */
@@ -738,7 +738,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
 
                      /* If we haven't consumed a single byte decrement
                         the invocation counter.  */
-                     if (__builtin_expect (outbuf == outstart, 0))
+                     if (__glibc_unlikely (outbuf == outstart))
                        --data->__invocation_counter;
 #endif /* reset input buffer */
                    }
index bc210260ecdf5d5c2b725a23b599947832850c2e..b33a6eafdbc76c4526137dda2561f204827f08d1 100644 (file)
@@ -88,7 +88,7 @@ struct gap
     uint32_t ch = get32 (inptr);                                             \
     unsigned char res;                                                       \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
        rp = NULL;                                                            \
index 8b490d182ae2358f52186719a7baf863df6d0a9b..9b67e62dc319ea109aeb15130aa4b564a75c93d4 100644 (file)
@@ -567,7 +567,7 @@ static const char from_ucs4[][2] =
     /* Now test for a possible second byte and write this if possible.  */    \
     if (cp[1] != '\0')                                                       \
       {                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            /* The result does not fit into the buffer.  */                   \
            --outptr;                                                         \
index 2a5887b1f007e2ee818a0721746368cc0bf9887d..4c8df8e7e012ea64e008ee324b8c5e79835aefa8 100644 (file)
@@ -8401,7 +8401,7 @@ static const char from_ucs4_tab15[][2] =
        uint32_t ch2;                                                         \
        int idx;                                                              \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  */                     \
            result = __GCONV_INCOMPLETE_INPUT;                                \
@@ -8426,7 +8426,7 @@ static const char from_ucs4_tab15[][2] =
        ch = big5_to_ucs[idx];                                                \
                                                                              \
        /* Is this character defined?  */                                     \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            /* This is an illegal character.  */                              \
            STANDARD_FROM_LOOP_ERR_HANDLER (2);                               \
index 90a9bfcf89aa524dac758b800ee332a69658acfd..6084bd81c821bf6accca035051e6112f925a0ecd 100644 (file)
@@ -17774,7 +17774,7 @@ static struct
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -17787,7 +17787,7 @@ static struct
        }                                                                     \
       else                                                                   \
        {                                                                     \
-         if (__builtin_expect (outbuf + 2 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 2 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              uint32_t lasttwo = data->__statep->__count >> 3;                \
@@ -17814,7 +17814,7 @@ static struct
                                                                              \
     /* Determine whether there is a buffered character pending.  */          \
     ch = *statep >> 3;                                                       \
-    if (__builtin_expect (ch == 0, 1))                                       \
+    if (__glibc_likely (ch == 0))                                            \
       {                                                                              \
        /* No - so look at the next input byte.  */                           \
        ch = *inptr;                                                          \
@@ -17826,7 +17826,7 @@ static struct
            uint32_t ch2;                                                     \
            int idx;                                                          \
                                                                              \
-           if (__builtin_expect (inptr + 1 >= inend, 0))                     \
+           if (__glibc_unlikely (inptr + 1 >= inend))                        \
              {                                                               \
                /* The second character is not available.  */                 \
                result = __GCONV_INCOMPLETE_INPUT;                            \
@@ -17887,7 +17887,7 @@ static struct
                                                                              \
            inptr += 2;                                                       \
          }                                                                   \
-       else if (__builtin_expect (ch == 0xff, 0))                            \
+       else if (__glibc_unlikely (ch == 0xff))                               \
          {                                                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
          }                                                                   \
@@ -17937,7 +17937,7 @@ static struct
          goto not_combining;                                                 \
                                                                              \
        /* Output the combined character.  */                                 \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -17950,7 +17950,7 @@ static struct
                                                                              \
       not_combining:                                                         \
        /* Output the buffered character.  */                                 \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -17992,7 +17992,7 @@ static struct
        else                                                                  \
          {                                                                   \
           /* Check for possible combining character.  */                     \
-           if (__builtin_expect (ch == 0xca || ch == 0xea, 0))               \
+           if (__glibc_unlikely (ch == 0xca || ch == 0xea))                  \
              {                                                               \
                *statep = ((cp[0] << 8) | cp[1]) << 3;                        \
                inptr += 4;                                                   \
@@ -18009,7 +18009,7 @@ static struct
              }                                                               \
                                                                              \
            *outptr++ = cp[0];                                                \
-           if (__builtin_expect (cp[1] != '\0', 1))                          \
+           if (__glibc_likely (cp[1] != '\0'))                               \
              *outptr++ = cp[1];                                              \
          }                                                                   \
       }                                                                              \
index 9a05d3020cf3a6b0309cdf1980f4a31533ecc0bf..3106d2062f9241d9fb8e877941700b27e97928f3 100644 (file)
@@ -65,7 +65,7 @@
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -201,7 +201,7 @@ static const struct { unsigned int idx; unsigned int len; } comp_table[8] = {
     if (ch >= 0x80)                                                          \
       {                                                                              \
        ch = to_ucs4[ch - 0x80];                                              \
-       if (__builtin_expect (ch == L'\0', 0))                                \
+       if (__glibc_unlikely (ch == L'\0'))                                   \
          {                                                                   \
            /* This is an illegal character.  */                              \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
@@ -463,7 +463,7 @@ static const struct {
            res = 0;                                                          \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (res != 0, 1))                                   \
+       if (__glibc_likely (res != 0))                                        \
          {                                                                   \
            *outptr++ = res;                                                  \
            inptr += 4;                                                       \
@@ -515,7 +515,7 @@ static const struct {
                if (decomp_table[i].comb2 < 0)                                \
                  {                                                           \
                    /* See whether we have room for two bytes.  */            \
-                   if (__builtin_expect (outptr + 1 >= outend, 0))           \
+                   if (__glibc_unlikely (outptr + 1 >= outend))              \
                      {                                                       \
                        result = __GCONV_FULL_OUTPUT;                         \
                        break;                                                \
@@ -527,7 +527,7 @@ static const struct {
                else                                                          \
                  {                                                           \
                    /* See whether we have room for three bytes.  */          \
-                   if (__builtin_expect (outptr + 2 >= outend, 0))           \
+                   if (__glibc_unlikely (outptr + 2 >= outend))              \
                      {                                                       \
                        result = __GCONV_FULL_OUTPUT;                         \
                        break;                                                \
index bafa28cc18ae4fff32de3d81e13dbec49b1c7586..6dc13b2bdf0d4bddba44b8f439b203ee5e8d6f0e 100644 (file)
@@ -66,7 +66,7 @@
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -375,7 +375,7 @@ static const struct
     if (ch >= 0x80)                                                          \
       {                                                                              \
        ch = to_ucs4[ch - 0x80];                                              \
-       if (__builtin_expect (ch == L'\0', 0))                                \
+       if (__glibc_unlikely (ch == L'\0'))                                   \
          {                                                                   \
            /* This is an illegal character.  */                              \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
@@ -802,7 +802,7 @@ static const struct
            res = 0;                                                          \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (res != 0, 1))                                   \
+       if (__glibc_likely (res != 0))                                        \
          {                                                                   \
            *outptr++ = res;                                                  \
            inptr += 4;                                                       \
@@ -845,7 +845,7 @@ static const struct
                  }                                                           \
                                                                              \
                /* See whether we have room for two bytes.  */                \
-               if (__builtin_expect (outptr + 1 >= outend, 0))               \
+               if (__glibc_unlikely (outptr + 1 >= outend))                  \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
index b8269ac061ad72d963fc4eb5d9f32154f38a654f..c467aaa2bb6ee86cc9a61a86be6b7936716571ac 100644 (file)
@@ -4574,7 +4574,7 @@ static const char from_ucs4_extra[229][2] =
        uint32_t ch2;                                                         \
        uint_fast32_t idx;                                                    \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store                  \
               the intermediate result.  */                                   \
@@ -4704,7 +4704,7 @@ static const char from_ucs4_extra[229][2] =
        /* Now test for a possible second byte and write this if possible.  */\
        if (cp[1] != '\0')                                                    \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                /* The result does not fit into the buffer.  */               \
                result = __GCONV_FULL_OUTPUT;                                 \
index 0b8a74b706bfc270555d3b4ff294156b28bc433d..246ef5d70c76fbdd95a91873aafd0baed4234a4c 100644 (file)
@@ -56,7 +56,7 @@
             next byte is also available.  */                                 \
          const unsigned char *endp;                                          \
                                                                              \
-         if (__builtin_expect (inptr + 1 >= inend, 0))                       \
+         if (__glibc_unlikely (inptr + 1 >= inend))                          \
            {                                                                 \
              /* The second character is not available.  Store                \
                 the intermediate result.  */                                 \
          ch = inptr[1];                                                      \
                                                                              \
          /* All second bytes of a multibyte character must be >= 0xa1. */    \
-         if (__builtin_expect (ch < 0xa1, 0))                                \
+         if (__glibc_unlikely (ch < 0xa1))                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
                                                                              \
          /* This is code set 1: GB 2312-80.  */                              \
          endp = inptr;                                                       \
                                                                              \
          ch = gb2312_to_ucs4 (&endp, 2, 0x80);                               \
-         if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))               \
+         if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                  \
            {                                                                 \
              /* This is an illegal character.  */                            \
              STANDARD_FROM_LOOP_ERR_HANDLER (2);                             \
index 2737842de143b992566aaa9e0bfdd233779a4d52..ff4e46fdda08cac4df1261cb34ca60e94026c92f 100644 (file)
@@ -79,7 +79,7 @@
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -92,7 +92,7 @@
        }                                                                     \
       else                                                                   \
        {                                                                     \
-         if (__builtin_expect (outbuf + 2 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 2 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              uint32_t lasttwo = data->__statep->__count >> 3;                \
                                                                              \
     /* Determine whether there is a buffered character pending.  */          \
     ch = *statep >> 3;                                                       \
-    if (__builtin_expect (ch == 0, 1))                                       \
+    if (__glibc_likely (ch == 0))                                            \
       {                                                                              \
        /* No - so look at the next input byte.  */                           \
        ch = *inptr;                                                          \
            /* Two or three byte character.  */                               \
            uint32_t ch2;                                                     \
                                                                              \
-           if (__builtin_expect (inptr + 1 >= inend, 0))                     \
+           if (__glibc_unlikely (inptr + 1 >= inend))                        \
              {                                                               \
                /* The second byte is not available.  */                      \
                result = __GCONV_INCOMPLETE_INPUT;                            \
            ch2 = inptr[1];                                                   \
                                                                              \
            /* The second byte must be >= 0xa1 and <= 0xfe.  */               \
-           if (__builtin_expect (ch2 < 0xa1 || ch2 > 0xfe, 0))               \
+           if (__glibc_unlikely (ch2 < 0xa1 || ch2 > 0xfe))                  \
              {                                                               \
                /* This is an illegal character.  */                          \
                STANDARD_FROM_LOOP_ERR_HANDLER (1);                           \
            if (ch == 0x8e)                                                   \
              {                                                               \
                /* Half-width katakana.  */                                   \
-               if (__builtin_expect (ch2 > 0xdf, 0))                         \
+               if (__glibc_unlikely (ch2 > 0xdf))                            \
                  STANDARD_FROM_LOOP_ERR_HANDLER (1);                         \
                                                                              \
                ch = ch2 + 0xfec0;                                            \
                    /* JISX 0213 plane 2.  */                                 \
                    uint32_t ch3;                                             \
                                                                              \
-                   if (__builtin_expect (inptr + 2 >= inend, 0))             \
+                   if (__glibc_unlikely (inptr + 2 >= inend))                \
                      {                                                       \
                        /* The third byte is not available.  */               \
                        result = __GCONV_INCOMPLETE_INPUT;                    \
@@ -323,7 +323,7 @@ static const struct
        if (len > 0)                                                          \
          {                                                                   \
            /* Output the combined character.  */                             \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -338,7 +338,7 @@ static const struct
                                                                              \
       not_combining:                                                         \
        /* Output the buffered character.  */                                 \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -355,7 +355,7 @@ static const struct
     else if (ch >= 0xff61 && ch <= 0xff9f)                                   \
       {                                                                              \
        /* Half-width katakana.  */                                           \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -389,7 +389,7 @@ static const struct
        if (jch & 0x8000)                                                     \
          {                                                                   \
            /* JISX 0213 plane 2.  */                                         \
-           if (__builtin_expect (outptr + 2 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 2 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -399,7 +399,7 @@ static const struct
        else                                                                  \
          {                                                                   \
            /* JISX 0213 plane 1.  */                                         \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
index 5ec40ad6cced550f3143d49c8d24f4976bb150fa..854e3017fe2e8d978ae2dbe1e743dbfe4dc766b4 100644 (file)
@@ -4673,7 +4673,7 @@ static const unsigned char from_ucs4_extra[229][2] =
           character is also available.  */                                   \
        unsigned char ch2;                                                    \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result.  */                                       \
@@ -4684,7 +4684,7 @@ static const unsigned char from_ucs4_extra[229][2] =
        ch2 = (unsigned char)inptr[1];                                        \
                                                                              \
        /* All second bytes of a multibyte character must be >= 0xa1. */      \
-       if (__builtin_expect (ch2 < 0xa1, 0))                                 \
+       if (__glibc_unlikely (ch2 < 0xa1))                                    \
          {                                                                   \
            /* This is an illegal character.  */                              \
            if (! ignore_errors_p ())                                         \
@@ -4703,7 +4703,7 @@ static const unsigned char from_ucs4_extra[229][2] =
            /* This is code set 2: half-width katakana.  */                   \
            ch = jisx0201_to_ucs4 (ch2);                                      \
            /*if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR)*/         \
-           if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))             \
+           if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                \
              {                                                               \
                /* Illegal character.  */                                     \
                if (! ignore_errors_p ())                                     \
@@ -4896,15 +4896,15 @@ static const unsigned char from_ucs4_extra[229][2] =
        /* Now test for a possible second byte and write this if possible.  */\
        if (cp[1] != '\0')                                                    \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                /* The result does not fit into the buffer.  */               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
              }                                                               \
-           if (__builtin_expect (cp[1] < 0x80, 0))                           \
+           if (__glibc_unlikely (cp[1] < 0x80))                              \
              {                                                               \
-               if (__builtin_expect (outptr + 2 >= outend, 0))               \
+               if (__glibc_unlikely (outptr + 2 >= outend))                  \
                  {                                                           \
                    /* The result does not fit into the buffer.  */           \
                    result = __GCONV_FULL_OUTPUT;                             \
index b903091ff76d940f36858a7bbf935a7ade515d9e..a7f2ae351c08baf82b2578231beff3d206f54477 100644 (file)
@@ -57,7 +57,7 @@
           byte is also available.  */                                        \
        int ch2;                                                              \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second byte is not available.  Store the                   \
               intermediate result.  */                                       \
@@ -68,7 +68,7 @@
        ch2 = inptr[1];                                                       \
                                                                              \
        /* All second bytes of a multibyte character must be >= 0xa1. */      \
-       if (__builtin_expect (ch2 < 0xa1, 0))                                 \
+       if (__glibc_unlikely (ch2 < 0xa1))                                    \
          STANDARD_FROM_LOOP_ERR_HANDLER (1);                                 \
                                                                              \
        if (ch == 0x8e)                                                       \
                result = __GCONV_INCOMPLETE_INPUT;                            \
                break;                                                        \
              }                                                               \
-           if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))             \
+           if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                \
              /* Illegal character.  */                                       \
              STANDARD_FROM_LOOP_ERR_HANDLER (1);                             \
                                                                              \
        size_t found;                                                         \
                                                                              \
        /* See whether we have room for at least two characters.  */          \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index d4f0e00ca4d1c74368feae27d9ccef69447172ef..f14d989385e023fea995e2bd30e7e15cfdd50772 100644 (file)
@@ -93,13 +93,13 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
        /* Two-byte character.  First test whether the next byte              \
           is also available.  */                                             \
        ch = ksc5601_to_ucs4 (&inptr, inend - inptr, 0x80);                   \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            /* The second byte is not available.  */                          \
            result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
-       if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))                 \
+       if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                    \
          /* This is an illegal character.  */                                \
          STANDARD_FROM_LOOP_ERR_HANDLER (2);                                 \
       }                                                                              \
@@ -144,7 +144,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
     /* Now test for a possible second byte and write this if possible.  */    \
     if (cp[1] != '\0')                                                       \
       {                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            /* The result does not fit into the buffer.  */                   \
            --outptr;                                                         \
index 4302fbf817728ce64d3c36d8904b8167b0c71ea2..4eaa8b5e653e545cff0dd672e50805f193bc65f0 100644 (file)
@@ -24212,7 +24212,7 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
                                                                              \
              inptr += 4;                                                     \
            }                                                                 \
-         else if (__builtin_expect (ch2 >= 0x40, 1))                         \
+         else if (__glibc_likely (ch2 >= 0x40))                              \
            {                                                                 \
              /* A two-byte character */                                      \
              idx = (ch - 0x81) * 192 + (ch2 - 0x40);                         \
@@ -24375,7 +24375,7 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
          {                                                                   \
            /* See whether there is enough room for all four bytes we         \
               write.  */                                                     \
-           if (__builtin_expect (outptr + 3 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 3 >= outend))                      \
              {                                                               \
                /* We have not enough room.  */                               \
                result = __GCONV_FULL_OUTPUT;                                 \
index 9a68c5cc7da89ef666e722fa753c952d876a021e..1eb1067bb1c16b0165afa6acad69b01e05d805a1 100644 (file)
@@ -4805,7 +4805,7 @@ const char __from_big5_to_gb2312 [13973][2] =
        const char *cp;                                                       \
        int idx;                                                              \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store                  \
               the intermediate result.  */                                   \
@@ -4817,7 +4817,7 @@ const char __from_big5_to_gb2312 [13973][2] =
        ch = inptr[1];                                                        \
                                                                              \
        /* All second bytes of a multibyte character must be >= 0xa1. */      \
-       if (__builtin_expect (ch < 0xa1, 0))                                  \
+       if (__glibc_unlikely (ch < 0xa1))                                     \
          {                                                                   \
            /* This is an illegal character.  */                              \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
@@ -4827,7 +4827,7 @@ const char __from_big5_to_gb2312 [13973][2] =
                                                                              \
        /* Get the value from the table.  */                                  \
        cp = __from_gb2312_to_big5[idx];                                      \
-       if (__builtin_expect (cp[0] == '\0', 0))                              \
+       if (__glibc_unlikely (cp[0] == '\0'))                                 \
          {                                                                   \
            /* We do not have a mapping for this character.                   \
               If ignore errors, map it to 0xa1bc - big5 box character */     \
@@ -4836,7 +4836,7 @@ const char __from_big5_to_gb2312 [13973][2] =
              break;                                                          \
                                                                              \
            /* See if there is enough room to write the second byte. */       \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -4894,7 +4894,7 @@ const char __from_big5_to_gb2312 [13973][2] =
        const char *cp;                                                       \
        int idx;                                                              \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store                  \
               the intermediate result.  */                                   \
@@ -4918,7 +4918,7 @@ const char __from_big5_to_gb2312 [13973][2] =
                                                                              \
        /* Get the value from the table.  */                                  \
        cp = __from_big5_to_gb2312 [idx];                                     \
-       if (__builtin_expect (cp[0] == '\0', 0))                              \
+       if (__glibc_unlikely (cp[0] == '\0'))                                 \
          {                                                                   \
            /* We do not have a mapping for this character.                   \
               If ignore errors, map it to 0xa1f5 - gb box character */       \
@@ -4927,7 +4927,7 @@ const char __from_big5_to_gb2312 [13973][2] =
              break;                                                          \
                                                                              \
            /* See if there is enough room to write the second byte. */       \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
index b870d9d8fbcf9c27ecff7b64b365e7ffda0e6949..88f9cd994ed208488ccc0f0af7366e062ff295ab 100644 (file)
@@ -73,7 +73,7 @@
                UCS4 -> GB2312 -> GBK -> UCS4                                 \
                                                                              \
           might not produce identical text.  */                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store                  \
               the intermediate result.  */                                   \
@@ -81,7 +81,7 @@
            break;                                                            \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outend - outptr < 2, 0))                        \
+       if (__glibc_unlikely (outend - outptr < 2))                           \
          {                                                                   \
            /* We ran out of space.  */                                       \
            result = __GCONV_FULL_OUTPUT;                                     \
@@ -91,7 +91,7 @@
        ch = (ch << 8) | inptr[1];                                            \
                                                                              \
        /* Map 0xA844 (U2015 in GBK) to 0xA1AA (U2015 in GB2312).  */         \
-       if (__builtin_expect (ch == 0xa844, 0))                               \
+       if (__glibc_unlikely (ch == 0xa844))                                  \
          ch = 0xa1aa;                                                        \
                                                                              \
        /* Now determine whether the character is valid.  */                  \
                                                                              \
     if (ch > 0x7f)                                                           \
       {                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store                  \
                 the intermediate result.  */                                 \
            break;                                                            \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outend - outptr < 2, 0))                        \
+       if (__glibc_unlikely (outend - outptr < 2))                           \
          {                                                                   \
            /* We ran out of space.  */                                       \
            result = __GCONV_FULL_OUTPUT;                                     \
index 2f7d7fb886f804e536770829b4a3f85d86b365a4..05d7eb8114feffa880f53789d3e42c8287d7f7cc 100644 (file)
@@ -13157,7 +13157,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
          uint32_t ch2;                                                       \
          int idx;                                                            \
                                                                              \
-         if (__builtin_expect (inptr + 1 >= inend, 0))                       \
+         if (__glibc_unlikely (inptr + 1 >= inend))                          \
            {                                                                 \
              /* The second character is not available.  Store                \
                 the intermediate result.  */                                 \
index 373d49a7437c4860efe1b59855a08b5a4f0c2dcd..9de32c576a8da026e5f0868f95ed744e3ac1e431 100644 (file)
@@ -77,7 +77,7 @@
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf >= outend, 0))                         \
+         if (__glibc_unlikely (outbuf >= outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -120,7 +120,7 @@ enum
     else                                                                     \
       {                                                                              \
        /* This is a combined character.  Make sure we have room.  */         \
-       if (__builtin_expect (outptr + 8 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 8 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -204,7 +204,7 @@ enum
       {                                                                              \
        assert (curcs == db);                                                 \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result.  */                                       \
@@ -274,7 +274,7 @@ enum
            curcs = db;                                                       \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outptr + 2 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 2 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -301,7 +301,7 @@ enum
   {                                                                          \
     uint32_t ch = get32 (inptr);                                             \
                                                                              \
-    if (__builtin_expect (ch >= UCS_LIMIT, 0))                               \
+    if (__glibc_unlikely (ch >= UCS_LIMIT))                                  \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
@@ -353,7 +353,7 @@ enum
                curcs = db;                                                   \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -364,13 +364,13 @@ enum
       }                                                                              \
     else                                                                     \
       {                                                                              \
-       if (__builtin_expect (curcs == db, 0))                                \
+       if (__glibc_unlikely (curcs == db))                                   \
          {                                                                   \
            /* We know there is room for at least one byte.  */               \
            *outptr++ = SI;                                                   \
            curcs = sb;                                                       \
                                                                              \
-           if (__builtin_expect (outptr >= outend, 0))                       \
+           if (__glibc_unlikely (outptr >= outend))                          \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
index 83276905a01a1e32be35e64759b8572e84cd56f4..1c50f1f3ac5bc1bcf8d694cb428c009c39c031bd 100644 (file)
@@ -61,7 +61,7 @@
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf >= outend, 0))                         \
+         if (__glibc_unlikely (outbuf >= outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -150,7 +150,7 @@ enum
                                                                              \
        assert (curcs == db);                                                 \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result. */                                        \
@@ -197,7 +197,7 @@ enum
     const struct gap *rp2 = __ucs4_to_ibm930db_idx;                          \
     const char *cp;                                                          \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
@@ -227,7 +227,7 @@ enum
          {                                                                   \
            if (curcs == sb)                                                  \
              {                                                               \
-               if (__builtin_expect (outptr + 1 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 1 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -236,7 +236,7 @@ enum
                curcs = db;                                                   \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -249,7 +249,7 @@ enum
       {                                                                              \
        if (curcs == db)                                                      \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 1 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -257,7 +257,7 @@ enum
            *outptr++ = SI;                                                   \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 4ceeaae5b96088c23bc849b56321864e5321703e..cd4361996326eefce2c5a1322135737c2bd6eb45 100644 (file)
@@ -64,7 +64,7 @@
     if (__builtin_expect (res == 0, 0) && ch != 0)                           \
       {                                                                              \
        /* Use the IBM932 table for double byte.  */                          \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.                         \
               Store the intermediate result.  */                             \
     uint32_t high;                                                           \
     uint16_t pccode;                                                         \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
        rp = NULL;                                                            \
        high = (sizeof (__ucs4_to_ibm932db) >> 1)                             \
                / sizeof (__ucs4_to_ibm932db[0][FROM]);                       \
        pccode = ch;                                                          \
-       if (__builtin_expect (rp != NULL, 1))                                 \
+       if (__glibc_likely (rp != NULL))                                      \
          while (low < high)                                                  \
            {                                                                 \
              i = (low + high) >> 1;                                          \
            }                                                                 \
        if (found)                                                            \
          {                                                                   \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
       }                                                                              \
     else                                                                     \
       {                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 4723df4890b273ea8c7e9977f79177ef6bccf63b..149902b42c15477a11e414f9b8c638f63d4dc39f 100644 (file)
@@ -61,7 +61,7 @@
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf >= outend, 0))                         \
+         if (__glibc_unlikely (outbuf >= outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -149,7 +149,7 @@ enum
        assert (curcs == db);                                                 \
                                                                              \
        /* Use the IBM933 table for double byte.  */                          \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result. */                                        \
@@ -196,7 +196,7 @@ enum
     const struct gap *rp2 = __ucs4_to_ibm933db_idx;                          \
     const char *cp;                                                          \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
@@ -226,7 +226,7 @@ enum
          {                                                                   \
            if (curcs == sb)                                                  \
              {                                                               \
-               if (__builtin_expect (outptr + 1 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 1 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -235,7 +235,7 @@ enum
                curcs = db;                                                   \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -248,7 +248,7 @@ enum
       {                                                                              \
        if (curcs == db)                                                      \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 1 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -256,7 +256,7 @@ enum
            *outptr++ = SI;                                                   \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 1ed311b01fd4ea0e17a59c9bacc140ec4ff59dda..9a7a862ef22b675e40d1ebf51cc1ea64bb0335fa 100644 (file)
@@ -61,7 +61,7 @@
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf >= outend, 0))                         \
+         if (__glibc_unlikely (outbuf >= outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -149,7 +149,7 @@ enum
        assert (curcs == db);                                                 \
                                                                              \
        /* Use the IBM935 table for double byte.  */                          \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.                         \
               Store the intermediate result. */                              \
@@ -196,7 +196,7 @@ enum
     const struct gap *rp2 = __ucs4_to_ibm935db_idx;                          \
     const char *cp;                                                          \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
@@ -226,7 +226,7 @@ enum
          {                                                                   \
            if (curcs == sb)                                                  \
              {                                                               \
-               if (__builtin_expect (outptr + 1 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 1 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -235,7 +235,7 @@ enum
                curcs = db;                                                   \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -248,7 +248,7 @@ enum
       {                                                                              \
        if (curcs == db)                                                      \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 1 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -256,7 +256,7 @@ enum
            *outptr++ = SI;                                                   \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 1edaf624d0c41c7a935dd801c40051a35fa1ae83..5a4ab9213104b947f23a8190ffd93f867b73c2f9 100644 (file)
@@ -61,7 +61,7 @@
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf >= outend, 0))                         \
+         if (__glibc_unlikely (outbuf >= outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -149,7 +149,7 @@ enum
        assert (curcs == db);                                                 \
                                                                              \
        /* Use the IBM937 table for double byte.  */                          \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.                         \
               Store the intermediate result. */                              \
@@ -196,7 +196,7 @@ enum
     const struct gap *rp2 = __ucs4_to_ibm937db_idx;                          \
     const char *cp;                                                          \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
@@ -226,7 +226,7 @@ enum
          {                                                                   \
            if (curcs == sb)                                                  \
              {                                                               \
-               if (__builtin_expect (outptr + 1 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 1 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -235,7 +235,7 @@ enum
                curcs = db;                                                   \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -248,7 +248,7 @@ enum
       {                                                                              \
        if (curcs == db)                                                      \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 1 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -256,7 +256,7 @@ enum
            *outptr++ = SI;                                                   \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index b40c486540d771e8ced6e03871854c194717f204..b50792879c4c6dfbf8d988478c3ad92ac37772d0 100644 (file)
@@ -61,7 +61,7 @@
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf >= outend, 0))                         \
+         if (__glibc_unlikely (outbuf >= outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -149,7 +149,7 @@ enum
                                                                              \
        assert (curcs == db);                                                 \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result. */                                        \
@@ -196,7 +196,7 @@ enum
     const struct gap *rp2 = __ucs4_to_ibm939db_idx;                          \
     const char *cp;                                                          \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
        goto ibm939_invalid_char;                                             \
@@ -226,7 +226,7 @@ enum
          {                                                                   \
            if (curcs == sb)                                                  \
              {                                                               \
-               if (__builtin_expect (outptr + 1 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 1 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -235,7 +235,7 @@ enum
                curcs = db;                                                   \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -248,7 +248,7 @@ enum
       {                                                                              \
        if (curcs == db)                                                      \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 1 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -256,7 +256,7 @@ enum
            *outptr++ = SI;                                                   \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 495e37909ea595d01e235efb4f59307c19a5aad2..0ca3327f298569da5b843f65a59e802ab99678c0 100644 (file)
@@ -65,7 +65,7 @@
            __builtin_expect (res == 0, 0) && ch != 0))                       \
       {                                                                              \
        /* Use the IBM943 table for double byte.  */                          \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.                         \
               Store the intermediate result.  */                             \
     uint32_t high;                                                           \
     uint16_t pccode;                                                         \
                                                                              \
-    if (__builtin_expect (ch >= 0xffff, 0))                                  \
+    if (__glibc_unlikely (ch >= 0xffff))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
        rp = NULL;                                                            \
        high = (sizeof (__ucs4_to_ibm943db) >> 1)                             \
                / sizeof (__ucs4_to_ibm943db[0][FROM]);                       \
        pccode = ch;                                                          \
-       if (__builtin_expect (rp != NULL, 1))                                 \
+       if (__glibc_likely (rp != NULL))                                      \
          while (low < high)                                                  \
            {                                                                 \
              i = (low + high) >> 1;                                          \
            }                                                                 \
        if (found)                                                            \
          {                                                                   \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
       }                                                                              \
     else                                                                     \
       {                                                                              \
-       if (__builtin_expect (outptr + 1 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 1 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 64196ac7920f8ed40cfce8abe495fe8c8119880a..147f86915843f5560ab39e53eb4da3fdabb6e2bb 100644 (file)
@@ -137,7 +137,7 @@ enum
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf == outend, 0))                         \
+         if (__glibc_unlikely (outbuf == outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
index 0e5a6aabe79e1fc9f8af903b8fed4cd9cdaca5f6..a28280680970d316ff4cb753a8d5c6da0778ce17 100644 (file)
@@ -88,7 +88,7 @@ enum
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf == outend, 0))                         \
+         if (__glibc_unlikely (outbuf == outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -121,7 +121,7 @@ enum
     uint32_t ch = *inptr;                                                    \
                                                                              \
     /* This is a 7bit character set, disallow all 8bit characters.  */       \
-    if (__builtin_expect (ch >= 0x7f, 0))                                    \
+    if (__glibc_unlikely (ch >= 0x7f))                                       \
       STANDARD_FROM_LOOP_ERR_HANDLER (1);                                    \
                                                                              \
     /* Recognize escape sequences.  */                                       \
@@ -246,7 +246,7 @@ enum
          {                                                                   \
            *outptr++ = SI;                                                   \
            set = ASCII_set;                                                  \
-           if (__builtin_expect (outptr == outend, 0))                       \
+           if (__glibc_unlikely (outptr == outend))                          \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -319,7 +319,7 @@ enum
              {                                                               \
                const char *escseq;                                           \
                                                                              \
-               if (__builtin_expect (outptr + 4 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 4 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -342,7 +342,7 @@ enum
                                                                              \
            if (used == CNS11643_2_set)                                       \
              {                                                               \
-               if (__builtin_expect (outptr + 2 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 2 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -357,7 +357,7 @@ enum
                   SO charset.  */                                            \
                if (set == ASCII_set)                                         \
                  {                                                           \
-                   if (__builtin_expect (outptr + 1 > outend, 0))            \
+                   if (__glibc_unlikely (outptr + 1 > outend))               \
                      {                                                       \
                        result = __GCONV_FULL_OUTPUT;                         \
                        break;                                                \
@@ -368,13 +368,13 @@ enum
                                                                              \
            /* Always test the length here since we have used up all the      \
               guaranteed output buffer slots.  */                            \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
              }                                                               \
          }                                                                   \
-       else if (__builtin_expect (outptr + 2 > outend, 0))                   \
+       else if (__glibc_unlikely (outptr + 2 > outend))                      \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index e90d68a44410a71656beb2695800f2625b9cdbc7..b676aa19a4a99b7f276206b43f8cc3c307b7d2bd 100644 (file)
@@ -96,7 +96,7 @@ enum
            + ((data->__statep->__count & CURRENT_SEL_MASK) != ASCII_set      \
               ? 3 : 0);                                                      \
                                                                              \
-         if (__builtin_expect (outbuf + need > outend, 0))                   \
+         if (__glibc_unlikely (outbuf + need > outend))                      \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -153,7 +153,7 @@ enum
     uint32_t ch = *inptr;                                                    \
                                                                              \
     /* Recognize escape sequences.  */                                       \
-    if (__builtin_expect (ch == ESC, 0))                                     \
+    if (__glibc_unlikely (ch == ESC))                                        \
       {                                                                              \
        /* We now must be prepared to read two to three more bytes.           \
           If we have a match in the first byte but then the input buffer     \
@@ -242,7 +242,7 @@ enum
       {                                                                              \
        /* Use the JIS X 0201 table.  */                                      \
        ch = jisx0201_to_ucs4 (ch);                                           \
-       if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))                 \
+       if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                    \
          {                                                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
          }                                                                   \
@@ -252,7 +252,7 @@ enum
       {                                                                              \
        /* Use the JIS X 0201 table.  */                                      \
        ch = jisx0201_to_ucs4 (ch + 0x80);                                    \
-       if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))                 \
+       if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                    \
          {                                                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
          }                                                                   \
@@ -266,19 +266,19 @@ enum
           provide the appropriate tables.  */                                \
        ch = jisx0208_to_ucs4 (&inptr, inend - inptr, 0);                     \
                                                                              \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
-       else if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))            \
+       else if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))               \
          {                                                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
          }                                                                   \
       }                                                                              \
     else /* (set == JISX0213_1_2004_set || set == JISX0213_2_set) */         \
       {                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
@@ -416,7 +416,7 @@ static const struct
               || (set != JISX0213_1_2000_set && set != JISX0213_1_2004_set)  \
               ? 4 : 0);                                                      \
                                                                              \
-           if (__builtin_expect (outptr + need + 2 > outend, 0))             \
+           if (__glibc_unlikely (outptr + need + 2 > outend))                \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -444,7 +444,7 @@ static const struct
        {                                                                     \
          size_t need = (lasttwo >> 16 ? 3 : 0);                              \
                                                                              \
-         if (__builtin_expect (outptr + need + 2 > outend, 0))               \
+         if (__glibc_unlikely (outptr + need + 2 > outend))                  \
            {                                                                 \
              result = __GCONV_FULL_OUTPUT;                                   \
              break;                                                          \
@@ -520,7 +520,7 @@ static const struct
                inptr += 4;                                                   \
                continue;                                                     \
              }                                                               \
-           if (__builtin_expect (written == 0, 0))                           \
+           if (__glibc_unlikely (written == 0))                              \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -558,7 +558,7 @@ static const struct
                continue;                                                     \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -578,7 +578,7 @@ static const struct
       {                                                                              \
        /* We must encode using ASCII.  First write out the escape            \
           sequence.  */                                                      \
-       if (__builtin_expect (outptr + 3 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 3 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -589,7 +589,7 @@ static const struct
        *outptr++ = 'B';                                                      \
        set = ASCII_set;                                                      \
                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -606,7 +606,7 @@ static const struct
          {                                                                   \
            if (set != JISX0201_Roman_set)                                    \
              {                                                               \
-               if (__builtin_expect (outptr + 3 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 3 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -617,7 +617,7 @@ static const struct
                set = JISX0201_Roman_set;                                     \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr >= outend, 0))                       \
+           if (__glibc_unlikely (outptr >= outend))                          \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -644,7 +644,7 @@ static const struct
                                                                              \
                if (set != JISX0208_1983_set)                                 \
                  {                                                           \
-                   if (__builtin_expect (outptr + 3 > outend, 0))            \
+                   if (__glibc_unlikely (outptr + 3 > outend))               \
                      {                                                       \
                        result = __GCONV_FULL_OUTPUT;                         \
                        break;                                                \
@@ -655,7 +655,7 @@ static const struct
                    set = JISX0208_1983_set;                                  \
                  }                                                           \
                                                                              \
-               if (__builtin_expect (outptr + 2 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 2 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -677,7 +677,7 @@ static const struct
                                                                              \
                    if (set != new_set)                                       \
                      {                                                       \
-                       if (__builtin_expect (outptr + 4 > outend, 0))        \
+                       if (__glibc_unlikely (outptr + 4 > outend))           \
                          {                                                   \
                            result = __GCONV_FULL_OUTPUT;                     \
                            break;                                            \
@@ -703,7 +703,7 @@ static const struct
                        continue;                                             \
                      }                                                       \
                                                                              \
-                   if (__builtin_expect (outptr + 1 >= outend, 0))           \
+                   if (__glibc_unlikely (outptr + 1 >= outend))              \
                      {                                                       \
                        result = __GCONV_FULL_OUTPUT;                         \
                        break;                                                \
@@ -732,7 +732,7 @@ static const struct
                            set = JISX0201_Kana_set;                          \
                          }                                                   \
                                                                              \
-                       if (__builtin_expect (outptr >= outend, 0))           \
+                       if (__glibc_unlikely (outptr >= outend))              \
                          {                                                   \
                            result = __GCONV_FULL_OUTPUT;                     \
                            break;                                            \
index e9d5db4b68e84862f044ab3b5a379a65d85999a3..3428c3211e07b0c2a9f8e3247b68f2682d4e5c94 100644 (file)
@@ -231,7 +231,7 @@ gconv_end (struct __gconv_step *data)
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit the sequence `Esc ( B'.  */                              \
-         if (__builtin_expect (outbuf + 3 > outend, 0))                      \
+         if (__glibc_unlikely (outbuf + 3 > outend))                         \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -404,7 +404,7 @@ gconv_end (struct __gconv_step *data)
       {                                                                              \
        /* Use the JIS X 0201 table.  */                                      \
        ch = jisx0201_to_ucs4 (ch);                                           \
-       if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))                 \
+       if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                    \
          STANDARD_FROM_LOOP_ERR_HANDLER (1);                                 \
        ++inptr;                                                              \
       }                                                                              \
@@ -412,7 +412,7 @@ gconv_end (struct __gconv_step *data)
       {                                                                              \
        /* Use the JIS X 0201 table.  */                                      \
        ch = jisx0201_to_ucs4 (ch + 0x80);                                    \
-       if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))                 \
+       if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                    \
          STANDARD_FROM_LOOP_ERR_HANDLER (1);                                 \
        ++inptr;                                                              \
       }                                                                              \
@@ -438,12 +438,12 @@ gconv_end (struct __gconv_step *data)
            ch = ksc5601_to_ucs4 (&inptr, inend - inptr, 0);                  \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
-       else if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))            \
+       else if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))               \
          {                                                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
          }                                                                   \
@@ -493,7 +493,7 @@ static const cvlist_t conversion_lists[4] =
     if (var == iso2022jp2)                                                   \
       {                                                                              \
        /* Handle Unicode tag characters (range U+E0000..U+E007F).  */        \
-       if (__builtin_expect ((ch >> 7) == (0xe0000 >> 7), 0))                \
+       if (__glibc_unlikely ((ch >> 7) == (0xe0000 >> 7)))                   \
          {                                                                   \
            ch &= 0x7f;                                                       \
            if (ch >= 'A' && ch <= 'Z')                                       \
@@ -529,7 +529,7 @@ static const cvlist_t conversion_lists[4] =
                                                                              \
        /* Non-tag characters reset the tag parsing state, if the current     \
           state is a temporary state.  */                                    \
-       if (__builtin_expect (tag >= TAG_language, 0))                        \
+       if (__glibc_unlikely (tag >= TAG_language))                           \
          tag = TAG_none;                                                     \
       }                                                                              \
                                                                              \
@@ -613,7 +613,7 @@ static const cvlist_t conversion_lists[4] =
        else                                                                  \
          written = __UNKNOWN_10646_CHAR;                                     \
                                                                              \
-       if (__builtin_expect (written == 0, 0))                               \
+       if (__glibc_unlikely (written == 0))                                  \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -629,7 +629,7 @@ static const cvlist_t conversion_lists[4] =
          {                                                                   \
            if (ch >= 0x80 && ch <= 0xff)                                     \
              {                                                               \
-               if (__builtin_expect (outptr + 3 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 3 > outend))                   \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
@@ -643,7 +643,7 @@ static const cvlist_t conversion_lists[4] =
          }                                                                   \
        else if (set2 == ISO88597_set)                                        \
          {                                                                   \
-           if (__builtin_expect (ch < 0xffff, 1))                            \
+           if (__glibc_likely (ch < 0xffff))                                 \
              {                                                               \
                const struct gap *rp = from_idx;                              \
                                                                              \
@@ -655,7 +655,7 @@ static const cvlist_t conversion_lists[4] =
                      iso88597_from_ucs4[ch - 0xa0 + rp->idx];                \
                    if (res != '\0')                                          \
                      {                                                       \
-                       if (__builtin_expect (outptr + 3 > outend, 0))        \
+                       if (__glibc_unlikely (outptr + 3 > outend))           \
                          {                                                   \
                            result = __GCONV_FULL_OUTPUT;                     \
                            break;                                            \
@@ -685,7 +685,7 @@ static const cvlist_t conversion_lists[4] =
          {                                                                   \
            /* We must encode using ASCII.  First write out the               \
               escape sequence.  */                                           \
-           if (__builtin_expect (outptr + 3 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 3 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -696,7 +696,7 @@ static const cvlist_t conversion_lists[4] =
            *outptr++ = 'B';                                                  \
            set = ASCII_set;                                                  \
                                                                              \
-           if (__builtin_expect (outptr + 1 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 1 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -742,7 +742,7 @@ static const cvlist_t conversion_lists[4] =
                          set2 = ISO88591_set;                                \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 3 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 3 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
@@ -755,7 +755,7 @@ static const cvlist_t conversion_lists[4] =
                    }                                                         \
                                                                              \
                  /* Try ISO 8859-7 upper half.  */                           \
-                 if (__builtin_expect (ch < 0xffff, 1))                      \
+                 if (__glibc_likely (ch < 0xffff))                           \
                    {                                                         \
                      const struct gap *rp = from_idx;                        \
                                                                              \
@@ -817,7 +817,7 @@ static const cvlist_t conversion_lists[4] =
                          set = JISX0201_Roman_set;                           \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 1 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 1 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
@@ -844,7 +844,7 @@ static const cvlist_t conversion_lists[4] =
                          set = JISX0208_1983_set;                            \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 2 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 2 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
@@ -855,7 +855,7 @@ static const cvlist_t conversion_lists[4] =
                      break;                                                  \
                    }                                                         \
                                                                              \
-                 if (__builtin_expect (var == iso2022jp, 0))                 \
+                 if (__glibc_unlikely (var == iso2022jp))                    \
                    /* Don't use the other Japanese character sets.  */       \
                    break;                                                    \
                                                                              \
@@ -877,7 +877,7 @@ static const cvlist_t conversion_lists[4] =
                          set = JISX0212_set;                                 \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 2 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 2 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
@@ -910,7 +910,7 @@ static const cvlist_t conversion_lists[4] =
                          set = GB2312_set;                                   \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 2 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 2 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
@@ -944,7 +944,7 @@ static const cvlist_t conversion_lists[4] =
                          set = KSC5601_set;                                  \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 2 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 2 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
@@ -979,7 +979,7 @@ static const cvlist_t conversion_lists[4] =
                          set = JISX0201_Kana_set;                            \
                        }                                                     \
                                                                              \
-                     if (__builtin_expect (outptr + 1 > outend, 0))          \
+                     if (__glibc_unlikely (outptr + 1 > outend))             \
                        {                                                     \
                          res = __GCONV_FULL_OUTPUT;                          \
                          break;                                              \
index 2377ae5f2a50a8f52273b5420f9a03b54795fef0..14080c10c4b212c098ca74a5590281019dcadf10 100644 (file)
@@ -86,7 +86,7 @@ enum
        {                                                                     \
          /* We are not in the initial state.  To switch back we have         \
             to emit `SI'.  */                                                \
-         if (__builtin_expect (outbuf == outend, 0))                         \
+         if (__glibc_unlikely (outbuf == outend))                            \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
@@ -118,7 +118,7 @@ enum
     uint32_t ch = *inptr;                                                    \
                                                                              \
     /* This is a 7bit character set, disallow all 8bit characters.  */       \
-    if (__builtin_expect (ch > 0x7f, 0))                                     \
+    if (__glibc_unlikely (ch > 0x7f))                                        \
       STANDARD_FROM_LOOP_ERR_HANDLER (1);                                    \
                                                                              \
     /* Recognize escape sequences.  */                                       \
@@ -171,12 +171,12 @@ enum
        /* Use the KSC 5601 table.  */                                        \
        ch = ksc5601_to_ucs4 (&inptr, inend - inptr, 0);                      \
                                                                              \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
-       else if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))            \
+       else if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))               \
          {                                                                   \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
          }                                                                   \
@@ -209,7 +209,7 @@ enum
          {                                                                   \
            *outptr++ = SI;                                                   \
            set = ASCII_set;                                                  \
-           if (__builtin_expect (outptr == outend, 0))                       \
+           if (__glibc_unlikely (outptr == outend))                          \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -243,7 +243,7 @@ enum
                set = KSC5601_set;                                            \
              }                                                               \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
index 35fe93d88061186a8844ea79b202e26a81a0ed3e..b450fcc9622171a92a98768468924efefe49e9d9 100644 (file)
@@ -870,7 +870,7 @@ gconv_end (struct __gconv_step *data)
        ch = 0x5d;                                                            \
        break;                                                                \
       default:                                                               \
-       if (__builtin_expect (ch > 0x7f, 0))                                  \
+       if (__glibc_unlikely (ch > 0x7f))                                     \
          {                                                                   \
            UNICODE_TAG_HANDLER (ch, 4);                                      \
            failure = __GCONV_ILLEGAL_INPUT;                                  \
index 6aa6e3550c0e5cc989f4cf868951534f877c1d44..6610cae415eeb48217efb350d51ad1807294a0bb 100644 (file)
@@ -50,7 +50,7 @@
 #define BODY \
   {                                                                          \
     uint32_t ch = *((const uint32_t *) inptr);                               \
-    if (__builtin_expect (ch > 0xff, 0))                                     \
+    if (__glibc_unlikely (ch > 0xff))                                        \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
index 51aed763e8c742f43f32f2098fc8f56d400344a7..37f55c0d4290dab7adbaf3443d4607b569e127a5 100644 (file)
@@ -53,7 +53,7 @@
 #define BODY \
   {                                                                          \
     uint32_t ch = *((const uint32_t *) inptr);                               \
-    if (__builtin_expect ((ch & 0xffffff00u) != BRAILLE_UCS_BASE, 0))        \
+    if (__glibc_unlikely ((ch & 0xffffff00u) != BRAILLE_UCS_BASE))           \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
                                                                              \
index d5e09a3795b7ab5d98ab75ba2a341c3964eda1ce..03f08734e91cee8cc3a51545448e62c28e77240b 100644 (file)
@@ -397,7 +397,7 @@ static const char from_ucs4[][2] =
           is also available.  */                                             \
        int ch2;                                                              \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result.  */                                       \
@@ -416,7 +416,7 @@ static const char from_ucs4[][2] =
                                                                              \
        ch = to_ucs4_comb[ch - 0xc1][ch2 - 0x20];                             \
                                                                              \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            /* Illegal character.  */                                         \
            STANDARD_FROM_LOOP_ERR_HANDLER (2);                               \
@@ -536,7 +536,7 @@ static const char from_ucs4[][2] =
     /* Now test for a possible second byte and write this if possible.  */    \
     if (cp[1] != '\0')                                                       \
       {                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            /* The result does not fit into the buffer.  */                   \
            --outptr;                                                         \
index 66d86b1dcef334ec5e1865e8c3ce4c0216eca6c1..71a829a71bb962bef940244f418e5e6b2f8ce85f 100644 (file)
@@ -397,7 +397,7 @@ static const char from_ucs4[][2] =
           is also available.  */                                             \
        int ch2;                                                              \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store the              \
               intermediate result.  */                                       \
@@ -416,7 +416,7 @@ static const char from_ucs4[][2] =
                                                                              \
        ch = to_ucs4_comb[ch - 0xc1][ch2 - 0x20];                             \
                                                                              \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            /* Illegal character.  */                                         \
            STANDARD_FROM_LOOP_ERR_HANDLER (2);                               \
@@ -520,7 +520,7 @@ static const char from_ucs4[][2] =
            fail = 1;                                                         \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (fail, 0))                                       \
+       if (__glibc_unlikely (fail))                                          \
          {                                                                   \
            /* Illegal characters.  */                                        \
            STANDARD_TO_LOOP_ERR_HANDLER (4);                                 \
@@ -538,7 +538,7 @@ static const char from_ucs4[][2] =
     /* Now test for a possible second byte and write this if possible.  */    \
     if (cp[1] != '\0')                                                       \
       {                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            /* The result does not fit into the buffer.  */                   \
            --outptr;                                                         \
index fb280a368fa815162b1b4b4c26af9c4724609023..07d6b6d9f882e0020c37b104257c14a64add657e 100644 (file)
@@ -192,7 +192,7 @@ johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)
            uint32_t ch2;                                                     \
            uint_fast32_t idx;                                                \
                                                                              \
-           if (__builtin_expect (inptr + 1 >= inend, 0))                     \
+           if (__glibc_unlikely (inptr + 1 >= inend))                        \
              {                                                               \
                /* The second character is not available.  Store the          \
                   intermediate result.  */                                   \
@@ -202,7 +202,7 @@ johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)
                                                                              \
            ch2 = inptr[1];                                                   \
            idx = ch * 256 + ch2;                                             \
-           if (__builtin_expect (ch <= 0xd3, 1))                             \
+           if (__glibc_likely (ch <= 0xd3))                                  \
              {                                                               \
                /* Hangul */                                                  \
                int_fast32_t i, m, f;                                         \
@@ -262,7 +262,7 @@ johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)
              }                                                               \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            /* This is an illegal character.  */                              \
            STANDARD_FROM_LOOP_ERR_HANDLER (2);                               \
@@ -313,7 +313,7 @@ johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)
       {                                                                              \
        if (ch >= 0xac00 && ch <= 0xd7a3)                                     \
          {                                                                   \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -334,7 +334,7 @@ johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)
          {                                                                   \
            ch = jamo_from_ucs_table[ch - 0x3131];                            \
                                                                              \
-           if (__builtin_expect (outptr + 2 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 2 > outend))                       \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -355,7 +355,7 @@ johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
              }                                                               \
-           if (__builtin_expect (written == __UNKNOWN_10646_CHAR, 0))        \
+           if (__glibc_unlikely (written == __UNKNOWN_10646_CHAR))           \
              {                                                               \
                STANDARD_TO_LOOP_ERR_HANDLER (4);                             \
              }                                                               \
index 94a2d155d61dd4e26872e2ebb24068ffe73fbeb4..a6c19acf3ce6d2ab51e1b78eea19d7368f710f6a 100644 (file)
@@ -79,7 +79,7 @@
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -92,7 +92,7 @@
        }                                                                     \
       else                                                                   \
        {                                                                     \
-         if (__builtin_expect (outbuf + 2 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 2 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              uint32_t lasttwo = data->__statep->__count >> 3;                \
                                                                              \
     /* Determine whether there is a buffered character pending.  */          \
     ch = *statep >> 3;                                                       \
-    if (__builtin_expect (ch == 0, 1))                                       \
+    if (__glibc_likely (ch == 0))                                            \
       {                                                                              \
        /* No - so look at the next input byte.  */                           \
        ch = *inptr;                                                          \
        if (ch < 0x80)                                                        \
          {                                                                   \
            /* Plain ISO646-JP character.  */                                 \
-           if (__builtin_expect (ch == 0x5c, 0))                             \
+           if (__glibc_unlikely (ch == 0x5c))                                \
              ch = 0xa5;                                                      \
-           else if (__builtin_expect (ch == 0x7e, 0))                        \
+           else if (__glibc_unlikely (ch == 0x7e))                           \
              ch = 0x203e;                                                    \
            ++inptr;                                                          \
          }                                                                   \
            /* Two byte character.  */                                        \
            uint32_t ch2;                                                     \
                                                                              \
-           if (__builtin_expect (inptr + 1 >= inend, 0))                     \
+           if (__glibc_unlikely (inptr + 1 >= inend))                        \
              {                                                               \
                /* The second byte is not available.  */                      \
                result = __GCONV_INCOMPLETE_INPUT;                            \
            ch2 = inptr[1];                                                   \
                                                                              \
            /* The second byte must be in the range 0x{40..7E,80..FC}.  */    \
-           if (__builtin_expect (ch2 < 0x40 || ch2 == 0x7f || ch2 > 0xfc, 0))\
+           if (__glibc_unlikely (ch2 < 0x40 || ch2 == 0x7f || ch2 > 0xfc))   \
              {                                                               \
                /* This is an illegal character.  */                          \
                STANDARD_FROM_LOOP_ERR_HANDLER (1);                           \
@@ -332,7 +332,7 @@ static const struct
        if (len > 0)                                                          \
          {                                                                   \
            /* Output the combined character.  */                             \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -347,7 +347,7 @@ static const struct
                                                                              \
       not_combining:                                                         \
        /* Output the buffered character.  */                                 \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -421,7 +421,7 @@ static const struct
          }                                                                   \
                                                                              \
        /* Output the shifted representation.  */                             \
-       if (__builtin_expect (outptr + 1 >= outend, 0))                       \
+       if (__glibc_unlikely (outptr + 1 >= outend))                          \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 34df564201c15fcd14b42be8ba6b245ab2af285b..b0eacd112a77931f6ea9e82b8bf737b1a9d8b3e3 100644 (file)
@@ -4361,7 +4361,7 @@ static const char from_ucs4_extra[0x100][2] =
        uint32_t ch2;                                                         \
        uint_fast32_t idx;                                                    \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second byte is not available.  Store                       \
               the intermediate result.  */                                   \
@@ -4371,7 +4371,7 @@ static const char from_ucs4_extra[0x100][2] =
                                                                              \
        ch2 = inptr[1];                                                       \
        idx = ch * 256 + ch2;                                                 \
-       if (__builtin_expect (ch2 < 0x40, 0))                                 \
+       if (__glibc_unlikely (ch2 < 0x40))                                    \
          {                                                                   \
            /* This is illegal.  */                                           \
            STANDARD_FROM_LOOP_ERR_HANDLER (1);                               \
@@ -4398,7 +4398,7 @@ static const char from_ucs4_extra[0x100][2] =
            else                                                              \
              ch = cjk_block4[(ch - 0xe0) * 192 + ch2 - 0x40];                \
                                                                              \
-           if (__builtin_expect (ch == 0, 0))                                \
+           if (__glibc_unlikely (ch == 0))                                   \
              {                                                               \
                /* This is an illegal character.  */                          \
                STANDARD_FROM_LOOP_ERR_HANDLER (2);                           \
@@ -4469,7 +4469,7 @@ static const char from_ucs4_extra[0x100][2] =
        /* Now test for a possible second byte and write this if possible.  */\
        if (cp[1] != '\0')                                                    \
          {                                                                   \
-           if (__builtin_expect (outptr + 1 >= outend, 0))                   \
+           if (__glibc_unlikely (outptr + 1 >= outend))                      \
              {                                                               \
                /* The result does not fit into the buffer.  */               \
                result = __GCONV_FULL_OUTPUT;                                 \
index e820eb907c0e2a71544e2b3c9066d83b41bd5d72..e20ff863ffc87fb2eb4f25d3eb6b22b046975008 100644 (file)
@@ -390,7 +390,7 @@ static const char from_ucs4[][2] =
           is also available.  */                                             \
        uint32_t ch2;                                                         \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  */                     \
            result = __GCONV_INCOMPLETE_INPUT;                                \
@@ -487,7 +487,7 @@ static const char from_ucs4[][2] =
     /* Now test for a possible second byte and write this if possible.  */    \
     if (cp[1] != '\0')                                                       \
       {                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            /* The result does not fit into the buffer.  */                   \
            --outptr;                                                         \
index 7a3ab455faf0a3893a82f39bf4e80d38abb45585..21e1d4540a07904945d62b16924cccc23aba2c02 100644 (file)
@@ -64,7 +64,7 @@
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -652,7 +652,7 @@ static const struct
            res = 0;                                                          \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (res != 0, 1))                                   \
+       if (__glibc_likely (res != 0))                                        \
          {                                                                   \
            *outptr++ = res;                                                  \
            inptr += 4;                                                       \
@@ -696,7 +696,7 @@ static const struct
                  }                                                           \
                                                                              \
                /* See whether we have room for two bytes.  */                \
-               if (__builtin_expect (outptr + 1 >= outend, 0))               \
+               if (__glibc_unlikely (outptr + 1 >= outend))                  \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \
index e8363d12c99eafe8f2be806aaae9559d6cc62790..8b98a0eaa209b5ac40ceb3753a596e8a71d3f147 100644 (file)
@@ -90,7 +90,7 @@
        {                                                                     \
          do                                                                  \
            {                                                                 \
-             if (__builtin_expect (outbuf + 4 > outend, 0))                  \
+             if (__glibc_unlikely (outbuf + 4 > outend))                     \
                {                                                             \
                  /* We don't have enough room in the output buffer.  */      \
                  status = __GCONV_FULL_OUTPUT;                               \
       else                                                                   \
        {                                                                     \
          uint32_t last = data->__statep->__count >> 3;                       \
-         if (__builtin_expect (last >> 8, 0))                                \
+         if (__glibc_unlikely (last >> 8))                                   \
            {                                                                 \
              /* Write out the last character, two bytes.  */                 \
-             if (__builtin_expect (outbuf + 2 <= outend, 1))                 \
+             if (__glibc_likely (outbuf + 2 <= outend))                      \
                {                                                             \
                  *outbuf++ = last & 0xff;                                    \
                  *outbuf++ = (last >> 8) & 0xff;                             \
          else                                                                \
            {                                                                 \
              /* Write out the last character, a single byte.  */             \
-             if (__builtin_expect (outbuf < outend, 1))                      \
+             if (__glibc_likely (outbuf < outend))                           \
                {                                                             \
                  *outbuf++ = last & 0xff;                                    \
                  data->__statep->__count = 0;                                \
@@ -384,7 +384,7 @@ static const uint32_t tscii_next_state[6] =
                /* See whether we have room for two characters.  Otherwise    \
                   store only the first character now, and put the second     \
                   one into the queue.  */                                    \
-               if (__builtin_expect (outptr + 4 > outend, 0))                \
+               if (__glibc_unlikely (outptr + 4 > outend))                   \
                  {                                                           \
                    *statep = u2 << 8;                                        \
                    result = __GCONV_FULL_OUTPUT;                             \
@@ -421,7 +421,7 @@ static const uint32_t tscii_next_state[6] =
            inptr++;                                                          \
            put32 (outptr, 0x0BB8);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BCD << 8) + (4 << 4);                           \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -429,7 +429,7 @@ static const uint32_t tscii_next_state[6] =
              }                                                               \
            put32 (outptr, 0x0BCD);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BB0 << 8) + (2 << 4);                           \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -437,7 +437,7 @@ static const uint32_t tscii_next_state[6] =
              }                                                               \
            put32 (outptr, 0x0BB0);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BC0 << 8);                                      \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -454,7 +454,7 @@ static const uint32_t tscii_next_state[6] =
            inptr++;                                                          \
            put32 (outptr, 0x0B95);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BCD << 8) + (1 << 4);                           \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -462,7 +462,7 @@ static const uint32_t tscii_next_state[6] =
              }                                                               \
            put32 (outptr, 0x0BCD);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BB7 << 8);                                      \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -479,7 +479,7 @@ static const uint32_t tscii_next_state[6] =
            inptr++;                                                          \
            put32 (outptr, 0x0B95);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BCD << 8) + (5 << 4);                           \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -487,7 +487,7 @@ static const uint32_t tscii_next_state[6] =
              }                                                               \
            put32 (outptr, 0x0BCD);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BB7 << 8) + (3 << 4);                           \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -495,7 +495,7 @@ static const uint32_t tscii_next_state[6] =
              }                                                               \
            put32 (outptr, 0x0BB7);                                           \
            outptr += 4;                                                      \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                *statep = (0x0BCD << 8);                                      \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -592,7 +592,7 @@ static const uint8_t consonant_with_virama[18] =
              }                                                               \
            if (ch == 0x0BC6)                                                 \
              {                                                               \
-               if (__builtin_expect (outptr + 2 <= outend, 1))               \
+               if (__glibc_likely (outptr + 2 <= outend))                    \
                  {                                                           \
                    *outptr++ = 0xa6;                                         \
                    *outptr++ = last;                                         \
@@ -608,7 +608,7 @@ static const uint8_t consonant_with_virama[18] =
              }                                                               \
            if (ch == 0x0BC7)                                                 \
              {                                                               \
-               if (__builtin_expect (outptr + 2 <= outend, 1))               \
+               if (__glibc_likely (outptr + 2 <= outend))                    \
                  {                                                           \
                    *outptr++ = 0xa7;                                         \
                    *outptr++ = last;                                         \
@@ -624,7 +624,7 @@ static const uint8_t consonant_with_virama[18] =
              }                                                               \
            if (ch == 0x0BC8)                                                 \
              {                                                               \
-               if (__builtin_expect (outptr + 2 <= outend, 1))               \
+               if (__glibc_likely (outptr + 2 <= outend))                    \
                  {                                                           \
                    *outptr++ = 0xa8;                                         \
                    *outptr++ = last;                                         \
@@ -640,7 +640,7 @@ static const uint8_t consonant_with_virama[18] =
              }                                                               \
            if (ch == 0x0BCA)                                                 \
              {                                                               \
-               if (__builtin_expect (outptr + 3 <= outend, 1))               \
+               if (__glibc_likely (outptr + 3 <= outend))                    \
                  {                                                           \
                    *outptr++ = 0xa6;                                         \
                    *outptr++ = last;                                         \
@@ -657,7 +657,7 @@ static const uint8_t consonant_with_virama[18] =
              }                                                               \
            if (ch == 0x0BCB)                                                 \
              {                                                               \
-               if (__builtin_expect (outptr + 3 <= outend, 1))               \
+               if (__glibc_likely (outptr + 3 <= outend))                    \
                  {                                                           \
                    *outptr++ = 0xa7;                                         \
                    *outptr++ = last;                                         \
@@ -674,7 +674,7 @@ static const uint8_t consonant_with_virama[18] =
              }                                                               \
            if (ch == 0x0BCC)                                                 \
              {                                                               \
-               if (__builtin_expect (outptr + 3 <= outend, 1))               \
+               if (__glibc_likely (outptr + 3 <= outend))                    \
                  {                                                           \
                    *outptr++ = 0xa7;                                         \
                    *outptr++ = last;                                         \
@@ -771,9 +771,9 @@ static const uint8_t consonant_with_virama[18] =
          }                                                                   \
                                                                              \
        /* Output the buffered character.  */                                 \
-       if (__builtin_expect (last >> 8, 0))                                  \
+       if (__glibc_unlikely (last >> 8))                                     \
          {                                                                   \
-           if (__builtin_expect (outptr + 2 <= outend, 1))                   \
+           if (__glibc_likely (outptr + 2 <= outend))                        \
              {                                                               \
                *outptr++ = last & 0xff;                                      \
                *outptr++ = (last >> 8) & 0xff;                               \
@@ -808,7 +808,7 @@ static const uint8_t consonant_with_virama[18] =
        else if (ch >= 0x0BCA && ch <= 0x0BCC)                                \
          {                                                                   \
            /* See whether we have room for two bytes.  */                    \
-           if (__builtin_expect (outptr + 2 <= outend, 1))                   \
+           if (__glibc_likely (outptr + 2 <= outend))                        \
              {                                                               \
                *outptr++ = (ch == 0x0BCA ? 0xa6 : 0xa7);                     \
                *outptr++ = (ch != 0x0BCC ? 0xa1 : 0xaa);                     \
index 4f5e71486d077e4f0f4711caac186d0b6a00fa73..318c3492b3b685b0a24da0f16a7b2eb4a99941e3 100644 (file)
@@ -3076,7 +3076,7 @@ static const char uhc_hangul_from_ucs[11172][2] =
           is also available.  */                                             \
        uint32_t ch2;                                                         \
                                                                              \
-       if (__builtin_expect (inptr + 1 >= inend, 0))                         \
+       if (__glibc_unlikely (inptr + 1 >= inend))                            \
          {                                                                   \
            /* The second character is not available.  Store                  \
               the intermediate result.  */                                   \
@@ -3123,7 +3123,7 @@ static const char uhc_hangul_from_ucs[11172][2] =
                                     ? (ch - 0x81) * 178                      \
                                     : 5696 + (ch - 0xa1) * 84)];             \
                                                                              \
-           if (__builtin_expect (ch == 0, 0))                                \
+           if (__glibc_unlikely (ch == 0))                                   \
              {                                                               \
                /* This is an illegal character.  */                          \
                STANDARD_FROM_LOOP_ERR_HANDLER (2);                           \
@@ -3173,7 +3173,7 @@ static const char uhc_hangul_from_ucs[11172][2] =
       {                                                                              \
        const char *s = uhc_hangul_from_ucs[ch - 0xac00];                     \
                                                                              \
-       if (__builtin_expect (outptr + 2 > outend, 0))                        \
+       if (__glibc_unlikely (outptr + 2 > outend))                           \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
@@ -3186,12 +3186,12 @@ static const char uhc_hangul_from_ucs[11172][2] =
       {                                                                              \
        size_t written = ucs4_to_ksc5601_hanja (ch, outptr, outend - outptr); \
                                                                              \
-       if (__builtin_expect (written == 0, 0))                               \
+       if (__glibc_unlikely (written == 0))                                  \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
          }                                                                   \
-       if (__builtin_expect (written == __UNKNOWN_10646_CHAR, 0))            \
+       if (__glibc_unlikely (written == __UNKNOWN_10646_CHAR))               \
          {                                                                   \
            STANDARD_TO_LOOP_ERR_HANDLER (4);                                 \
          }                                                                   \
@@ -3213,7 +3213,7 @@ static const char uhc_hangul_from_ucs[11172][2] =
            UNICODE_TAG_HANDLER (ch, 4);                                      \
            STANDARD_TO_LOOP_ERR_HANDLER (4);                                 \
          }                                                                   \
-       if (__builtin_expect (written == 0, 0))                               \
+       if (__glibc_unlikely (written == 0))                                  \
          {                                                                   \
            result = __GCONV_FULL_OUTPUT;                                     \
            break;                                                            \
index 00d63ef338a4ad8c4d34f2c961894384aeb574b8..ed74582badc8671bf765e3838b5264ae7f86091c 100644 (file)
@@ -64,7 +64,7 @@
   else if (!data->__internal_use && data->__invocation_counter == 0)         \
     {                                                                        \
       /* Emit the Byte Order Mark.  */                                       \
-      if (__builtin_expect (outbuf + 2 > outend, 0))                         \
+      if (__glibc_unlikely (outbuf + 2 > outend))                            \
        return __GCONV_FULL_OUTPUT;                                           \
                                                                              \
       put16u (outbuf, BOM);                                                  \
@@ -150,12 +150,12 @@ gconv_end (struct __gconv_step *data)
   {                                                                          \
     uint32_t c = get32 (inptr);                                                      \
                                                                              \
-    if (__builtin_expect (c >= 0x10000, 0))                                  \
+    if (__glibc_unlikely (c >= 0x10000))                                     \
       {                                                                              \
        UNICODE_TAG_HANDLER (c, 4);                                           \
        STANDARD_TO_LOOP_ERR_HANDLER (4);                                     \
       }                                                                              \
-    else if (__builtin_expect (c >= 0xd800 && c < 0xe000, 0))                \
+    else if (__glibc_unlikely (c >= 0xd800 && c < 0xe000))                   \
       {                                                                              \
        /* Surrogate characters in UCS-4 input are not valid.                 \
           We must catch this, because the UCS-2 output might be              \
@@ -195,7 +195,7 @@ gconv_end (struct __gconv_step *data)
     if (swap)                                                                \
       u1 = bswap_16 (u1);                                                    \
                                                                              \
-    if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0))                   \
+    if (__glibc_unlikely (u1 >= 0xd800 && u1 < 0xe000))                              \
       {                                                                              \
        /* Surrogate characters in UCS-2 input are not valid.  Reject         \
           them.  (Catching this here is not security relevant.)  */          \
index 43be4be9c1cc7224efb2518b40c81a3ef7bd0f56..48edfa35f396cf31ac47e5582220f81ba6865aaa 100644 (file)
@@ -43,7 +43,7 @@
 #define PREPARE_LOOP \
   enum direction dir = ((struct utf16_data *) step->__data)->dir;            \
   enum variant var = ((struct utf16_data *) step->__data)->var;                      \
-  if (__builtin_expect (data->__invocation_counter == 0, 0))                 \
+  if (__glibc_unlikely (data->__invocation_counter == 0))                    \
     {                                                                        \
       if (var == UTF_16)                                                     \
        {                                                                     \
@@ -67,7 +67,7 @@
          else if (!FROM_DIRECTION && !data->__internal_use)                  \
            {                                                                 \
              /* Emit the Byte Order Mark.  */                                \
-             if (__builtin_expect (outbuf + 2 > outend, 0))                  \
+             if (__glibc_unlikely (outbuf + 2 > outend))                     \
                return __GCONV_FULL_OUTPUT;                                   \
                                                                              \
              put16u (outbuf, BOM);                                           \
@@ -200,7 +200,7 @@ gconv_end (struct __gconv_step *data)
   {                                                                          \
     uint32_t c = get32 (inptr);                                                      \
                                                                              \
-    if (__builtin_expect (c >= 0xd800 && c < 0xe000, 0))                     \
+    if (__glibc_unlikely (c >= 0xd800 && c < 0xe000))                        \
       {                                                                              \
        /* Surrogate characters in UCS-4 input are not valid.                 \
           We must catch this.  If we let surrogates pass through,            \
@@ -216,15 +216,15 @@ gconv_end (struct __gconv_step *data)
                                                                              \
     if (swap)                                                                \
       {                                                                              \
-       if (__builtin_expect (c >= 0x10000, 0))                               \
+       if (__glibc_unlikely (c >= 0x10000))                                  \
          {                                                                   \
-           if (__builtin_expect (c >= 0x110000, 0))                          \
+           if (__glibc_unlikely (c >= 0x110000))                             \
              {                                                               \
                STANDARD_TO_LOOP_ERR_HANDLER (4);                             \
              }                                                               \
                                                                              \
            /* Generate a surrogate character.  */                            \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                /* Overflow in the output buffer.  */                         \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -240,15 +240,15 @@ gconv_end (struct __gconv_step *data)
       }                                                                              \
     else                                                                     \
       {                                                                              \
-       if (__builtin_expect (c >= 0x10000, 0))                               \
+       if (__glibc_unlikely (c >= 0x10000))                                  \
          {                                                                   \
-           if (__builtin_expect (c >= 0x110000, 0))                          \
+           if (__glibc_unlikely (c >= 0x110000))                             \
              {                                                               \
                STANDARD_TO_LOOP_ERR_HANDLER (4);                             \
              }                                                               \
                                                                              \
            /* Generate a surrogate character.  */                            \
-           if (__builtin_expect (outptr + 4 > outend, 0))                    \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                               \
                /* Overflow in the output buffer.  */                         \
                result = __GCONV_FULL_OUTPUT;                                 \
@@ -296,7 +296,7 @@ gconv_end (struct __gconv_step *data)
                                                                              \
            /* It's a surrogate character.  At least the first word says      \
               it is.  */                                                     \
-           if (__builtin_expect (inptr + 4 > inend, 0))                      \
+           if (__glibc_unlikely (inptr + 4 > inend))                         \
              {                                                               \
                /* We don't have enough input for another complete input      \
                   character.  */                                             \
@@ -330,7 +330,7 @@ gconv_end (struct __gconv_step *data)
          {                                                                   \
            /* It's a surrogate character.  At least the first word says      \
               it is.  */                                                     \
-           if (__builtin_expect (inptr + 4 > inend, 0))                      \
+           if (__glibc_unlikely (inptr + 4 > inend))                         \
              {                                                               \
                /* We don't have enough input for another complete input      \
                   character.  */                                             \
index f21f2be0413b9348bb18f73f6d33f2177d896108..7705d472656de2686c462a03a546bb6983f3138b 100644 (file)
@@ -44,7 +44,7 @@
   int swap;                                                                  \
   if (FROM_DIRECTION && var == UTF_32)                                       \
     {                                                                        \
-      if (__builtin_expect (data->__invocation_counter == 0, 0))             \
+      if (__glibc_unlikely (data->__invocation_counter == 0))                \
        {                                                                     \
          /* We have to find out which byte order the file is encoded in.  */ \
          if (inptr + 4 > inend)                                              \
@@ -65,7 +65,7 @@
           && data->__invocation_counter == 0)                                \
     {                                                                        \
       /* Emit the Byte Order Mark.  */                                       \
-      if (__builtin_expect (outbuf + 4 > outend, 0))                         \
+      if (__glibc_unlikely (outbuf + 4 > outend))                            \
        return __GCONV_FULL_OUTPUT;                                           \
                                                                              \
       put32u (outbuf, BOM);                                                  \
@@ -196,11 +196,11 @@ gconv_end (struct __gconv_step *data)
   {                                                                          \
     uint32_t c = get32 (inptr);                                                      \
                                                                              \
-    if (__builtin_expect (c >= 0x110000, 0))                                 \
+    if (__glibc_unlikely (c >= 0x110000))                                    \
       {                                                                              \
        STANDARD_TO_LOOP_ERR_HANDLER (4);                                     \
       }                                                                              \
-    else if (__builtin_expect (c >= 0xd800 && c < 0xe000, 0))                \
+    else if (__glibc_unlikely (c >= 0xd800 && c < 0xe000))                   \
       {                                                                              \
        /* Surrogate characters in UCS-4 input are not valid.                 \
           We must catch this.  If we let surrogates pass through,            \
@@ -238,7 +238,7 @@ gconv_end (struct __gconv_step *data)
     if (swap)                                                                \
       u1 = bswap_32 (u1);                                                    \
                                                                              \
-    if (__builtin_expect (u1 >= 0x110000, 0))                                \
+    if (__glibc_unlikely (u1 >= 0x110000))                                   \
       {                                                                              \
        /* This is illegal.  */                                               \
        STANDARD_FROM_LOOP_ERR_HANDLER (4);                                   \
index 17a9fea65633c5c69dea836a5f6ddc328fb0c7e3..99c255e4cbb59d01f9d05a3b1f472aabc17a86b4 100644 (file)
@@ -167,9 +167,9 @@ base64 (unsigned int i)
            put32 (outptr, ch);                                               \
            outptr += 4;                                                      \
          }                                                                   \
-       else if (__builtin_expect (ch == '+', 1))                             \
+       else if (__glibc_likely (ch == '+'))                                  \
          {                                                                   \
-           if (__builtin_expect (inptr + 2 > inend, 0))                      \
+           if (__glibc_unlikely (inptr + 2 > inend))                         \
              {                                                               \
                /* Not enough input available.  */                            \
                result = __GCONV_INCOMPLETE_INPUT;                            \
@@ -340,7 +340,7 @@ base64 (unsigned int i)
            else                                                              \
              STANDARD_TO_LOOP_ERR_HANDLER (4);                               \
                                                                              \
-           if (__builtin_expect (outptr + count > outend, 0))                \
+           if (__glibc_unlikely (outptr + count > outend))                   \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -381,7 +381,7 @@ base64 (unsigned int i)
            size_t count;                                                     \
                                                                              \
            count = ((statep->__count & 0x18) >= 0x10) + isxbase64 (ch) + 1;  \
-           if (__builtin_expect (outptr + count > outend, 0))                \
+           if (__glibc_unlikely (outptr + count > outend))                   \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -405,7 +405,7 @@ base64 (unsigned int i)
            else                                                              \
              STANDARD_TO_LOOP_ERR_HANDLER (4);                               \
                                                                              \
-           if (__builtin_expect (outptr + count > outend, 0))                \
+           if (__glibc_unlikely (outptr + count > outend))                   \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -509,7 +509,7 @@ base64 (unsigned int i)
          /* Deactivate base64 encoding.  */                                  \
          size_t count = ((state & 0x18) >= 0x10) + 1;                        \
                                                                              \
-         if (__builtin_expect (outbuf + count > outend, 0))                  \
+         if (__glibc_unlikely (outbuf + count > outend))                     \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \
index 5a5319a5822be06bbf48e9097dc9d1de6ccd1cdb..3e82b6a7774cc8c816152f8ea08a46b96dc2844a 100644 (file)
      do                                                                              \
        {                                                                     \
         __atg11_oldval = *__atg11_memp;                                      \
-        if (__builtin_expect (__atg11_oldval <= 0, 0))                       \
+        if (__glibc_unlikely (__atg11_oldval <= 0))                          \
           break;                                                             \
        }                                                                     \
      while (__builtin_expect                                                 \
index a828697a9cd6d2558a863caba06f8d7ee017c3b1..d184ed94277dc34db0b8d337563c919252d0f86f 100644 (file)
@@ -190,7 +190,7 @@ option_alloc (struct cmsghdr *cmsg, int datalen, int multx, int plusy)
   int dsize = cmsg->cmsg_len - CMSG_LEN (0);
 
   /* The first two bytes of the option are for the extended header.  */
-  if (__builtin_expect (dsize == 0, 0))
+  if (__glibc_unlikely (dsize == 0))
     {
       cmsg->cmsg_len += sizeof (struct ip6_ext);
       dsize = sizeof (struct ip6_ext);
index 20c37b2863eb4a96c5190c80b204c4710963caec..c3624961a8fcd0f23caf806722c07fe9a324d656 100644 (file)
@@ -158,12 +158,12 @@ set_binding_values (domainname, dirnamep, codesetp)
 #else
                      size_t len = strlen (dirname) + 1;
                      result = (char *) malloc (len);
-                     if (__builtin_expect (result != NULL, 1))
+                     if (__glibc_likely (result != NULL))
                        memcpy (result, dirname, len);
 #endif
                    }
 
-                 if (__builtin_expect (result != NULL, 1))
+                 if (__glibc_likely (result != NULL))
                    {
                      if (binding->dirname != _nl_default_dirname)
                        free (binding->dirname);
@@ -196,11 +196,11 @@ set_binding_values (domainname, dirnamep, codesetp)
 #else
                  size_t len = strlen (codeset) + 1;
                  result = (char *) malloc (len);
-                 if (__builtin_expect (result != NULL, 1))
+                 if (__glibc_likely (result != NULL))
                    memcpy (result, codeset, len);
 #endif
 
-                 if (__builtin_expect (result != NULL, 1))
+                 if (__glibc_likely (result != NULL))
                    {
                      free (binding->codeset);
 
@@ -228,7 +228,7 @@ set_binding_values (domainname, dirnamep, codesetp)
       struct binding *new_binding =
        (struct binding *) malloc (offsetof (struct binding, domainname) + len);
 
-      if (__builtin_expect (new_binding == NULL, 0))
+      if (__glibc_unlikely (new_binding == NULL))
        goto failed;
 
       memcpy (new_binding->domainname, domainname, len);
@@ -249,12 +249,12 @@ set_binding_values (domainname, dirnamep, codesetp)
                  char *result;
 #if defined _LIBC || defined HAVE_STRDUP
                  result = strdup (dirname);
-                 if (__builtin_expect (result == NULL, 0))
+                 if (__glibc_unlikely (result == NULL))
                    goto failed_dirname;
 #else
                  size_t len = strlen (dirname) + 1;
                  result = (char *) malloc (len);
-                 if (__builtin_expect (result == NULL, 0))
+                 if (__glibc_unlikely (result == NULL))
                    goto failed_dirname;
                  memcpy (result, dirname, len);
 #endif
@@ -278,12 +278,12 @@ set_binding_values (domainname, dirnamep, codesetp)
 
 #if defined _LIBC || defined HAVE_STRDUP
              result = strdup (codeset);
-             if (__builtin_expect (result == NULL, 0))
+             if (__glibc_unlikely (result == NULL))
                goto failed_codeset;
 #else
              size_t len = strlen (codeset) + 1;
              result = (char *) malloc (len);
-             if (__builtin_expect (result == NULL, 0))
+             if (__glibc_unlikely (result == NULL))
                goto failed_codeset;
              memcpy (result, codeset, len);
 #endif
index f3d97fb0be574eaf446267bdc68052f9f1cfe9bd..723dd7ef46393a11ed10991f0a6bb3e648778e0b 100644 (file)
@@ -640,7 +640,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
 
                  /* Resource problems are not fatal, instead we return no
                     translation.  */
-                 if (__builtin_expect (retval == (char *) -1, 0))
+                 if (__glibc_unlikely (retval == (char *) -1))
                    goto no_translation;
 
                  if (retval != NULL)
@@ -654,7 +654,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
          /* Returning -1 means that some resource problem exists
             (likely memory) and that the strings could not be
             converted.  Return the original strings.  */
-         if (__builtin_expect (retval == (char *) -1, 0))
+         if (__glibc_unlikely (retval == (char *) -1))
            goto no_translation;
 
          if (retval != NULL)
@@ -904,7 +904,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
            realloc (domain->conversions,
                     (nconversions + 1) * sizeof (struct converted_domain));
 
-         if (__builtin_expect (new_conversions == NULL, 0))
+         if (__glibc_unlikely (new_conversions == NULL))
            {
              /* Nothing we can do, no more memory.  We cannot use the
                 translation because it might be encoded incorrectly.  */
@@ -917,7 +917,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
 
          /* Copy the 'encoding' string to permanent storage.  */
          encoding = strdup (encoding);
-         if (__builtin_expect (encoding == NULL, 0))
+         if (__glibc_unlikely (encoding == NULL))
            /* Nothing we can do, no more memory.  We cannot use the
               translation because it might be encoded incorrectly.  */
            goto unlock_fail;
@@ -948,7 +948,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
 
            /* Resource problems are fatal.  If we continue onwards we will
               only attempt to calloc a new conv_tab and fail later.  */
-           if (__builtin_expect (nullentry == (char *) -1, 0))
+           if (__glibc_unlikely (nullentry == (char *) -1))
              return (char *) -1;
 
            if (nullentry != NULL)
@@ -981,12 +981,12 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
                    charset = norm_add_slashes (charset, "");
                    int r = __gconv_open (outcharset, charset, &convd->conv,
                                          GCONV_AVOID_NOCONV);
-                   if (__builtin_expect (r != __GCONV_OK, 0))
+                   if (__glibc_unlikely (r != __GCONV_OK))
                      {
                        /* If the output encoding is the same there is
                           nothing to do.  Otherwise do not use the
                           translation at all.  */
-                       if (__builtin_expect (r != __GCONV_NULCONV, 1))
+                       if (__glibc_likely (r != __GCONV_NULCONV))
                          {
                            __libc_rwlock_unlock (domain->conversions_lock);
                            free ((char *) encoding);
@@ -1053,7 +1053,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
             handle this case by converting RESULTLEN bytes, including
             NULs.  */
 
-         if (__builtin_expect (convd->conv_tab == NULL, 0))
+         if (__glibc_unlikely (convd->conv_tab == NULL))
            {
              __libc_lock_lock (lock);
              if (convd->conv_tab == NULL)
@@ -1069,7 +1069,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
              __libc_lock_unlock (lock);
            }
 
-         if (__builtin_expect (convd->conv_tab == (char **) -1, 0))
+         if (__glibc_unlikely (convd->conv_tab == (char **) -1))
            /* Nothing we can do, no more memory.  We cannot use the
               translation because it might be encoded incorrectly.  */
            return (char *) -1;
@@ -1190,7 +1190,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
                      /* Fall through and return -1.  */
 # endif
                    }
-                 if (__builtin_expect (newmem == NULL, 0))
+                 if (__glibc_unlikely (newmem == NULL))
                    {
                      freemem = NULL;
                      freemem_size = 0;
index 18bd5011392145c119277e3ad50cb494e66991ab..b96a9978199a03c165c8e34155d1e9d7f53cf40f 100644 (file)
@@ -829,7 +829,7 @@ _nl_load_domain (domain_file, domainbinding)
   data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
                                         MAP_PRIVATE, fd, 0);
 
-  if (__builtin_expect (data != MAP_FAILED, 1))
+  if (__glibc_likely (data != MAP_FAILED))
     {
       /* mmap() call was successful.  */
       close (fd);
@@ -1257,7 +1257,7 @@ _nl_load_domain (domain_file, domainbinding)
 
   /* Get the header entry and look for a plural specification.  */
   nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
-  if (__builtin_expect (nullentry == (char *) -1, 0))
+  if (__glibc_unlikely (nullentry == (char *) -1))
     {
       __libc_rwlock_fini (domain->conversions_lock);
       goto invalid;
index ef826c0dc908f9769be2627956045da117fa5b73..9ab432885b095a3282ba81a0f53ff5e24738b34d 100644 (file)
@@ -293,7 +293,7 @@ read_alias_file (fname, fname_len)
                *cp++ = '\0';
 
              if (nmap >= maxmap)
-               if (__builtin_expect (extend_alias_table (), 0))
+               if (__glibc_unlikely (extend_alias_table ()))
                  goto out;
 
              alias_len = strlen (alias) + 1;
@@ -309,7 +309,7 @@ read_alias_file (fname, fname_len)
                  if (new_pool == NULL)
                    goto out;
 
-                 if (__builtin_expect (string_space != new_pool, 0))
+                 if (__glibc_unlikely (string_space != new_pool))
                    {
                      size_t i;
 
index 3b66ec6bb649b48608798dd49267861ad76ed4fd..79005773f95d67de4b5f07403707aa199871aa01 100644 (file)
@@ -103,7 +103,7 @@ _IO_file_doallocate (fp)
      function it points to.  This is to make sure _IO_cleanup gets called
      on exit.  We call it from _IO_file_doallocate, since that is likely
      to get called by any program that does buffered I/O. */
-  if (__builtin_expect (_IO_cleanup_registration_needed != NULL, 0))
+  if (__glibc_unlikely (_IO_cleanup_registration_needed != NULL))
     (*_IO_cleanup_registration_needed) ();
 #endif
 
index 36bea4999213b2b04d1c133c7453a46e1d759d84..a3499be46070cee8b45fdfcdd37e913e6291c678 100644 (file)
@@ -220,7 +220,7 @@ _IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
 {
   int fdesc;
 #ifdef _LIBC
-  if (__builtin_expect (fp->_flags2 & _IO_FLAGS2_NOTCANCEL, 0))
+  if (__glibc_unlikely (fp->_flags2 & _IO_FLAGS2_NOTCANCEL))
     fdesc = open_not_cancel (filename,
                             posix_mode | (is32not64 ? 0 : O_LARGEFILE), prot);
   else
@@ -726,7 +726,7 @@ _IO_file_underflow_mmap (_IO_FILE *fp)
   if (fp->_IO_read_ptr < fp->_IO_read_end)
     return *(unsigned char *) fp->_IO_read_ptr;
 
-  if (__builtin_expect (mmap_remap_check (fp), 0))
+  if (__glibc_unlikely (mmap_remap_check (fp)))
     /* We punted to the regular file functions.  */
     return _IO_UNDERFLOW (fp);
 
@@ -836,7 +836,7 @@ _IO_new_file_overflow (f, ch)
         makes room for subsequent output.
         Otherwise, set the read pointers to _IO_read_end (leaving that
         alone, so it can continue to correspond to the external position). */
-      if (__builtin_expect (_IO_in_backup (f), 0))
+      if (__glibc_unlikely (_IO_in_backup (f)))
        {
          size_t nbackup = f->_IO_read_end - f->_IO_read_ptr;
          _IO_free_backup_area (f);
@@ -1464,7 +1464,7 @@ _IO_file_xsgetn_mmap (fp, data, n)
 
   if (have < n)
     {
-      if (__builtin_expect (_IO_in_backup (fp), 0))
+      if (__glibc_unlikely (_IO_in_backup (fp)))
        {
 #ifdef _LIBC
          s = __mempcpy (s, read_ptr, have);
@@ -1481,7 +1481,7 @@ _IO_file_xsgetn_mmap (fp, data, n)
       if (have < n)
        {
          /* Check that we are mapping all of the file, in case it grew.  */
-         if (__builtin_expect (mmap_remap_check (fp), 0))
+         if (__glibc_unlikely (mmap_remap_check (fp)))
            /* We punted mmap, so complete with the vanilla code.  */
            return s - (char *) data + _IO_XSGETN (fp, data, n);
 
index e370a8b9e7ea0e1e09bb98ce0da4685540d1f29a..aee26963a303683ec961815cdfdc5b952edbc996 100644 (file)
@@ -202,7 +202,7 @@ fmemopen (void *buf, size_t len, const char *mode)
   cookie_io_functions_t iof;
   fmemopen_cookie_t *c;
 
-  if (__builtin_expect (len == 0, 0))
+  if (__glibc_unlikely (len == 0))
     {
     einval:
       __set_errno (EINVAL);
@@ -228,7 +228,7 @@ fmemopen (void *buf, size_t len, const char *mode)
     }
   else
     {
-      if (__builtin_expect ((uintptr_t) len > -(uintptr_t) buf, 0))
+      if (__glibc_unlikely ((uintptr_t) len > -(uintptr_t) buf))
        {
          free (c);
          goto einval;
index bf7f84ad3e070fd3d4c833d16c3f0fcba6adda35..1b708cad0d6fa9dd8a18895ea868f84454aeb973 100644 (file)
@@ -39,7 +39,7 @@ _IO_fgets (buf, n, fp)
   CHECK_FILE (fp, NULL);
   if (n <= 0)
     return NULL;
-  if (__builtin_expect (n == 1, 0))
+  if (__glibc_unlikely (n == 1))
     {
       /* Another irregular case: since we have to store a NUL byte and
         there is only room for exactly one byte, we don't have to
index 128327e49b0ef1e33c01b0ef584eee0e9306947c..b2d4d8fe2bbdade7fdde4db8c2c4b5e627a0ae85 100644 (file)
@@ -39,7 +39,7 @@ fgets_unlocked (buf, n, fp)
   CHECK_FILE (fp, NULL);
   if (n <= 0)
     return NULL;
-  if (__builtin_expect (n == 1, 0))
+  if (__glibc_unlikely (n == 1))
     {
       /* Another irregular case: since we have to store a NUL byte and
         there is only room for exactly one byte, we don't have to
index 193c1a994631a1d8f3504f0d29e014aa1ffa2514..fcbdda87657aef5ddd18d5da80c49aba18216b0d 100644 (file)
@@ -39,7 +39,7 @@ fgetws (buf, n, fp)
   CHECK_FILE (fp, NULL);
   if (n <= 0)
     return NULL;
-  if (__builtin_expect (n == 1, 0))
+  if (__glibc_unlikely (n == 1))
     {
       /* Another irregular case: since we have to store a NUL byte and
         there is only room for exactly one byte, we don't have to
index 14c4898ea246419cffc76f2436ce8aa3f274d9e8..1126d7bd3b887af30f6a8e935ef99cb79dc9a3a9 100644 (file)
@@ -39,7 +39,7 @@ fgetws_unlocked (buf, n, fp)
   CHECK_FILE (fp, NULL);
   if (n <= 0)
     return NULL;
-  if (__builtin_expect (n == 1, 0))
+  if (__glibc_unlikely (n == 1))
     {
       /* Another irregular case: since we have to store a NUL byte and
         there is only room for exactly one byte, we don't have to
index e2e0b0775ed4000562d66d457f829912e8705a9f..a817050d8f9914f6f092b9d23a4fbbd6ee620993 100644 (file)
@@ -89,7 +89,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
       t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
       if (t != NULL)
        len = (t - fp->_IO_read_ptr) + 1;
-      if (__builtin_expect (len >= SSIZE_MAX - cur_len, 0))
+      if (__glibc_unlikely (len >= SSIZE_MAX - cur_len))
        {
          __set_errno (EOVERFLOW);
          result = -1;
index 877fc1f829a24d0c02e2c3635d752c41f6e362af..9cebe771263e228f8c69e2f734730503f2c3fe99 100644 (file)
@@ -123,7 +123,7 @@ _IO_wfile_underflow (fp)
   enum __codecvt_result status;
   _IO_ssize_t count;
 
-  if (__builtin_expect (fp->_flags & _IO_NO_READS, 0))
+  if (__glibc_unlikely (fp->_flags & _IO_NO_READS))
     {
       fp->_flags |= _IO_ERR_SEEN;
       __set_errno (EBADF);
@@ -264,7 +264,7 @@ _IO_wfile_underflow (fp)
   const char *from = fp->_IO_read_ptr;
   const char *to = fp->_IO_read_end;
   size_t to_copy = count;
-  if (__builtin_expect (naccbuf != 0, 0))
+  if (__glibc_unlikely (naccbuf != 0))
     {
       to_copy = MIN (sizeof (accbuf) - naccbuf, count);
       to = __mempcpy (&accbuf[naccbuf], from, to_copy);
@@ -277,7 +277,7 @@ _IO_wfile_underflow (fp)
                                   fp->_wide_data->_IO_buf_end,
                                   &fp->_wide_data->_IO_read_end);
 
-  if (__builtin_expect (naccbuf != 0, 0))
+  if (__glibc_unlikely (naccbuf != 0))
     fp->_IO_read_ptr += MAX (0, read_ptr_copy - &accbuf[naccbuf - to_copy]);
   else
     fp->_IO_read_ptr = (char *) read_ptr_copy;
@@ -341,7 +341,7 @@ _IO_wfile_underflow_mmap (_IO_FILE *fp)
   struct _IO_codecvt *cd;
   const char *read_stop;
 
-  if (__builtin_expect (fp->_flags & _IO_NO_READS, 0))
+  if (__glibc_unlikely (fp->_flags & _IO_NO_READS))
     {
       fp->_flags |= _IO_ERR_SEEN;
       __set_errno (EBADF);
@@ -581,7 +581,7 @@ adjust_wide_data (_IO_FILE *fp, bool do_convert)
                                       &fp->_wide_data->_IO_read_end);
 
       /* Should we return EILSEQ?  */
-      if (__builtin_expect (status == __codecvt_error, 0))
+      if (__glibc_unlikely (status == __codecvt_error))
        {
          fp->_flags |= _IO_ERR_SEEN;
          return -1;
@@ -755,7 +755,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
 
                  /* If there was an error, then return WEOF.
                     TODO: set buffer state.  */
-                 if (__builtin_expect (status == __codecvt_error, 0))
+                 if (__glibc_unlikely (status == __codecvt_error))
                      return WEOF;
                }
              while (delta > 0);
index 0c42b99251b48f8252026bec4ab663d23976eb65..bbaf708017073556603fc172c60302505d5a9740 100644 (file)
@@ -101,11 +101,11 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
 
   /* We really have to load some data.  First we try the archive,
      but only if there was no LOCPATH environment variable specified.  */
-  if (__builtin_expect (locale_path == NULL, 1))
+  if (__glibc_likely (locale_path == NULL))
     {
       struct __locale_data *data
        = _nl_load_locale_from_archive (category, name);
-      if (__builtin_expect (data != NULL, 1))
+      if (__glibc_likely (data != NULL))
        return data;
 
       /* Nothing in the archive.  Set the default path to search below.  */
index e14535e7c0d2bbe9446c481869e5ae4ed6e49ccd..22ac90d139b29067ee338c72742728c9375439ae 100644 (file)
@@ -263,7 +263,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
     }
 
   /* If there is no archive or it cannot be loaded for some reason fail.  */
-  if (__builtin_expect (headmap.ptr == NULL, 0))
+  if (__glibc_unlikely (headmap.ptr == NULL))
     goto close_and_out;
 
   /* We have the archive available.  To find the name we first have to
@@ -459,11 +459,11 @@ _nl_load_locale_from_archive (int category, const char **namep)
      Now we need the expected data structures to point into the data.  */
 
   lia = malloc (sizeof *lia);
-  if (__builtin_expect (lia == NULL, 0))
+  if (__glibc_unlikely (lia == NULL))
     return NULL;
 
   lia->name = strdup (*namep);
-  if (__builtin_expect (lia->name == NULL, 0))
+  if (__glibc_unlikely (lia->name == NULL))
     {
       free (lia);
       return NULL;
@@ -478,7 +478,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
        lia->data[cnt] = _nl_intern_locale_data (cnt,
                                                 results[cnt].addr,
                                                 results[cnt].len);
-       if (__builtin_expect (lia->data[cnt] != NULL, 1))
+       if (__glibc_likely (lia->data[cnt] != NULL))
          {
            /* _nl_intern_locale_data leaves us these fields to initialize.  */
            lia->data[cnt]->alloc = ld_archive;
index f92603620877dd4dcdae260436b0a20b9f88155d..13eecea4e50b7834e96388c5ca41393caec36327 100644 (file)
@@ -107,7 +107,7 @@ _nl_intern_locale_data (int category, const void *data, size_t datasize)
   for (cnt = 0; cnt < newdata->nstrings; ++cnt)
     {
       size_t idx = filedata->strindex[cnt];
-      if (__builtin_expect (idx > (size_t) newdata->filesize, 0))
+      if (__glibc_unlikely (idx > (size_t) newdata->filesize))
        {
        puntdata:
          free (newdata);
@@ -183,7 +183,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
       close_not_cancel_no_status (fd);
       return;
     }
-  if (__builtin_expect (S_ISDIR (st.st_mode), 0))
+  if (__glibc_unlikely (S_ISDIR (st.st_mode)))
     {
       /* LOCALE/LC_foo is a directory; open LOCALE/LC_foo/SYS_LC_foo
           instead.  */
@@ -221,7 +221,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
 # endif
   filedata = __mmap ((caddr_t) 0, st.st_size,
                     PROT_READ, MAP_FILE|MAP_COPY, fd, 0);
-  if (__builtin_expect (filedata == MAP_FAILED, 0))
+  if (__glibc_unlikely (filedata == MAP_FAILED))
     {
       filedata = NULL;
       if (__builtin_expect (errno, ENOSYS) == ENOSYS)
@@ -258,12 +258,12 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
   /* We have mapped the data, so we no longer need the descriptor.  */
   close_not_cancel_no_status (fd);
 
-  if (__builtin_expect (filedata == NULL, 0))
+  if (__glibc_unlikely (filedata == NULL))
     /* We failed to map or read the data.  */
     return;
 
   newdata = _nl_intern_locale_data (category, filedata, st.st_size);
-  if (__builtin_expect (newdata == NULL, 0))
+  if (__glibc_unlikely (newdata == NULL))
     /* Bad data.  */
     {
 #ifdef _POSIX_MAPPED_FILES
index b70fa6cbcee28032276f95ef3eea25fd1e02ac40..94584683f77436bd70b394feac7788ed8ef7fb26 100644 (file)
@@ -278,7 +278,7 @@ setlocale (int category, const char *locale)
        if (category != LC_ALL)
          newnames[category] = (char *) locale;
 
-      if (__builtin_expect (strchr (locale, ';') != NULL, 0))
+      if (__glibc_unlikely (strchr (locale, ';') != NULL))
        {
          /* This is a composite name.  Make a copy and split it up.  */
          char *np = strdupa (locale);
index f33f603adfec2844c765cd1603f0958966bacca5..55f1027004ebe6c43c5920ef97ee5bbe25dacb74 100644 (file)
@@ -170,7 +170,7 @@ main (int argc, char *argv[])
 
          cap_free (caps);
 
-         if (__builtin_expect (res != 0, 0))
+         if (__glibc_unlikely (res != 0))
            return FAIL_EXEC;
        }
 #endif
index 71678a9dc4323d4a4334750973b94623602faf5c..60ae9a4c319eb8f8fd9920d19cab9faf25ff08bf 100644 (file)
@@ -376,7 +376,7 @@ ptmalloc_init (void)
   tsd_setspecific (arena_key, (void *) &main_arena);
   thread_atfork (ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2);
   const char *s = NULL;
-  if (__builtin_expect (_environ != NULL, 1))
+  if (__glibc_likely (_environ != NULL))
     {
       char **runp = _environ;
       char *envline;
@@ -624,7 +624,7 @@ shrink_heap (heap_info *h, long diff)
 
   /* Try to re-map the extra heap space freshly to save memory, and make it
      inaccessible.  See malloc-sysdep.h to know when this is true.  */
-  if (__builtin_expect (check_may_shrink_heap (), 0))
+  if (__glibc_unlikely (check_may_shrink_heap ()))
     {
       if ((char *) MMAP ((char *) h + new_size, diff, PROT_NONE,
                          MAP_FIXED) == (char *) MAP_FAILED)
@@ -863,12 +863,12 @@ arena_get2 (mstate a_tsd, size_t size, mstate avoid_arena)
          narenas_limit is 0.  There is no possibility for narenas to
          be too big for the test to always fail since there is not
          enough address space to create that many arenas.  */
-      if (__builtin_expect (n <= narenas_limit - 1, 0))
+      if (__glibc_unlikely (n <= narenas_limit - 1))
         {
           if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n))
             goto repeat;
           a = _int_new_arena (size);
-          if (__builtin_expect (a == NULL, 0))
+         if (__glibc_unlikely (a == NULL))
             catomic_decrement (&narenas);
         }
       else
index 4f209995adade46cac6f2dbabf0f2d21fd031e24..9a45707ee733777348984e0da4a7616a1ba799af 100644 (file)
@@ -3368,7 +3368,7 @@ _int_malloc (mstate av, size_t bytes)
           else
             {
               bck = victim->bk;
-              if (__builtin_expect (bck->fd != victim, 0))
+       if (__glibc_unlikely (bck->fd != victim))
                 {
                   errstr = "malloc(): smallbin double linked list corrupted";
                   goto errout;
@@ -3591,7 +3591,7 @@ _int_malloc (mstate av, size_t bytes)
                      have to perform a complete insert here.  */
                   bck = unsorted_chunks (av);
                   fwd = bck->fd;
-                  if (__builtin_expect (fwd->bk != bck, 0))
+         if (__glibc_unlikely (fwd->bk != bck))
                     {
                       errstr = "malloc(): corrupted unsorted chunks";
                       goto errout;
@@ -3698,7 +3698,7 @@ _int_malloc (mstate av, size_t bytes)
                      have to perform a complete insert here.  */
                   bck = unsorted_chunks (av);
                   fwd = bck->fd;
-                  if (__builtin_expect (fwd->bk != bck, 0))
+         if (__glibc_unlikely (fwd->bk != bck))
                     {
                       errstr = "malloc(): corrupted unsorted chunks 2";
                       goto errout;
@@ -3824,7 +3824,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
     }
   /* We know that each chunk is at least MINSIZE bytes in size or a
      multiple of MALLOC_ALIGNMENT.  */
-  if (__builtin_expect (size < MINSIZE || !aligned_OK (size), 0))
+  if (__glibc_unlikely (size < MINSIZE || !aligned_OK (size)))
     {
       errstr = "free(): invalid size";
       goto errout;
@@ -3922,7 +3922,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
 
     /* Lightweight tests: check whether the block is already the
        top block.  */
-    if (__builtin_expect (p == av->top, 0))
+    if (__glibc_unlikely (p == av->top))
       {
        errstr = "double free or corruption (top)";
        goto errout;
@@ -3936,7 +3936,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
        goto errout;
       }
     /* Or whether the block is actually not marked used.  */
-    if (__builtin_expect (!prev_inuse(nextchunk), 0))
+    if (__glibc_unlikely (!prev_inuse(nextchunk)))
       {
        errstr = "double free or corruption (!prev)";
        goto errout;
@@ -3979,7 +3979,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
 
       bck = unsorted_chunks(av);
       fwd = bck->fd;
-      if (__builtin_expect (fwd->bk != bck, 0))
+      if (__glibc_unlikely (fwd->bk != bck))
        {
          errstr = "free(): corrupted unsorted chunks";
          goto errout;
index bfbaecc2899cb9177f06c052608f41b6925f9ed7..bd8bcd9db02c2ff452b468f5349c2ff05256fc7f 100644 (file)
@@ -137,20 +137,20 @@ update_data (struct header *result, size_t len, size_t old_len)
      value.  The base stack pointer might not be set if this is not
      the main thread and it is the first call to any of these
      functions.  */
-  if (__builtin_expect (!start_sp, 0))
+  if (__glibc_unlikely (!start_sp))
     start_sp = GETSP ();
 
   uintptr_t sp = GETSP ();
 #ifdef STACK_GROWS_UPWARD
   /* This can happen in threads where we didn't catch the thread's
      stack early enough.  */
-  if (__builtin_expect (sp < start_sp, 0))
+  if (__glibc_unlikely (sp < start_sp))
     start_sp = sp;
   size_t current_stack = sp - start_sp;
 #else
   /* This can happen in threads where we didn't catch the thread's
      stack early enough.  */
-  if (__builtin_expect (sp > start_sp, 0))
+  if (__glibc_unlikely (sp > start_sp))
     start_sp = sp;
   size_t current_stack = start_sp - sp;
 #endif
@@ -330,7 +330,7 @@ malloc (size_t len)
   struct header *result = NULL;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -382,7 +382,7 @@ realloc (void *old, size_t len)
   size_t old_len;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -476,7 +476,7 @@ calloc (size_t n, size_t len)
   size_t size = n * len;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -526,7 +526,7 @@ free (void *ptr)
   struct header *real;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return;
@@ -578,7 +578,7 @@ mmap (void *start, size_t len, int prot, int flags, int fd, off_t offset)
   void *result = NULL;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -631,7 +631,7 @@ mmap64 (void *start, size_t len, int prot, int flags, int fd, off64_t offset)
   void *result = NULL;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -689,7 +689,7 @@ mremap (void *start, size_t old_len, size_t len, int flags, ...)
   va_end (ap);
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return NULL;
@@ -750,7 +750,7 @@ munmap (void *start, size_t len)
   int result;
 
   /* Determine real implementation if not already happened.  */
-  if (__builtin_expect (initialized <= 0, 0))
+  if (__glibc_unlikely (initialized <= 0))
     {
       if (initialized == -1)
         return -1;
@@ -766,7 +766,7 @@ munmap (void *start, size_t len)
       /* Keep track of number of calls.  */
       catomic_increment (&calls[idx_munmap]);
 
-      if (__builtin_expect (result == 0, 1))
+      if (__glibc_likely (result == 0))
         {
           /* Keep track of total memory freed using `free'.  */
           catomic_add (&total[idx_munmap], len);
index 0bea7726af48acb138d25d8183d1db467039bd80..c0edfbe2a3bb9d1eae90416ef78285d5de05aa57 100644 (file)
@@ -23,7 +23,7 @@
 long double
 __ieee754_exp2l (long double x)
 {
-  if (__builtin_expect (isless (x, (long double) LDBL_MAX_EXP), 1))
+  if (__glibc_likely (isless (x, (long double) LDBL_MAX_EXP)))
     {
       if (__builtin_expect (isgreaterequal (x, (long double) (LDBL_MIN_EXP
                                                              - LDBL_MANT_DIG
index 487f4413c2024f917e836aa29b9eaf65fbf463de..bddedfa0320409ab7b467d029aa53f550ac9f469 100644 (file)
@@ -40,9 +40,9 @@ invalid_fn (double x, double fn)
 double
 __ieee754_scalb (double x, double fn)
 {
-  if (__builtin_expect (__isnan (x), 0))
+  if (__glibc_unlikely (__isnan (x)))
     return x * fn;
-  if (__builtin_expect (!__finite (fn), 0))
+  if (__glibc_unlikely (!__finite (fn)))
     {
       if (__isnan (fn) || fn > 0.0)
        return x * fn;
@@ -50,7 +50,7 @@ __ieee754_scalb (double x, double fn)
        return x;
       return x / -fn;
     }
-  if (__builtin_expect ((double) (int) fn != fn, 0))
+  if (__glibc_unlikely ((double) (int) fn != fn))
     return invalid_fn (x, fn);
 
   return __scalbn (x, (int) fn);
index 68e6c5fcce29d47cadc0f127fef6f9eb8ba1536e..319752c993f34981983e38eeef04953f16352c52 100644 (file)
@@ -40,9 +40,9 @@ invalid_fn (float x, float fn)
 float
 __ieee754_scalbf (float x, float fn)
 {
-  if (__builtin_expect (__isnanf (x), 0))
+  if (__glibc_unlikely (__isnanf (x)))
     return x * fn;
-  if (__builtin_expect (!__finitef (fn), 0))
+  if (__glibc_unlikely (!__finitef (fn)))
     {
       if (__isnanf (fn) || fn > 0.0f)
        return x * fn;
@@ -50,7 +50,7 @@ __ieee754_scalbf (float x, float fn)
        return x;
       return x / -fn;
     }
-  if (__builtin_expect ((float) (int) fn != fn, 0))
+  if (__glibc_unlikely ((float) (int) fn != fn))
     return invalid_fn (x, fn);
 
   return __scalbnf (x, (int) fn);
index 256e7b131f9c749a4bac39fce419b072715cd83c..5815a0d67b92c9cbecd4be67a1b282fa9daa16e7 100644 (file)
@@ -40,9 +40,9 @@ invalid_fn (long double x, long double fn)
 long double
 __ieee754_scalbl (long double x, long double fn)
 {
-  if (__builtin_expect (__isnanl (x), 0))
+  if (__glibc_unlikely (__isnanl (x)))
     return x * fn;
-  if (__builtin_expect (!__finitel (fn), 0))
+  if (__glibc_unlikely (!__finitel (fn)))
     {
       if (__isnanl (fn) || fn > 0.0L)
        return x * fn;
@@ -50,7 +50,7 @@ __ieee754_scalbl (long double x, long double fn)
        return x;
       return x / -fn;
     }
-  if (__builtin_expect ((long double) (int) fn != fn, 0))
+  if (__glibc_unlikely ((long double) (int) fn != fn))
     return invalid_fn (x, fn);
 
   return __scalbnl (x, (int) fn);
index 87cdd31295bf520372b0e4695d23e974dc9ebce4..d6552d8b7c3628a0fa51e93e4cb42cad430113fb 100644 (file)
@@ -29,7 +29,7 @@ __catan (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (rcls == FP_INFINITE)
        {
@@ -55,7 +55,7 @@ __catan (__complex__ double x)
          __imag__ res = __nan ("");
        }
     }
-  else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       res = x;
     }
index 80a34744e14f7aa38fae5f2d4c3d4bff341acecc..41e419d8b0bb3927fa0952e40129291129b8d495 100644 (file)
@@ -29,7 +29,7 @@ __catanf (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (rcls == FP_INFINITE)
        {
@@ -55,7 +55,7 @@ __catanf (__complex__ float x)
          __imag__ res = __nanf ("");
        }
     }
-  else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       res = x;
     }
index 0c8b268418e67133fd88fcf7114129d9a7dfaecc..2ba1298bb6e62777a956ec096e3c4cc50b8b52d7 100644 (file)
@@ -29,7 +29,7 @@ __catanh (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (icls == FP_INFINITE)
        {
@@ -50,7 +50,7 @@ __catanh (__complex__ double x)
          __imag__ res = __nan ("");
        }
     }
-  else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       res = x;
     }
index ebb7b8232d3412a542039bae205a66300a6134a2..0ee69a5ba07d708fbcfc015ae28e3e0c53477e4c 100644 (file)
@@ -29,7 +29,7 @@ __catanhf (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (icls == FP_INFINITE)
        {
@@ -50,7 +50,7 @@ __catanhf (__complex__ float x)
          __imag__ res = __nanf ("");
        }
     }
-  else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       res = x;
     }
index d45f1d19868c5595c7de024a7383aa57d7cd285c..537bb3e28d55a324b9e9b270e25f8cef6fdadf34 100644 (file)
@@ -36,7 +36,7 @@ __catanhl (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (icls == FP_INFINITE)
        {
@@ -57,7 +57,7 @@ __catanhl (__complex__ long double x)
          __imag__ res = __nanl ("");
        }
     }
-  else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       res = x;
     }
index 32a44249623b7f0bb8e7dbf01bc830638ebadc2d..cea9282a5458a8adc1755959ea83f260e8067e1d 100644 (file)
@@ -36,7 +36,7 @@ __catanl (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (rcls == FP_INFINITE)
        {
@@ -62,7 +62,7 @@ __catanl (__complex__ long double x)
          __imag__ res = __nanl ("");
        }
     }
-  else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       res = x;
     }
index 3ee40b115346c030ef1bd79092352c5b1510eb3e..a3b93271f0a6a155b8d9dd198a41673069a68e78 100644 (file)
@@ -30,16 +30,16 @@ __ccosh (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
          double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincos (__imag__ x, &sinix, &cosix);
            }
@@ -108,12 +108,12 @@ __ccosh (__complex__ double x)
   else if (rcls == FP_INFINITE)
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls > FP_ZERO, 1))
+      if (__glibc_likely (icls > FP_ZERO))
        {
          /* Imaginary part is finite.  */
          double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincos (__imag__ x, &sinix, &cosix);
            }
index 4a9e94d004dde075d7809e9a67ee674b056d23e5..084fc6d6509a660e35630d53f87abece96e1953d 100644 (file)
@@ -30,16 +30,16 @@ __ccoshf (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
          float sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosf (__imag__ x, &sinix, &cosix);
            }
@@ -105,15 +105,15 @@ __ccoshf (__complex__ float x)
            feraiseexcept (FE_INVALID);
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls > FP_ZERO, 1))
+      if (__glibc_likely (icls > FP_ZERO))
        {
          /* Imaginary part is finite.  */
          float sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosf (__imag__ x, &sinix, &cosix);
            }
index bb79aad28e35c522a37ab281bd73e28d752efdbf..e958c496d33841f964649887b49ccf35d3caae18 100644 (file)
@@ -30,16 +30,16 @@ __ccoshl (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
          long double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosl (__imag__ x, &sinix, &cosix);
            }
@@ -105,15 +105,15 @@ __ccoshl (__complex__ long double x)
            feraiseexcept (FE_INVALID);
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls > FP_ZERO, 1))
+      if (__glibc_likely (icls > FP_ZERO))
        {
          /* Imaginary part is finite.  */
          long double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosl (__imag__ x, &sinix, &cosix);
            }
index dcb3228b995fb3d8f4c091fab385186a90571ae7..a636e35dc48c39e8b580e4b410f100a25ba0280d 100644 (file)
@@ -30,16 +30,16 @@ __cexp (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
          double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincos (__imag__ x, &sinix, &cosix);
            }
@@ -97,10 +97,10 @@ __cexp (__complex__ double x)
          feraiseexcept (FE_INVALID);
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          double value = signbit (__real__ x) ? 0.0 : HUGE_VAL;
@@ -115,7 +115,7 @@ __cexp (__complex__ double x)
            {
              double sinix, cosix;
 
-             if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+             if (__glibc_likely (icls != FP_SUBNORMAL))
                {
                  __sincos (__imag__ x, &sinix, &cosix);
                }
index 8bfc7e251dd9775d21eaac3da41cc15fdea81263..d0cdf7978656d27de37cc61d7d4d6767738915e5 100644 (file)
@@ -30,16 +30,16 @@ __cexpf (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
          float sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosf (__imag__ x, &sinix, &cosix);
            }
@@ -97,10 +97,10 @@ __cexpf (__complex__ float x)
          feraiseexcept (FE_INVALID);
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          float value = signbit (__real__ x) ? 0.0 : HUGE_VALF;
@@ -115,7 +115,7 @@ __cexpf (__complex__ float x)
            {
              float sinix, cosix;
 
-             if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+             if (__glibc_likely (icls != FP_SUBNORMAL))
                {
                  __sincosf (__imag__ x, &sinix, &cosix);
                }
index bd5572db886b2808a827f582428f2747a0f7c6b6..3b64fd181a881a8329991a5a482013ce0be6aa1d 100644 (file)
@@ -30,16 +30,16 @@ __cexpl (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
          long double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosl (__imag__ x, &sinix, &cosix);
            }
@@ -97,10 +97,10 @@ __cexpl (__complex__ long double x)
          feraiseexcept (FE_INVALID);
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          long double value = signbit (__real__ x) ? 0.0 : HUGE_VALL;
@@ -115,7 +115,7 @@ __cexpl (__complex__ long double x)
            {
              long double sinix, cosix;
 
-             if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+             if (__glibc_likely (icls != FP_SUBNORMAL))
                {
                  __sincosl (__imag__ x, &sinix, &cosix);
                }
index e2b5846f2ff7e0d15986145e19136c642c442ecc..8639868bbf211e58c3d84bd8471430281888d7d4 100644 (file)
@@ -29,7 +29,7 @@ __clog (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
       __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -37,7 +37,7 @@ __clog (__complex__ double x)
       /* Yes, the following line raises an exception.  */
       __real__ result = -1.0 / fabs (__real__ x);
     }
-  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
+  else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
     {
       /* Neither real nor imaginary part is NaN.  */
       double absx = fabs (__real__ x), absy = fabs (__imag__ x);
index 0274db36172bbee90b6d2bb0ce294c898595e0e9..417d56186cd8abbcebe5bd32bab290e4b75860c8 100644 (file)
@@ -32,7 +32,7 @@ __clog10 (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
       __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -40,7 +40,7 @@ __clog10 (__complex__ double x)
       /* Yes, the following line raises an exception.  */
       __real__ result = -1.0 / fabs (__real__ x);
     }
-  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
+  else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
     {
       /* Neither real nor imaginary part is NaN.  */
       double absx = fabs (__real__ x), absy = fabs (__imag__ x);
index dc676b23fc75703049baca602e25fe44582c54dc..a9120e03f8c8200399116a687cdd3d3091f59af4 100644 (file)
@@ -32,7 +32,7 @@ __clog10f (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
       __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -40,7 +40,7 @@ __clog10f (__complex__ float x)
       /* Yes, the following line raises an exception.  */
       __real__ result = -1.0 / fabsf (__real__ x);
     }
-  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
+  else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
     {
       /* Neither real nor imaginary part is NaN.  */
       float absx = fabsf (__real__ x), absy = fabsf (__imag__ x);
index f7c3ec43a3161ad08a6fc75e46aee92a7aa76a52..ac33a8f14078c490d78ca1dcbcc62c8f23d732f0 100644 (file)
@@ -39,7 +39,7 @@ __clog10l (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
       __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
@@ -47,7 +47,7 @@ __clog10l (__complex__ long double x)
       /* Yes, the following line raises an exception.  */
       __real__ result = -1.0 / fabsl (__real__ x);
     }
-  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
+  else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
     {
       /* Neither real nor imaginary part is NaN.  */
       long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x);
index 73c2928116538f92054e50794155d02a7a75259c..79117df6228e066abc607e7b0277a02ed7e47db4 100644 (file)
@@ -29,7 +29,7 @@ __clogf (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
       __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -37,7 +37,7 @@ __clogf (__complex__ float x)
       /* Yes, the following line raises an exception.  */
       __real__ result = -1.0 / fabsf (__real__ x);
     }
-  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
+  else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
     {
       /* Neither real nor imaginary part is NaN.  */
       float absx = fabsf (__real__ x), absy = fabsf (__imag__ x);
index ec2ff84036d831399bb0abd18746537e6977a0be..bdf82c155a12f4691e45b6e23501f68f9b81eb47 100644 (file)
@@ -36,7 +36,7 @@ __clogl (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
+  if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
     {
       /* Real and imaginary part are 0.0.  */
       __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
@@ -44,7 +44,7 @@ __clogl (__complex__ long double x)
       /* Yes, the following line raises an exception.  */
       __real__ result = -1.0 / fabsl (__real__ x);
     }
-  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
+  else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
     {
       /* Neither real nor imaginary part is NaN.  */
       long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x);
index 48a4a901abbf7817320b2ddd1b9191d48936665a..b4c8a1b2cf4f1e8bafe9376451b44684ded82b0b 100644 (file)
@@ -33,16 +33,16 @@ __csin (__complex__ double x)
 
   __real__ x = fabs (__real__ x);
 
-  if (__builtin_expect (icls >= FP_ZERO, 1))
+  if (__glibc_likely (icls >= FP_ZERO))
     {
       /* Imaginary part is finite.  */
-      if (__builtin_expect (rcls >= FP_ZERO, 1))
+      if (__glibc_likely (rcls >= FP_ZERO))
        {
          /* Real part is finite.  */
          const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
          double sinix, cosix;
 
-         if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (rcls != FP_SUBNORMAL))
            {
              __sincos (__real__ x, &sinix, &cosix);
            }
@@ -136,7 +136,7 @@ __csin (__complex__ double x)
          /* Real part is finite.  */
          double sinix, cosix;
 
-         if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (rcls != FP_SUBNORMAL))
            {
              __sincos (__real__ x, &sinix, &cosix);
            }
index 26c4bb0a2f8bbe808ccd990918d433edded5f21c..1faefd1df60edfddf4b63544b906c6a5f624e5d9 100644 (file)
@@ -33,16 +33,16 @@ __csinf (__complex__ float x)
 
   __real__ x = fabsf (__real__ x);
 
-  if (__builtin_expect (icls >= FP_ZERO, 1))
+  if (__glibc_likely (icls >= FP_ZERO))
     {
       /* Imaginary part is finite.  */
-      if (__builtin_expect (rcls >= FP_ZERO, 1))
+      if (__glibc_likely (rcls >= FP_ZERO))
        {
          /* Real part is finite.  */
          const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
          float sinix, cosix;
 
-         if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (rcls != FP_SUBNORMAL))
            {
              __sincosf (__real__ x, &sinix, &cosix);
            }
@@ -136,7 +136,7 @@ __csinf (__complex__ float x)
          /* Real part is finite.  */
          float sinix, cosix;
 
-         if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (rcls != FP_SUBNORMAL))
            {
              __sincosf (__real__ x, &sinix, &cosix);
            }
index 3fc737b4937a74dce7f386587568fbebc6b1fc8f..428add6c857a95878cca97488b932761c56d54bd 100644 (file)
@@ -33,16 +33,16 @@ __csinh (__complex__ double x)
 
   __real__ x = fabs (__real__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
          double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincos (__imag__ x, &sinix, &cosix);
            }
@@ -125,12 +125,12 @@ __csinh (__complex__ double x)
   else if (rcls == FP_INFINITE)
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls > FP_ZERO, 1))
+      if (__glibc_likely (icls > FP_ZERO))
        {
          /* Imaginary part is finite.  */
          double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincos (__imag__ x, &sinix, &cosix);
            }
index 081c7592d6339a5bad94e9b7325e795d14e68edd..d31f705a51493d09d4f0e10ab297e76df3337453 100644 (file)
@@ -33,16 +33,16 @@ __csinhf (__complex__ float x)
 
   __real__ x = fabsf (__real__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
          float sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosf (__imag__ x, &sinix, &cosix);
            }
@@ -122,15 +122,15 @@ __csinhf (__complex__ float x)
            }
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls > FP_ZERO, 1))
+      if (__glibc_likely (icls > FP_ZERO))
        {
          /* Imaginary part is finite.  */
          float sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosf (__imag__ x, &sinix, &cosix);
            }
index 3c4ba0d6171d1b3f40c935e64144ec962838b53a..c6e58f1a0dcf5a5304ae242e4635107628e93551 100644 (file)
@@ -33,16 +33,16 @@ __csinhl (__complex__ long double x)
 
   __real__ x = fabsl (__real__ x);
 
-  if (__builtin_expect (rcls >= FP_ZERO, 1))
+  if (__glibc_likely (rcls >= FP_ZERO))
     {
       /* Real part is finite.  */
-      if (__builtin_expect (icls >= FP_ZERO, 1))
+      if (__glibc_likely (icls >= FP_ZERO))
        {
          /* Imaginary part is finite.  */
          const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
          long double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosl (__imag__ x, &sinix, &cosix);
            }
@@ -122,15 +122,15 @@ __csinhl (__complex__ long double x)
            }
        }
     }
-  else if (__builtin_expect (rcls == FP_INFINITE, 1))
+  else if (__glibc_likely (rcls == FP_INFINITE))
     {
       /* Real part is infinite.  */
-      if (__builtin_expect (icls > FP_ZERO, 1))
+      if (__glibc_likely (icls > FP_ZERO))
        {
          /* Imaginary part is finite.  */
          long double sinix, cosix;
 
-         if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (icls != FP_SUBNORMAL))
            {
              __sincosl (__imag__ x, &sinix, &cosix);
            }
index 5ae8969aac8504f2c7c394945405eb01c5285f61..a3316d3470f2720b163fc5df093fb8efc746e4c7 100644 (file)
@@ -33,16 +33,16 @@ __csinl (__complex__ long double x)
 
   __real__ x = fabsl (__real__ x);
 
-  if (__builtin_expect (icls >= FP_ZERO, 1))
+  if (__glibc_likely (icls >= FP_ZERO))
     {
       /* Imaginary part is finite.  */
-      if (__builtin_expect (rcls >= FP_ZERO, 1))
+      if (__glibc_likely (rcls >= FP_ZERO))
        {
          /* Real part is finite.  */
          const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
          long double sinix, cosix;
 
-         if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (rcls != FP_SUBNORMAL))
            {
              __sincosl (__real__ x, &sinix, &cosix);
            }
@@ -136,7 +136,7 @@ __csinl (__complex__ long double x)
          /* Real part is finite.  */
          long double sinix, cosix;
 
-         if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+         if (__glibc_likely (rcls != FP_SUBNORMAL))
            {
              __sincosl (__real__ x, &sinix, &cosix);
            }
index 2bbd2b8adf267d376c2c781ceeebfcbf6b611bf4..a19bb34a81648562fb69544ca8eac5413d8ad777 100644 (file)
@@ -30,7 +30,7 @@ __csqrt (__complex__ double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (icls == FP_INFINITE)
        {
@@ -59,7 +59,7 @@ __csqrt (__complex__ double x)
     }
   else
     {
-      if (__builtin_expect (icls == FP_ZERO, 0))
+      if (__glibc_unlikely (icls == FP_ZERO))
        {
          if (__real__ x < 0.0)
            {
@@ -73,7 +73,7 @@ __csqrt (__complex__ double x)
              __imag__ res = __copysign (0.0, __imag__ x);
            }
        }
-      else if (__builtin_expect (rcls == FP_ZERO, 0))
+      else if (__glibc_unlikely (rcls == FP_ZERO))
        {
          double r;
          if (fabs (__imag__ x) >= 2.0 * DBL_MIN)
index b2a11dec81da8dbb1b1789d647fc49abf797e262..1c22df84c1cc38bcdb648c3af2c891d8648fb258 100644 (file)
@@ -30,7 +30,7 @@ __csqrtf (__complex__ float x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (icls == FP_INFINITE)
        {
@@ -59,7 +59,7 @@ __csqrtf (__complex__ float x)
     }
   else
     {
-      if (__builtin_expect (icls == FP_ZERO, 0))
+      if (__glibc_unlikely (icls == FP_ZERO))
        {
          if (__real__ x < 0.0)
            {
@@ -73,7 +73,7 @@ __csqrtf (__complex__ float x)
              __imag__ res = __copysignf (0.0, __imag__ x);
            }
        }
-      else if (__builtin_expect (rcls == FP_ZERO, 0))
+      else if (__glibc_unlikely (rcls == FP_ZERO))
        {
          float r;
          if (fabsf (__imag__ x) >= 2.0f * FLT_MIN)
index a72bac1835d2abe8225091d7b0a9d27befd25033..2dab3dbaab88f4fe1f57e5d86e7102979632f9b0 100644 (file)
@@ -30,7 +30,7 @@ __csqrtl (__complex__ long double x)
   int rcls = fpclassify (__real__ x);
   int icls = fpclassify (__imag__ x);
 
-  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
+  if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
     {
       if (icls == FP_INFINITE)
        {
@@ -59,7 +59,7 @@ __csqrtl (__complex__ long double x)
     }
   else
     {
-      if (__builtin_expect (icls == FP_ZERO, 0))
+      if (__glibc_unlikely (icls == FP_ZERO))
        {
          if (__real__ x < 0.0)
            {
@@ -73,7 +73,7 @@ __csqrtl (__complex__ long double x)
              __imag__ res = __copysignl (0.0, __imag__ x);
            }
        }
-      else if (__builtin_expect (rcls == FP_ZERO, 0))
+      else if (__glibc_unlikely (rcls == FP_ZERO))
        {
          long double r;
          if (fabsl (__imag__ x) >= 2.0L * LDBL_MIN)
index 6fed4fe465487b1e363302ec58ce9d680da2247a..407ff5a7fc4cf2d315ad29dec9964d864c52a160 100644 (file)
@@ -28,7 +28,7 @@ __ctan (__complex__ double x)
 {
   __complex__ double res;
 
-  if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
+  if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
     {
       if (__isinf_ns (__imag__ x))
        {
@@ -58,7 +58,7 @@ __ctan (__complex__ double x)
       /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
         = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
 
-      if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+      if (__glibc_likely (rcls != FP_SUBNORMAL))
        {
          __sincos (__real__ x, &sinrx, &cosrx);
        }
index a2343dd54e12d8fde90e6be0a4c438eee8120cc1..e6f345a231150100f36aac639d17a1661e0d9901 100644 (file)
@@ -28,7 +28,7 @@ __ctanf (__complex__ float x)
 {
   __complex__ float res;
 
-  if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
+  if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
     {
       if (__isinf_nsf (__imag__ x))
        {
@@ -57,7 +57,7 @@ __ctanf (__complex__ float x)
       /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
         = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
 
-      if (__builtin_expect (fpclassify(__real__ x) != FP_SUBNORMAL, 1))
+      if (__glibc_likely (fpclassify(__real__ x) != FP_SUBNORMAL))
        {
          __sincosf (__real__ x, &sinrx, &cosrx);
        }
index 0ca35e09902f2602dbf612702dfaaaad8154f1c2..be3e47e45f03ac24251847f9f501fb8e7d1c859e 100644 (file)
@@ -28,7 +28,7 @@ __ctanh (__complex__ double x)
 {
   __complex__ double res;
 
-  if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
+  if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
     {
       if (__isinf_ns (__real__ x))
        {
@@ -58,7 +58,7 @@ __ctanh (__complex__ double x)
       /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
         = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2).  */
 
-      if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+      if (__glibc_likely (icls != FP_SUBNORMAL))
        {
          __sincos (__imag__ x, &sinix, &cosix);
        }
index 8938d7018685810e4f13ac3d65127c3d9bf2b08d..39a335ef2d84678db7266b4a5c69def36d24eea0 100644 (file)
@@ -28,7 +28,7 @@ __ctanhf (__complex__ float x)
 {
   __complex__ float res;
 
-  if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
+  if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
     {
       if (__isinf_nsf (__real__ x))
        {
@@ -57,7 +57,7 @@ __ctanhf (__complex__ float x)
       /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
         = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2).  */
 
-      if (__builtin_expect (fpclassify(__imag__ x) != FP_SUBNORMAL, 1))
+      if (__glibc_likely (fpclassify(__imag__ x) != FP_SUBNORMAL))
        {
          __sincosf (__imag__ x, &sinix, &cosix);
        }
index 098e009184c70946e1134c0ec002df407656409c..64e448baa84895cde0776d9a48e81fa6b6eed437 100644 (file)
@@ -28,7 +28,7 @@ __ctanhl (__complex__ long double x)
 {
   __complex__ long double res;
 
-  if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
+  if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
     {
       if (__isinf_nsl (__real__ x))
        {
@@ -58,7 +58,7 @@ __ctanhl (__complex__ long double x)
       /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
         = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2).  */
 
-      if (__builtin_expect (icls != FP_SUBNORMAL, 1))
+      if (__glibc_likely (icls != FP_SUBNORMAL))
        {
          __sincosl (__imag__ x, &sinix, &cosix);
        }
index 98fdac0c8d1167e6ede9d76df0a94cef95468e60..282febdd89e1f5b3419d53a82555671eed71fa99 100644 (file)
@@ -28,7 +28,7 @@ __ctanl (__complex__ long double x)
 {
   __complex__ long double res;
 
-  if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
+  if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
     {
       if (__isinf_nsl (__imag__ x))
        {
@@ -58,7 +58,7 @@ __ctanl (__complex__ long double x)
       /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
         = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
 
-      if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
+      if (__glibc_likely (rcls != FP_SUBNORMAL))
        {
          __sincosl (__real__ x, &sinrx, &cosrx);
        }
index 713d7a8719867eaf164847e190c8ae3f2b4916fb..26790b91d8b2ba1adf604862d2763f40efe8aadc 100644 (file)
@@ -25,7 +25,7 @@ double
 __pow (double x, double y)
 {
   double z = __ieee754_pow (x, y);
-  if (__builtin_expect (!__finite (z), 0))
+  if (__glibc_unlikely (!__finite (z)))
     {
       if (_LIB_VERSION != _IEEE_)
        {
index 1ba22c0560f48f4887407e31e660d6f3796fe48e..fa9e0071c82939f8e3db87251328ab00f840a672 100644 (file)
@@ -25,7 +25,7 @@ float
 __powf (float x, float y)
 {
   float z = __ieee754_powf (x, y);
-  if (__builtin_expect (!__finitef (z), 0))
+  if (__glibc_unlikely (!__finitef (z)))
     {
       if (_LIB_VERSION != _IEEE_)
        {
index eba9202f2306d120c2842dd418ffaa9dd3b8035c..7c8d9f8ba400376195b6457096feb28b3d4da08a 100644 (file)
@@ -25,7 +25,7 @@ long double
 __powl (long double x, long double y)
 {
   long double z = __ieee754_powl (x, y);
-  if (__builtin_expect (!__finitel (z), 0))
+  if (__glibc_unlikely (!__finitel (z)))
     {
       if (_LIB_VERSION != _IEEE_)
        {
index 21b0c792d3c44c217e7c11cc7c12362991494e9a..dbfefaf9d5ed4546baff7e4b01ed0bcbf2ae0246 100644 (file)
@@ -27,7 +27,7 @@ sysv_scalb (double x, double fn)
 {
   double z = __ieee754_scalb (x, fn);
 
-  if (__builtin_expect (__isinf (z), 0))
+  if (__glibc_unlikely (__isinf (z)))
     {
       if (__finite (x))
        return __kernel_standard (x, fn, 32); /* scalb overflow */
index c23e35ba344fe25cfc19000b69b047569fd2605d..244fd1e91b685daad4fc907f2ea1cdfa191fa6b0 100644 (file)
@@ -27,7 +27,7 @@ sysv_scalbf (float x, float fn)
 {
   float z = __ieee754_scalbf (x, fn);
 
-  if (__builtin_expect (__isinff (z), 0))
+  if (__glibc_unlikely (__isinff (z)))
     {
       if (__finitef (x))
        return __kernel_standard_f (x, fn, 132); /* scalb overflow */
index 4252af3bf8985707c67aee7a10801ad493ec47d4..cffaa67cc7fb75d9b33d0474051d3d9e158ce4d3 100644 (file)
@@ -27,7 +27,7 @@ sysv_scalbl (long double x, long double fn)
 {
   long double z = __ieee754_scalbl (x, fn);
 
-  if (__builtin_expect (__isinfl (z), 0))
+  if (__glibc_unlikely (__isinfl (z)))
     {
       if (__finitel (x))
        return __kernel_standard_l (x, fn, 232); /* scalb overflow */
index dfaa2408572a7c3567e247600e301258d2214348..63bd309f22b7782474b72239ffa70e11a2b4b531 100644 (file)
@@ -165,7 +165,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
          if (res != len)
            break;
 
-         if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
+         if (__glibc_unlikely (len >= SIZE_MAX / sizeof (wchar_t) / 2))
            {
              /* This really should not happen if everything is fine.  */
              res = (size_t) -1;
index 2f6517b2a0e8de57034f0ecd9c626ab0b0cc40c3..478dcce330e68a96b73353f94ca0379cb5a3325e 100644 (file)
@@ -45,7 +45,7 @@ __pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
     {
       /* Catch bugs which would be hidden by the TIMESPEC_TO_TIMEVAL
         computations.  The division by 1000 truncates values.  */
-      if (__builtin_expect (timeout->tv_nsec < 0, 0))
+      if (__glibc_unlikely (timeout->tv_nsec < 0))
        {
          __set_errno (EINVAL);
          return -1;
index c437732c69355c1cf641ba19e6a1ebc5456bf500..df926a3476784c33b7e6565e7eccec02d12e2b68 100644 (file)
@@ -797,7 +797,7 @@ __prepare_niscall (const_nis_name name, directory_obj **dirp,
                   dir_binding *bptrp, unsigned int flags)
 {
   nis_error retcode = __nisfind_server (name, 1, dirp, bptrp, flags);
-  if (__builtin_expect (retcode != NIS_SUCCESS, 0))
+  if (__glibc_unlikely (retcode != NIS_SUCCESS))
     return retcode;
 
   do
index 958c49f122a9a1af7badbf610499cac3b1d6abcd..e3527339a7f275ac9d1ac8beb3ce7ec818ccf8db 100644 (file)
@@ -271,18 +271,18 @@ __nis_create_callback (int (*callback) (const_nis_name, const nis_object *,
 
   cb = (struct nis_cb *) calloc (1,
                                 sizeof (struct nis_cb) + sizeof (nis_server));
-  if (__builtin_expect (cb == NULL, 0))
+  if (__glibc_unlikely (cb == NULL))
     goto failed;
   cb->serv = (nis_server *) (cb + 1);
   cb->serv->name = strdup (nis_local_principal ());
-  if (__builtin_expect (cb->serv->name == NULL, 0))
+  if (__glibc_unlikely (cb->serv->name == NULL))
     goto failed;
   cb->serv->ep.ep_val = (endpoint *) calloc (2, sizeof (endpoint));
-  if (__builtin_expect (cb->serv->ep.ep_val == NULL, 0))
+  if (__glibc_unlikely (cb->serv->ep.ep_val == NULL))
     goto failed;
   cb->serv->ep.ep_len = 1;
   cb->serv->ep.ep_val[0].family = strdup ("inet");
-  if (__builtin_expect (cb->serv->ep.ep_val[0].family == NULL, 0))
+  if (__glibc_unlikely (cb->serv->ep.ep_val[0].family == NULL))
     goto failed;
   cb->callback = callback;
   cb->userdata = userdata;
@@ -314,7 +314,7 @@ __nis_create_callback (int (*callback) (const_nis_name, const nis_object *,
     }
 
   cb->serv->ep.ep_val[0].proto = strdup ((flags & USE_DGRAM) ? "udp" : "tcp");
-  if (__builtin_expect (cb->serv->ep.ep_val[0].proto == NULL, 0))
+  if (__glibc_unlikely (cb->serv->ep.ep_val[0].proto == NULL))
     goto failed;
   cb->xprt = ((flags & USE_DGRAM)
              ? svcudp_bufcreate (sock, 100, 8192)
index a9167348c35b7dba5e86c82bee79f111fb2e18e3..dd7f317b823faaea1d7a463a5b012174363062a0 100644 (file)
@@ -46,7 +46,7 @@ nis_creategroup (const_nis_name group, unsigned int flags)
        return NIS_BADNAME;
 
       obj = calloc (1, sizeof (nis_object));
-      if (__builtin_expect (obj == NULL, 0))
+      if (__glibc_unlikely (obj == NULL))
        return NIS_NOMEMORY;
 
       obj->zo_oid.ctime = obj->zo_oid.mtime = time (NULL);
index 52af9cc9cdcd827d6a5dd6422a61044f53b06844..5216f49434be29a595db691a3c6f2194d4932845 100644 (file)
@@ -50,7 +50,7 @@ nis_domain_of_r (const_nis_name name, char *buffer, size_t buflen)
       return strcpy (buffer, ".");
     }
 
-  if (__builtin_expect (cptr_len >= buflen, 0))
+  if (__glibc_unlikely (cptr_len >= buflen))
     {
       __set_errno (ERANGE);
       return NULL;
index b5664250153b76a763e86950205d84521c9d8948..8adad82e1ed76465d842625b2490d925b76b50a9 100644 (file)
@@ -89,7 +89,7 @@ __nis_findfastest_with_timeout (dir_binding *bind,
   pings = malloc (sizeof (struct findserv_req) * pings_max);
   xid_seed = (u_int32_t) (time (NULL) ^ getpid ());
 
-  if (__builtin_expect (pings == NULL, 0))
+  if (__glibc_unlikely (pings == NULL))
     return -1;
 
   memset (&sin, '\0', sizeof (sin));
@@ -118,7 +118,7 @@ __nis_findfastest_with_timeout (dir_binding *bind,
                pings_max += 10;
                new_pings = realloc (pings, sizeof (struct findserv_req) *
                                     pings_max);
-               if (__builtin_expect (new_pings == NULL, 0))
+               if (__glibc_unlikely (new_pings == NULL))
                  {
                    free (pings);
                    return -1;
index ac9278e22784be02b10673ca9c1e8b8c79b27c9e..f180bad0dd1d0662d6148e4e5ed055757cc78d33 100644 (file)
@@ -38,7 +38,7 @@ nis_getservlist (const_nis_name dir)
       serv =
        malloc (sizeof (nis_server *) *
                (NIS_RES_OBJECT (res)->DI_data.do_servers.do_servers_len + 1));
-      if (__builtin_expect (serv == NULL, 0))
+      if (__glibc_unlikely (serv == NULL))
        {
          nis_freeresult (res);
          return NULL;
@@ -50,7 +50,7 @@ nis_getservlist (const_nis_name dir)
          server =
            &NIS_RES_OBJECT (res)->DI_data.do_servers.do_servers_val[i];
          serv[i] = calloc (1, sizeof (nis_server));
-         if (__builtin_expect (serv[i] == NULL, 0))
+         if (__glibc_unlikely (serv[i] == NULL))
            {
            free_all:
              while (i-- > 0)
@@ -81,7 +81,7 @@ nis_getservlist (const_nis_name dir)
          if (server->name != NULL)
            {
              serv[i]->name = strdup (server->name);
-             if (__builtin_expect (serv[i]->name == NULL, 0))
+             if (__glibc_unlikely (serv[i]->name == NULL))
                {
                  ++i;
                  goto free_all;
@@ -95,7 +95,7 @@ nis_getservlist (const_nis_name dir)
 
               serv[i]->ep.ep_val =
                malloc (server->ep.ep_len * sizeof (endpoint));
-             if (__builtin_expect (serv[i]->ep.ep_val == NULL, 0))
+             if (__glibc_unlikely (serv[i]->ep.ep_val == NULL))
                {
                  ++i;
                  goto free_all;
@@ -126,7 +126,7 @@ nis_getservlist (const_nis_name dir)
           if (server->pkey.n_len > 0)
             {
               serv[i]->pkey.n_bytes = malloc (server->pkey.n_len);
-              if (__builtin_expect (serv[i]->pkey.n_bytes == NULL, 0))
+              if (__glibc_unlikely (serv[i]->pkey.n_bytes == NULL))
                {
                  ++i;
                  goto free_all;
@@ -140,7 +140,7 @@ nis_getservlist (const_nis_name dir)
   else
     {
       serv = malloc (sizeof (nis_server *));
-      if (__builtin_expect (serv != NULL, 0))
+      if (__glibc_unlikely (serv != NULL))
        serv[0] = NULL;
     }
 
index a41f121855d001d073cb175b3ffb5c0babe6cf36..b9096c9ea4fd1836f75a9408d01a1d198fd1e469 100644 (file)
@@ -63,7 +63,7 @@ nis_lookup (const_nis_name name, const unsigned int flags)
       req.ns_object.ns_object_val = NULL;
 
       status = __prepare_niscall (req.ns_name, &dir, &bptr, flags);
-      if (__builtin_expect (status != NIS_SUCCESS, 0))
+      if (__glibc_unlikely (status != NIS_SUCCESS))
        {
          NIS_RES_STATUS (res) = status;
          goto out;
@@ -147,7 +147,7 @@ nis_lookup (const_nis_name name, const unsigned int flags)
                          dir = NULL;
                          status = __prepare_niscall (req.ns_name, &dir,
                                                      &bptr, flags);
-                         if (__builtin_expect (status != NIS_SUCCESS, 0))
+                         if (__glibc_unlikely (status != NIS_SUCCESS))
                            {
                              NIS_RES_STATUS (res) = status;
                              goto out;
index 4a4580a1e6cb3fd987dbe62df54f7b8fa6d47931..8f6f1d71f38d43f4087ead115877f0813cb701c5 100644 (file)
@@ -38,7 +38,7 @@ nis_leaf_of_r (const_nis_name name, char *buffer, size_t buflen)
   while (name[i] != '.' && name[i] != '\0')
     i++;
 
-  if (__builtin_expect (i >= buflen, 0))
+  if (__glibc_unlikely (i >= buflen))
     {
       __set_errno (ERANGE);
       return NULL;
@@ -118,7 +118,7 @@ nis_getnames (const_nis_name name)
 
   int count = 2;
   nis_name *getnames = malloc ((count + 1) * sizeof (char *));
-  if (__builtin_expect (getnames == NULL, 0))
+  if (__glibc_unlikely (getnames == NULL))
       return NULL;
 
   /* Do we have a fully qualified NIS+ name ? If yes, give it back */
@@ -200,12 +200,12 @@ nis_getnames (const_nis_name name)
                  count += 5;
                  nis_name *newp = realloc (getnames,
                                            (count + 1) * sizeof (char *));
-                 if (__builtin_expect (newp == NULL, 0))
+                 if (__glibc_unlikely (newp == NULL))
                    goto free_null;
                  getnames = newp;
                }
              tmp = malloc (strlen (cptr) + local_domain_len + name_len + 2);
-             if (__builtin_expect (tmp == NULL, 0))
+             if (__glibc_unlikely (tmp == NULL))
                goto free_null;
 
              getnames[pos] = tmp;
@@ -235,7 +235,7 @@ nis_getnames (const_nis_name name)
              char *p;
 
              tmp = malloc (cplen + local_domain_len + name_len + 2);
-             if (__builtin_expect (tmp == NULL, 0))
+             if (__glibc_unlikely (tmp == NULL))
                goto free_null;
 
              p = __stpcpy (tmp, name);
@@ -251,7 +251,7 @@ nis_getnames (const_nis_name name)
              char *p;
 
              tmp = malloc (cplen + name_len + 3);
-             if (__builtin_expect (tmp == NULL, 0))
+             if (__glibc_unlikely (tmp == NULL))
                goto free_null;
 
              p = __mempcpy (tmp, name, name_len);
@@ -267,7 +267,7 @@ nis_getnames (const_nis_name name)
              count += 5;
              nis_name *newp = realloc (getnames,
                                        (count + 1) * sizeof (char *));
-             if (__builtin_expect (newp == NULL, 0))
+             if (__glibc_unlikely (newp == NULL))
                goto free_null;
              getnames = newp;
            }
index 9344a1f7b3b5205a8f32f61e34928adac11e1478..bb74873d9d1e078be2b011304fee07b199a1eefa 100644 (file)
@@ -92,7 +92,7 @@ __create_ib_request (const_nis_name name, unsigned int flags)
       if (cptr != NULL)
        *cptr++ = '\0';
 
-      if (__builtin_expect (val == NULL, 0))
+      if (__glibc_unlikely (val == NULL))
        {
          nis_free_request (ibreq);
          return NULL;
@@ -282,7 +282,7 @@ nis_list (const_nis_name name, unsigned int flags,
        }
 
       while (__nisbind_connect (&bptr) != NIS_SUCCESS)
-       if (__builtin_expect (__nisbind_next (&bptr) != NIS_SUCCESS, 0))
+       if (__glibc_unlikely (__nisbind_next (&bptr) != NIS_SUCCESS))
          {
            NIS_RES_STATUS (res) = NIS_NAMEUNREACHABLE;
            goto fail;
@@ -302,7 +302,7 @@ nis_list (const_nis_name name, unsigned int flags,
                               (xdrproc_t) _xdr_nis_result,
                               (caddr_t) res, RPCTIMEOUT);
 
-      if (__builtin_expect (clnt_status != RPC_SUCCESS, 0))
+      if (__glibc_unlikely (clnt_status != RPC_SUCCESS))
        NIS_RES_STATUS (res) = NIS_RPCERROR;
       else
        switch (NIS_RES_STATUS (res))
@@ -316,7 +316,7 @@ nis_list (const_nis_name name, unsigned int flags,
                free (ibreq->ibr_name);
                ibreq->ibr_name = NULL;
                /* If we hit the link limit, bail.  */
-               if (__builtin_expect (count_links > NIS_MAXLINKS, 0))
+               if (__glibc_unlikely (count_links > NIS_MAXLINKS))
                  {
                    NIS_RES_STATUS (res) = NIS_LINKNAMEERROR;
                    ++done;
@@ -491,7 +491,7 @@ nis_list (const_nis_name name, unsigned int flags,
                /* Try the next domainname if we don't follow a link.  */
                free (ibreq->ibr_name);
                ibreq->ibr_name = NULL;
-               if (__builtin_expect (count_links, 0))
+               if (__glibc_unlikely (count_links))
                  {
                    NIS_RES_STATUS (res) = NIS_LINKNAMEERROR;
                    ++done;
@@ -597,7 +597,7 @@ nis_add_entry (const_nis_name name, const nis_object *obj2, unsigned int flags)
                                   (caddr_t) ibreq,
                                   (xdrproc_t) _xdr_nis_result,
                                   (caddr_t) res, 0, NULL);
-  if (__builtin_expect (status != NIS_SUCCESS, 0))
+  if (__glibc_unlikely (status != NIS_SUCCESS))
     NIS_RES_STATUS (res) = status;
 
   nis_free_request (ibreq);
@@ -654,7 +654,7 @@ nis_modify_entry (const_nis_name name, const nis_object *obj2,
                         (xdrproc_t) _xdr_ib_request,
                         (caddr_t) ibreq, (xdrproc_t) _xdr_nis_result,
                         (caddr_t) res, 0, NULL);
-  if (__builtin_expect (status != NIS_SUCCESS, 0))
+  if (__glibc_unlikely (status != NIS_SUCCESS))
     NIS_RES_STATUS (res) = status;
 
   nis_free_request (ibreq);
@@ -739,7 +739,7 @@ nis_first_entry (const_nis_name name)
                         (caddr_t) ibreq, (xdrproc_t) _xdr_nis_result,
                         (caddr_t) res, 0, NULL);
 
-  if (__builtin_expect (status != NIS_SUCCESS, 0))
+  if (__glibc_unlikely (status != NIS_SUCCESS))
     NIS_RES_STATUS (res) = status;
 
   nis_free_request (ibreq);
@@ -782,7 +782,7 @@ nis_next_entry (const_nis_name name, const netobj *cookie)
                         (caddr_t) ibreq, (xdrproc_t) _xdr_nis_result,
                         (caddr_t) res, 0, NULL);
 
-  if (__builtin_expect (status != NIS_SUCCESS, 0))
+  if (__glibc_unlikely (status != NIS_SUCCESS))
     NIS_RES_STATUS (res) = status;
 
   if (cookie != NULL)
index d7ca81910e69834c65fac0e6e5f41949737d58b0..c391d9c280c0718cc0076699e12e36f4ee181ed1 100644 (file)
@@ -75,7 +75,7 @@ xdr_endpoint (XDR *xdrs, endpoint *objp)
   if (__builtin_expect (res, TRUE))
     {
       res = xdr_string (xdrs, &objp->family, ~0);
-      if (__builtin_expect (res, 1))
+      if (__glibc_likely (res))
        res = xdr_string (xdrs, &objp->proto, ~0);
     }
   return res;
index 2d57461feda3c9e3956fa639749965a0c17bfc5c..78e14d6d3caf12e25ceda70767efc30cce9f2bc4 100644 (file)
@@ -288,7 +288,7 @@ getgrent_next_file (struct group *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -321,7 +321,7 @@ getgrent_next_file (struct group *result, ent_t *ent,
             !(parse_res = _nss_files_parse_grent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
@@ -421,7 +421,7 @@ internal_getgrnam_r (const char *name, struct group *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -454,7 +454,7 @@ internal_getgrnam_r (const char *name, struct group *result, ent_t *ent,
             !(parse_res = _nss_files_parse_grent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
@@ -552,7 +552,7 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -585,7 +585,7 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent,
             !(parse_res = _nss_files_parse_grent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
index fa1523891e74cc0449f2dc6ec56b26b747c41a4b..c5ba606e1c92b7a748e1cd2f32362233f81935c3 100644 (file)
@@ -214,7 +214,7 @@ add_group (long int *start, long int *size, gid_t **groupsp, long int limit,
   gid_t *groups = *groupsp;
 
   /* Matches user.  Insert this group.  */
-  if (__builtin_expect (*start == *size, 0))
+  if (__glibc_unlikely (*start == *size))
     {
       /* Need a bigger buffer.  */
       gid_t *newgroups;
@@ -420,7 +420,7 @@ internal_getgrent_r (ent_t *ent, char *buffer, size_t buflen, const char *user,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -453,7 +453,7 @@ internal_getgrent_r (ent_t *ent, char *buffer, size_t buflen, const char *user,
             !(parse_res = _nss_files_parse_grent (p, &grpbuf, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
index 021fb18d19b14d318b31a643c49e10a624edf34b..127673c596b1261b77c59839e3396b28105bcfae 100644 (file)
@@ -528,7 +528,7 @@ getpwent_next_file (struct passwd *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -561,7 +561,7 @@ getpwent_next_file (struct passwd *result, ent_t *ent,
             !(parse_res = _nss_files_parse_pwent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
@@ -727,7 +727,7 @@ internal_getpwnam_r (const char *name, struct passwd *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -761,7 +761,7 @@ internal_getpwnam_r (const char *name, struct passwd *result, ent_t *ent,
             !(parse_res = _nss_files_parse_pwent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
@@ -934,7 +934,7 @@ internal_getpwuid_r (uid_t uid, struct passwd *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -967,7 +967,7 @@ internal_getpwuid_r (uid_t uid, struct passwd *result, ent_t *ent,
             !(parse_res = _nss_files_parse_pwent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
index 1c2ec3d87544f771717be66509ad84d6bf5eb2ab..4890ce6f906434215c3f3544b6dc8fcba2917813 100644 (file)
@@ -485,7 +485,7 @@ getspent_next_file (struct spwd *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -515,7 +515,7 @@ getspent_next_file (struct spwd *result, ent_t *ent,
             || !(parse_res = _nss_files_parse_spent (p, result, data,
                                                      buflen, errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
@@ -685,7 +685,7 @@ internal_getspnam_r (const char *name, struct spwd *result, ent_t *ent,
       do
        {
          /* We need at least 3 characters for one line.  */
-         if (__builtin_expect (buflen < 3, 0))
+         if (__glibc_unlikely (buflen < 3))
            {
            erange:
              *errnop = ERANGE;
@@ -718,7 +718,7 @@ internal_getspnam_r (const char *name, struct spwd *result, ent_t *ent,
             !(parse_res = _nss_files_parse_spent (p, result, data, buflen,
                                                   errnop)));
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        /* The parser ran out of space.  */
        goto erange_reset;
 
index 2f708c185c74d28496443f90f69d74a0c7dcf975..995e610859a9b789438b44af27306d3716caea79 100644 (file)
@@ -125,7 +125,7 @@ internal_nis_getaliasent_r (struct aliasent *alias, char *buffer,
 {
   char *domain;
 
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   alias->alias_local = 0;
@@ -147,7 +147,7 @@ internal_nis_getaliasent_r (struct aliasent *alias, char *buffer,
        yperr = yp_next (domain, "mail.aliases", oldkey, oldkeylen, &outkey,
                         &keylen, &result, &len);
 
-      if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+      if (__glibc_unlikely (yperr != YPERR_SUCCESS))
        {
          enum nss_status retval = yperr2nss (yperr);
 
@@ -156,7 +156,7 @@ internal_nis_getaliasent_r (struct aliasent *alias, char *buffer,
          return retval;
        }
 
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
        {
          free (result);
          *errnop = ERANGE;
@@ -170,7 +170,7 @@ internal_nis_getaliasent_r (struct aliasent *alias, char *buffer,
 
       parse_res = _nss_nis_parse_aliasent (outkey, p, alias, buffer,
                                           buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          free (outkey);
          *errnop = ERANGE;
@@ -213,7 +213,7 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   size_t namlen = strlen (name);
@@ -244,7 +244,7 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
   if (!use_alloca)
     free (name2);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -253,7 +253,7 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -269,7 +269,7 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
   alias->alias_local = 0;
   int parse_res = _nss_nis_parse_aliasent (name, p, alias, buffer, buflen,
                                           errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index a803c27ac6dd4810a4f947e47ed1ed2c1ed98d63..59190cf5fa48e98af4a331360f5e3c86ac1785d1 100644 (file)
@@ -188,7 +188,7 @@ _nss_nis_gethostton_r (const char *name, struct etherent *eth,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char *result;
@@ -196,7 +196,7 @@ _nss_nis_gethostton_r (const char *name, struct etherent *eth,
   int yperr = yp_match (domain, "ethers.byname", name, strlen (name), &result,
                        &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -205,7 +205,7 @@ _nss_nis_gethostton_r (const char *name, struct etherent *eth,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -220,7 +220,7 @@ _nss_nis_gethostton_r (const char *name, struct etherent *eth,
 
   int parse_res = _nss_files_parse_etherent (p, eth, (void *) buffer, buflen,
                                             errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
@@ -241,7 +241,7 @@ _nss_nis_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char buf[33];
@@ -257,7 +257,7 @@ _nss_nis_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
   int len;
   int yperr = yp_match (domain, "ethers.byaddr", buf, nlen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -266,7 +266,7 @@ _nss_nis_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -281,7 +281,7 @@ _nss_nis_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
 
   int parse_res = _nss_files_parse_etherent (p, eth, (void *) buffer, buflen,
                                             errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index 53368073a726e211e5d4ac7a100e438c045a56c2..20211de0de14d4263618a5767cd2ff177c181ca3 100644 (file)
@@ -85,7 +85,7 @@ internal_nis_setgrent (void)
 {
   /* We have to read all the data now.  */
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   struct ypall_callback ypcb;
@@ -152,7 +152,7 @@ internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen,
        handle_batch_read:
          bucket = intern.next;
 
-         if (__builtin_expect (intern.offset >= bucket->size, 0))
+         if (__glibc_unlikely (intern.offset >= bucket->size))
            {
              if (bucket->next == NULL)
                return NSS_STATUS_NOTFOUND;
@@ -191,7 +191,7 @@ internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen,
            yperr = yp_next (domain, "group.byname", oldkey, oldkeylen,
                             &outkey, &keylen, &result, &len);
 
-         if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+         if (__glibc_unlikely (yperr != YPERR_SUCCESS))
            {
              enum nss_status retval = yperr2nss (yperr);
 
@@ -201,7 +201,7 @@ internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen,
            }
        }
 
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
        {
          if (!batch_read)
            free (result);
@@ -218,7 +218,7 @@ internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen,
 
       parse_res = _nss_files_parse_grent (p, grp, (void *) buffer, buflen,
                                          errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          if (!batch_read)
            free (outkey);
@@ -267,7 +267,7 @@ _nss_nis_getgrnam_r (const char *name, struct group *grp,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char *result;
@@ -275,7 +275,7 @@ _nss_nis_getgrnam_r (const char *name, struct group *grp,
   int yperr = yp_match (domain, "group.byname", name, strlen (name), &result,
                        &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -284,7 +284,7 @@ _nss_nis_getgrnam_r (const char *name, struct group *grp,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -314,7 +314,7 @@ _nss_nis_getgrgid_r (gid_t gid, struct group *grp,
                     char *buffer, size_t buflen, int *errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char buf[32];
@@ -324,7 +324,7 @@ _nss_nis_getgrgid_r (gid_t gid, struct group *grp,
   int len;
   int yperr = yp_match (domain, "group.bygid", buf, nlen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -333,7 +333,7 @@ _nss_nis_getgrgid_r (gid_t gid, struct group *grp,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -348,7 +348,7 @@ _nss_nis_getgrgid_r (gid_t gid, struct group *grp,
 
   int parse_res = _nss_files_parse_grent (p, grp, (void *) buffer, buflen,
                                          errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index f73a0eccb261ebf6b77eeb243ca6c6b7b02093ad..462176ea03cbb37e2da69a3f2d1d153a1df46ec9 100644 (file)
@@ -136,14 +136,14 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
                           int af, int flags)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct parser_data);
   buffer += pad;
 
   struct parser_data *data = (void *) buffer;
-  if (__builtin_expect (buflen < sizeof *data + 1 + pad, 0))
+  if (__glibc_unlikely (buflen < sizeof *data + 1 + pad))
     {
       *errnop = ERANGE;
       *h_errnop = NETDB_INTERNAL;
@@ -168,7 +168,7 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
        yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey,
                         &keylen, &result, &len);
 
-      if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+      if (__glibc_unlikely (yperr != YPERR_SUCCESS))
        {
          enum nss_status retval = yperr2nss (yperr);
 
@@ -188,7 +188,7 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
          return retval;
        }
 
-      if (__builtin_expect ((size_t) (len + 1) > linebuflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > linebuflen))
        {
          free (result);
          *h_errnop = NETDB_INTERNAL;
@@ -203,7 +203,7 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
       free (result);
 
       parse_res = parse_line (p, host, data, buflen, errnop, af, flags);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          free (outkey);
          *h_errnop = NETDB_INTERNAL;
@@ -281,7 +281,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
   int len;
   int yperr = yp_match (domain, "hosts.byname", name2, namlen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -296,7 +296,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
     }
 
   const size_t linebuflen = buffer + buflen - data->linebuffer;
-  if (__builtin_expect ((size_t) (len + 1) > linebuflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > linebuflen))
     {
       free (result);
       *h_errnop = NETDB_INTERNAL;
@@ -312,7 +312,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
 
   int parse_res = parse_line (p, host, data, buflen, errnop, af, flags);
 
-  if (__builtin_expect (parse_res < 1 || host->h_addrtype != af, 0))
+  if (__glibc_unlikely (parse_res < 1 || host->h_addrtype != af))
     {
       if (parse_res == -1)
        {
@@ -373,14 +373,14 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
                          int *errnop, int *h_errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct parser_data);
   buffer += pad;
 
   struct parser_data *data = (void *) buffer;
-  if (__builtin_expect (buflen < sizeof *data + 1 + pad, 0))
+  if (__glibc_unlikely (buflen < sizeof *data + 1 + pad))
     {
       *errnop = ERANGE;
       *h_errnop = NETDB_INTERNAL;
@@ -395,7 +395,7 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
   int yperr = yp_match (domain, "hosts.byaddr", buf, strlen (buf), &result,
                        &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -411,7 +411,7 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
     }
 
   const size_t linebuflen = buffer + buflen - data->linebuffer;
-  if (__builtin_expect ((size_t) (len + 1) > linebuflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > linebuflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -428,7 +428,7 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
   int parse_res = parse_line (p, host, data, buflen, errnop, af,
                              ((_res.options & RES_USE_INET6)
                               ? AI_V4MAPPED : 0));
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
@@ -472,7 +472,7 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
   int len;
   int yperr = yp_match (domain, "hosts.byname", name2, namlen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -493,7 +493,7 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
       buffer += pad;
       buflen = buflen > pad ? buflen - pad : 0;
 
-      if (__builtin_expect (buflen < sizeof (struct gaih_addrtuple), 0))
+      if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
        {
        erange:
          free (result);
@@ -512,14 +512,14 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
 
   struct parser_data *data = (void *) buffer;
 
-  if (__builtin_expect (buflen < sizeof *data + 1 + pad, 0))
+  if (__glibc_unlikely (buflen < sizeof *data + 1 + pad))
     goto erange;
   buflen -= pad;
 
   struct hostent host;
   int parse_res = parse_line (result, &host, data, buflen, errnop, AF_UNSPEC,
                              0);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
index 30bc90f691e20f21dd70e72f65eade815eeb56ac..e8fcca1bb14689e85d78a68bafaf475244b6ca29 100644 (file)
@@ -72,7 +72,7 @@ internal_getgrent_r (struct group *grp, char *buffer, size_t buflen,
     {
       struct response_t *bucket = intern->next;
 
-      if (__builtin_expect (intern->offset >= bucket->size, 0))
+      if (__glibc_unlikely (intern->offset >= bucket->size))
        {
          if (bucket->next == NULL)
            return NSS_STATUS_NOTFOUND;
@@ -88,7 +88,7 @@ internal_getgrent_r (struct group *grp, char *buffer, size_t buflen,
         ++intern->offset;
 
       size_t len = strlen (p) + 1;
-      if (__builtin_expect (len > buflen, 0))
+      if (__glibc_unlikely (len > buflen))
        {
          *errnop = ERANGE;
          return NSS_STATUS_TRYAGAIN;
@@ -106,7 +106,7 @@ internal_getgrent_r (struct group *grp, char *buffer, size_t buflen,
 
       parse_res = _nss_files_parse_grent (p, grp, (void *) buffer, buflen,
                                          errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
         return NSS_STATUS_TRYAGAIN;
 
       intern->offset += len;
@@ -160,7 +160,7 @@ initgroups_netid (uid_t uid, gid_t group, long int *start, long int *size,
   int reslen;
   int yperr = yp_match (domainname, "netid.byname", key, keylen, &result,
                        &reslen);
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     return yperr2nss (yperr);
 
   /* Parse the result: following the colon is a comma separated list of
index d4b2e569d3e46336aec0cc7984dd64acb81eb8de..d03d71593f56c9ecedeead09a58089ec66e07ffb 100644 (file)
@@ -54,16 +54,16 @@ _nss_nis_setnetgrent (const char *group, struct __netgrent *netgrp)
 
   status = NSS_STATUS_SUCCESS;
 
-  if (__builtin_expect (group == NULL || group[0] == '\0', 0))
+  if (__glibc_unlikely (group == NULL || group[0] == '\0'))
     return NSS_STATUS_UNAVAIL;
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   status = yperr2nss (yp_match (domain, "netgroup", group, strlen (group),
                                &netgrp->data, &len));
-  if (__builtin_expect (status == NSS_STATUS_SUCCESS, 1))
+  if (__glibc_likely (status == NSS_STATUS_SUCCESS))
     {
       /* Our implementation of yp_match already allocates a buffer
         which is one byte larger than the value in LEN specifies
index da28860003468086d3d789d6880ffb72f27f88f1..f28fbdaa4f8934d3199b144446579ad53bea9dbb 100644 (file)
@@ -74,7 +74,7 @@ internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen,
   struct parser_data *data = (void *) buffer;
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   /* Get the next entry until we found a correct one. */
@@ -94,7 +94,7 @@ internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen,
         yperr = yp_next (domain, "networks.byname", oldkey, oldkeylen, &outkey,
                         &keylen, &result, &len);
 
-      if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+      if (__glibc_unlikely (yperr != YPERR_SUCCESS))
         {
          enum nss_status retval = yperr2nss (yperr);
 
@@ -106,7 +106,7 @@ internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen,
           return retval;
         }
 
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
         {
           free (result);
          *errnop = ERANGE;
@@ -121,7 +121,7 @@ internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen,
       free (result);
 
       parse_res = _nss_files_parse_netent (p, net, data, buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          free (outkey);
          *herrnop = NETDB_INTERNAL;
@@ -166,7 +166,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   struct parser_data *data = (void *) buffer;
@@ -191,7 +191,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
   int yperr = yp_match (domain, "networks.byname", name2, namlen, &result,
                        &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -203,7 +203,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -219,7 +219,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
 
   int parse_res = _nss_files_parse_netent (p, net, data, buflen, errnop);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       *herrnop = NETDB_INTERNAL;
       if (parse_res == -1)
@@ -237,7 +237,7 @@ _nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
                         int *herrnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   struct in_addr in = { .s_addr = htonl (addr) };
@@ -252,7 +252,7 @@ _nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
       int yperr = yp_match (domain, "networks.byaddr", buf, blen, &result,
                            &len);
 
-      if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+      if (__glibc_unlikely (yperr != YPERR_SUCCESS))
          {
            enum nss_status retval = yperr2nss (yperr);
 
@@ -277,7 +277,7 @@ _nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
              }
          }
 
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
        {
          free (result);
          *errnop = ERANGE;
@@ -294,7 +294,7 @@ _nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
        int parse_res = _nss_files_parse_netent (p, net, (void *) buffer,
                                                 buflen, errnop);
 
-       if (__builtin_expect (parse_res < 1, 0))
+       if (__glibc_unlikely (parse_res < 1))
          {
            *herrnop = NETDB_INTERNAL;
            if (parse_res == -1)
index eff2eddd6cb5e27ffbd739805e819d2dbd34735e..e165f10200f0d5f8a75678b30d816eb47c755bce 100644 (file)
@@ -185,7 +185,7 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char *result;
@@ -193,7 +193,7 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
   int yperr = yp_match (domain, "protocols.byname", name, strlen (name),
                        &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -202,7 +202,7 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -217,7 +217,7 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
 
   int parse_res = _nss_files_parse_protoent (p, proto, (void *) buffer, buflen,
                                             errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
@@ -232,7 +232,7 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
                             char *buffer, size_t buflen, int *errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char buf[32];
@@ -243,7 +243,7 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
   int yperr = yp_match (domain, "protocols.bynumber", buf, nlen, &result,
                        &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -252,7 +252,7 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -267,7 +267,7 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
 
   int parse_res = _nss_files_parse_protoent (p, proto, (void *) buffer, buflen,
                                             errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index cec43e2b2469e5174f5e69e2e47b0c6646a32f7c..7a133418efe8c0f508eeeeed79eea363ec172982 100644 (file)
@@ -56,7 +56,7 @@ _nss_nis_getpublickey (const char *netname, char *pkey, int *errnop)
   int yperr = yp_match (domain, "publickey.byname", netname, strlen (netname),
                        &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -102,7 +102,7 @@ _nss_nis_getsecretkey (const char *netname, char *skey, char *passwd,
   int yperr = yp_match (domain, "publickey.byname", netname, strlen (netname),
                        &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
index 6726efde57cc27a1a95a30663ff1f1aa3d6dc68b..aab14c64dff304050f333b59fcaae3399e99241b 100644 (file)
@@ -57,7 +57,7 @@ _nis_saveit (int instatus, char *inkey, int inkeylen, char *inval,
     {
       struct response_t *bucket = intern->next;
 
-      if (__builtin_expect (bucket == NULL, 0))
+      if (__glibc_unlikely (bucket == NULL))
        {
 #define MINSIZE 4096 - 4 * sizeof (void *)
          const size_t minsize = MAX (MINSIZE, 2 * (invallen + 1));
@@ -92,7 +92,7 @@ _nis_saveit (int instatus, char *inkey, int inkeylen, char *inval,
        }
 
       char *p = mempcpy (&bucket->mem[intern->offset], inval, invallen);
-      if (__builtin_expect (p[-1] != '\0', 0))
+      if (__glibc_unlikely (p[-1] != '\0'))
        {
          *p = '\0';
          ++invallen;
@@ -143,7 +143,7 @@ internal_nis_setpwent (void)
 {
   /* We have to read all the data now.  */
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   struct ypall_callback ypcb;
@@ -210,7 +210,7 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
        handle_batch_read:
          bucket = intern.next;
 
-         if (__builtin_expect (intern.offset >= bucket->size, 0))
+         if (__glibc_unlikely (intern.offset >= bucket->size))
            {
              if (bucket->next == NULL)
                return NSS_STATUS_NOTFOUND;
@@ -249,7 +249,7 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
            yperr = yp_next (domain, "passwd.byname", oldkey, oldkeylen,
                             &outkey, &keylen, &result, &len);
 
-         if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+         if (__glibc_unlikely (yperr != YPERR_SUCCESS))
            {
              enum nss_status retval = yperr2nss (yperr);
 
@@ -312,7 +312,7 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
       else
        {
        non_adjunct:
-         if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+         if (__glibc_unlikely ((size_t) (len + 1) > buflen))
            {
              free (result);
              *errnop = ERANGE;
@@ -330,7 +330,7 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
 
       parse_res = _nss_files_parse_pwent (p, pwd, (void *) buffer, buflen,
                                          errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          if (!batch_read)
            free (outkey);
@@ -379,7 +379,7 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   size_t namelen = strlen (name);
@@ -388,7 +388,7 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
   int len;
   int yperr = yp_match (domain, "passwd.byname", name, namelen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -447,7 +447,7 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
   else
     {
     non_adjunct:
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
        {
          free (result);
          *errnop = ERANGE;
@@ -464,7 +464,7 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
 
   int parse_res = _nss_files_parse_pwent (p, pwd, (void *) buffer, buflen,
                                          errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
@@ -480,7 +480,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
                     char *buffer, size_t buflen, int *errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char buf[32];
@@ -490,7 +490,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
   int len;
   int yperr = yp_match (domain, "passwd.byuid", buf, nlen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -552,7 +552,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
   else
     {
     non_adjunct:
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
        {
          free (result);
          *errnop = ERANGE;
@@ -569,7 +569,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
 
   int parse_res = _nss_files_parse_pwent (p, pwd, (void *) buffer, buflen,
                                          errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index a2fff630c42082f370e8187473c623fcdd2af11a..cb4b0895c64fdb920319a54246df84c7413a1f6f 100644 (file)
@@ -124,7 +124,7 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
     {
       struct response_t *bucket = intern->next;
 
-      if (__builtin_expect (intern->offset >= bucket->size, 0))
+      if (__glibc_unlikely (intern->offset >= bucket->size))
        {
          if (bucket->next == NULL)
            return NSS_STATUS_NOTFOUND;
@@ -139,7 +139,7 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
         ++intern->offset;
 
       size_t len = strlen (p) + 1;
-      if (__builtin_expect (len > buflen, 0))
+      if (__glibc_unlikely (len > buflen))
        {
          *errnop = ERANGE;
          return NSS_STATUS_TRYAGAIN;
@@ -156,7 +156,7 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
       p = memcpy (buffer, &bucket->mem[intern->offset], len);
 
       parse_res = _nss_files_parse_rpcent (p, rpc, pdata, buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        return NSS_STATUS_TRYAGAIN;
 
       intern->offset += len;
@@ -193,7 +193,7 @@ _nss_nis_getrpcbyname_r (const char *name, struct rpcent *rpc,
 
   intern_t data = { NULL, NULL, 0 };
   enum nss_status status = internal_nis_setrpcent (&data);
-  if (__builtin_expect (status != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (status != NSS_STATUS_SUCCESS))
     return status;
 
   int found = 0;
@@ -222,7 +222,7 @@ _nss_nis_getrpcbyname_r (const char *name, struct rpcent *rpc,
 
   internal_nis_endrpcent (&data);
 
-  if (__builtin_expect (!found && status == NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (!found && status == NSS_STATUS_SUCCESS))
     return NSS_STATUS_NOTFOUND;
 
   return status;
@@ -233,7 +233,7 @@ _nss_nis_getrpcbynumber_r (int number, struct rpcent *rpc,
                           char *buffer, size_t buflen, int *errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   char buf[32];
@@ -243,7 +243,7 @@ _nss_nis_getrpcbynumber_r (int number, struct rpcent *rpc,
   int len;
   int yperr = yp_match (domain, "rpc.bynumber", buf, nlen, &result, &len);
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -252,7 +252,7 @@ _nss_nis_getrpcbynumber_r (int number, struct rpcent *rpc,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + 1) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -267,7 +267,7 @@ _nss_nis_getrpcbynumber_r (int number, struct rpcent *rpc,
 
   int parse_res = _nss_files_parse_rpcent (p, rpc, (void  *) buffer, buflen,
                                           errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index fd79d3fe0794c6f09d3119cf1010069d5aa4c764..f9b4a86d764712499a2f9b2d1499fbbda76814e1 100644 (file)
@@ -56,12 +56,12 @@ dosearch (int instatus, char *inkey, int inkeylen, char *inval,
 {
   struct search_t *req = (struct search_t *) indata;
 
-  if (__builtin_expect (instatus != YP_TRUE, 0))
+  if (__glibc_unlikely (instatus != YP_TRUE))
     return 1;
 
   if (inkey && inkeylen > 0 && inval && invallen > 0)
     {
-      if (__builtin_expect ((size_t) (invallen + 1) > req->buflen, 0))
+      if (__glibc_unlikely ((size_t) (invallen + 1) > req->buflen))
        {
          *req->errnop = ERANGE;
          req->status = NSS_STATUS_TRYAGAIN;
@@ -196,7 +196,7 @@ internal_nis_getservent_r (struct servent *serv, char *buffer,
     {
       struct response_t *bucket = intern.next;
 
-      if (__builtin_expect (intern.offset >= bucket->size, 0))
+      if (__glibc_unlikely (intern.offset >= bucket->size))
        {
          if (bucket->next == NULL)
            return NSS_STATUS_NOTFOUND;
@@ -211,7 +211,7 @@ internal_nis_getservent_r (struct servent *serv, char *buffer,
         ++intern.offset;
 
       size_t len = strlen (p) + 1;
-      if (__builtin_expect (len > buflen, 0))
+      if (__glibc_unlikely (len > buflen))
        {
          *errnop = ERANGE;
          return NSS_STATUS_TRYAGAIN;
@@ -228,7 +228,7 @@ internal_nis_getservent_r (struct servent *serv, char *buffer,
       p = memcpy (buffer, &bucket->mem[intern.offset], len);
 
       parse_res = _nss_files_parse_servent (p, serv, pdata, buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
         return NSS_STATUS_TRYAGAIN;
 
       intern.offset += len;
@@ -265,7 +265,7 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
     }
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   /* If the protocol is given, we could try if our NIS server knows
@@ -289,9 +289,9 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
 
   /* If we found the key, it's ok and parse the result. If not,
      fall through and parse the complete table. */
-  if (__builtin_expect (status == YPERR_SUCCESS, 1))
+  if (__glibc_likely (status == YPERR_SUCCESS))
     {
-      if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+      if (__glibc_unlikely ((size_t) (len + 1) > buflen))
        {
          free (result);
          *errnop = ERANGE;
@@ -306,7 +306,7 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
 
       int parse_res = _nss_files_parse_servent (p, serv, (void *) buffer,
                                                buflen, errnop);
-      if (__builtin_expect (parse_res < 0, 0))
+      if (__glibc_unlikely (parse_res < 0))
        {
          if (parse_res == -1)
            return NSS_STATUS_TRYAGAIN;
@@ -336,7 +336,7 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
   req.status = NSS_STATUS_NOTFOUND;
   status = yp_all (domain, "services.byname", &ypcb);
 
-  if (__builtin_expect (status != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (status != YPERR_SUCCESS))
     return yperr2nss (status);
 
   return req.status;
@@ -348,7 +348,7 @@ _nss_nis_getservbyport_r (int port, const char *protocol,
                          size_t buflen, int *errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   /* If the protocol is given, we only need one query.
@@ -370,9 +370,9 @@ _nss_nis_getservbyport_r (int port, const char *protocol,
 
       /* If we found the key, it's ok and parse the result. If not,
         fall through and parse the complete table. */
-      if (__builtin_expect (status == YPERR_SUCCESS, 1))
+      if (__glibc_likely (status == YPERR_SUCCESS))
        {
-         if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+         if (__glibc_unlikely ((size_t) (len + 1) > buflen))
            {
              free (result);
              *errnop = ERANGE;
@@ -386,7 +386,7 @@ _nss_nis_getservbyport_r (int port, const char *protocol,
          free (result);
          int parse_res = _nss_files_parse_servent (p, serv, (void *) buffer,
                                                    buflen, errnop);
-         if (__builtin_expect (parse_res < 0, 0))
+         if (__glibc_unlikely (parse_res < 0))
            {
              if (parse_res == -1)
                return NSS_STATUS_TRYAGAIN;
@@ -417,7 +417,7 @@ _nss_nis_getservbyport_r (int port, const char *protocol,
   req.status = NSS_STATUS_NOTFOUND;
   int status = yp_all (domain, "services.byname", &ypcb);
 
-  if (__builtin_expect (status != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (status != YPERR_SUCCESS))
     return yperr2nss (status);
 
   return req.status;
index d024c0d22cdecb2b90820d5b6789e773e083a887..7cfc3ce61701d02955bd71d4dbff8762c6f87821 100644 (file)
@@ -71,7 +71,7 @@ internal_nis_getspent_r (struct spwd *sp, char *buffer, size_t buflen,
                         int *errnop)
 {
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   /* Get the next entry until we found a correct one. */
@@ -102,7 +102,7 @@ internal_nis_getspent_r (struct spwd *sp, char *buffer, size_t buflen,
                                  ? "passwd.adjunct.byname" : "shadow.byname"),
                         oldkey, oldkeylen, &outkey, &keylen, &result, &len);
 
-      if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+      if (__glibc_unlikely (yperr != YPERR_SUCCESS))
        {
          enum nss_status retval = yperr2nss (yperr);
 
@@ -177,7 +177,7 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
   const size_t name_len = strlen (name);
 
   char *domain;
-  if (__builtin_expect (yp_get_default_domain (&domain), 0))
+  if (__glibc_unlikely (yp_get_default_domain (&domain)))
     return NSS_STATUS_UNAVAIL;
 
   bool adjunct_used = false;
@@ -194,7 +194,7 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
       adjunct_used = true;
     }
 
-  if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+  if (__glibc_unlikely (yperr != YPERR_SUCCESS))
     {
       enum nss_status retval = yperr2nss (yperr);
 
@@ -203,7 +203,7 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
       return retval;
     }
 
-  if (__builtin_expect ((size_t) (len + (adjunct_used ? 3 : 1)) > buflen, 0))
+  if (__glibc_unlikely ((size_t) (len + (adjunct_used ? 3 : 1)) > buflen))
     {
       free (result);
       *errnop = ERANGE;
@@ -224,7 +224,7 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
 
   int parse_res = _nss_files_parse_spent (p, sp, (void *) buffer, buflen,
                                          errnop);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index e3a82ffc49ca0ff418e32ff4311c14c0fe64df71..9e3849bd65ba9729a802c9f03c63405150e3daf6 100644 (file)
@@ -310,7 +310,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
       nis_freeresult (result);
@@ -323,7 +323,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
   /* We do not need the lookup result anymore.  */
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       __set_errno (olderr);
 
index cc7695f037770349e3f61074c8ca3f1b995844ad..a962166bd331c4c40dd511f5e38600c1d5cb4ec6 100644 (file)
@@ -264,7 +264,7 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
       nis_freeresult (result);
@@ -277,7 +277,7 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
   /* We do not need the lookup result anymore.  */
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       __set_errno (olderr);
 
@@ -331,7 +331,7 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
       nis_freeresult (result);
@@ -344,7 +344,7 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
   /* We do not need the lookup result anymore.  */
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        return NSS_STATUS_TRYAGAIN;
index 86675329778194e454472227ea3a92974e0cc87c..58f31c8c2bfbf2f60347619e8f877d521f729943 100644 (file)
@@ -242,7 +242,7 @@ internal_nisplus_getgrent_r (struct group *gr, char *buffer, size_t buflen,
 
       parse_res = _nss_nisplus_parse_grent (&result, gr,
                                            buffer, buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          *errnop = ERANGE;
          retval = NSS_STATUS_TRYAGAIN;
@@ -316,7 +316,7 @@ _nss_nisplus_getgrnam_r (const char *name, struct group *gr,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -326,7 +326,7 @@ _nss_nisplus_getgrnam_r (const char *name, struct group *gr,
 
   parse_res = _nss_nisplus_parse_grent (result, gr, buffer, buflen, errnop);
   nis_freeresult (result);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
@@ -371,7 +371,7 @@ _nss_nisplus_getgrgid_r (const gid_t gid, struct group *gr,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -384,7 +384,7 @@ _nss_nisplus_getgrgid_r (const gid_t gid, struct group *gr,
   parse_res = _nss_nisplus_parse_grent (result, gr, buffer, buflen, errnop);
 
   nis_freeresult (result);
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       __set_errno (olderr);
 
index 62440f2459b3dca75ea8f410e16fc627af39e18b..b3e0df5883cf18741f39785bd215462218fc0595 100644 (file)
@@ -439,7 +439,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
     }
 
   int retval = niserr2nss (result->status);
-  if (__builtin_expect (retval != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (retval != NSS_STATUS_SUCCESS))
     {
       if (retval == NSS_STATUS_TRYAGAIN)
        {
@@ -543,7 +543,7 @@ _nss_nisplus_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
     }
 
   retval = niserr2nss (result->status);
-  if (__builtin_expect (retval != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (retval != NSS_STATUS_SUCCESS))
     {
       if (retval == NSS_STATUS_TRYAGAIN)
        {
@@ -587,7 +587,7 @@ _nss_nisplus_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
   enum nss_status status = internal_gethostbyname2_r (name, AF_UNSPEC, &host,
                                                      buffer, buflen,
                                                      errnop, herrnop, 0);
-  if (__builtin_expect (status == NSS_STATUS_SUCCESS, 1))
+  if (__glibc_likely (status == NSS_STATUS_SUCCESS))
     {
       if (*pat == NULL)
        {
@@ -596,7 +596,7 @@ _nss_nisplus_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
          buffer += pad;
          buflen = buflen > pad ? buflen - pad : 0;
 
-         if (__builtin_expect (buflen < sizeof (struct gaih_addrtuple), 0))
+         if (__glibc_unlikely (buflen < sizeof (struct gaih_addrtuple)))
            {
              free (result);
              *errnop = ERANGE;
index 9df9643a282c48a51da7ecfbe4190307663b0167..c304f0e18ca6a06b1de5f7a721e09ad8e28c9316 100644 (file)
@@ -67,7 +67,7 @@ _nss_nisplus_initgroups_dyn (const char *user, gid_t group, long int *start,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -98,7 +98,7 @@ _nss_nisplus_initgroups_dyn (const char *user, gid_t group, long int *start,
 
       gid_t gid;
       char *endp;
-      if (__builtin_expect (numstr[len - 1] != '\0', 0))
+      if (__glibc_unlikely (numstr[len - 1] != '\0'))
        {
          char numstrbuf[len + 1];
          memcpy (numstrbuf, numstr, len);
index ed4a8f35e4311820637c4f47e32191f052f1c6a7..43e955d14eb507fe7e7fbc34b72fb1f0f513a6d5 100644 (file)
@@ -376,7 +376,7 @@ _nss_nisplus_getnetbyname_r (const char *name, struct netent *network,
     }
 
   retval = niserr2nss (result->status);
-  if (__builtin_expect (retval != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (retval != NSS_STATUS_SUCCESS))
     {
       if (retval == NSS_STATUS_TRYAGAIN)
        {
@@ -447,7 +447,7 @@ _nss_nisplus_getnetbyaddr_r (uint32_t addr, const int type,
            return NSS_STATUS_TRYAGAIN;
          }
        enum nss_status retval = niserr2nss (result->status);
-       if (__builtin_expect (retval != NSS_STATUS_SUCCESS, 0))
+       if (__glibc_unlikely (retval != NSS_STATUS_SUCCESS))
          {
            if (b2len > 2 && buf2[b2len - 2] == '.' && buf2[b2len - 1] == '0')
              {
index 358d7de216d26580067b45471f0dea2dd2f443eb..cfe32f5fa77bd0b15ec25b7499607dff6edbf8dc 100644 (file)
@@ -347,7 +347,7 @@ _nss_nisplus_getprotobyname_r (const char *name, struct protoent *proto,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -408,7 +408,7 @@ _nss_nisplus_getprotobynumber_r (const int number, struct protoent *proto,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
index 1a732bc8137c5ed110e89a2f0ed26ebd706ed0ea..811131c0adf535ee9f7a3ee705653e3768c57cd3 100644 (file)
@@ -243,7 +243,7 @@ internal_nisplus_getpwent_r (struct passwd *pw, char *buffer, size_t buflen,
       parse_res = _nss_nisplus_parse_pwent (&result, pw, buffer,
                                            buflen, errnop);
 
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          *errnop = ERANGE;
          retval = NSS_STATUS_TRYAGAIN;
@@ -317,7 +317,7 @@ _nss_nisplus_getpwnam_r (const char *name, struct passwd *pw,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status =  niserr2nss (result->status);
 
@@ -331,7 +331,7 @@ _nss_nisplus_getpwnam_r (const char *name, struct passwd *pw,
 
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
@@ -376,7 +376,7 @@ _nss_nisplus_getpwuid_r (const uid_t uid, struct passwd *pw,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -390,7 +390,7 @@ _nss_nisplus_getpwuid_r (const uid_t uid, struct passwd *pw,
 
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
index 5604a5f850129f42b22be78b39b1a2f5df3db649..0bcd0fb3c5672fdd4666841b3672f5020c866f54 100644 (file)
@@ -351,7 +351,7 @@ _nss_nisplus_getrpcbyname_r (const char *name, struct rpcent *rpc,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
index 805ccfb2fbadbd261e8eae973888262e7bf7f59b..c32823b6328a4f6d15086edb5cdcaff22661f687 100644 (file)
@@ -258,7 +258,7 @@ internal_nisplus_getservent_r (struct servent *serv, char *buffer,
 
       parse_res = _nss_nisplus_parse_servent (result, serv, buffer,
                                              buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          nis_freeresult (result);
          result = saved_res;
@@ -360,7 +360,7 @@ _nss_nisplus_getservbyname_r (const char *name, const char *protocol,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -374,7 +374,7 @@ _nss_nisplus_getservbyname_r (const char *name, const char *protocol,
                                              errnop);
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
@@ -429,7 +429,7 @@ _nss_nisplus_getservbyport_r (const int number, const char *protocol,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -443,7 +443,7 @@ _nss_nisplus_getservbyport_r (const int number, const char *protocol,
                                              errnop);
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
index 5b671e268168426636d395b202d9a47d798bf4d3..f3c7f9df826e6f44bfb40a38fbfd7c1f0aebe582 100644 (file)
@@ -124,7 +124,7 @@ internal_nisplus_getspent_r (struct spwd *sp, char *buffer, size_t buflen,
 
       parse_res = _nss_nisplus_parse_spent (result, sp, buffer,
                                            buflen, errnop);
-      if (__builtin_expect (parse_res == -1, 0))
+      if (__glibc_unlikely (parse_res == -1))
        {
          nis_freeresult (result);
          result = saved_res;
@@ -189,7 +189,7 @@ _nss_nisplus_getspnam_r (const char *name, struct spwd *sp,
       return NSS_STATUS_TRYAGAIN;
     }
 
-  if (__builtin_expect (niserr2nss (result->status) != NSS_STATUS_SUCCESS, 0))
+  if (__glibc_unlikely (niserr2nss (result->status) != NSS_STATUS_SUCCESS))
     {
       enum nss_status status = niserr2nss (result->status);
 
@@ -202,7 +202,7 @@ _nss_nisplus_getspnam_r (const char *name, struct spwd *sp,
   parse_res = _nss_nisplus_parse_spent (result, sp, buffer, buflen, errnop);
   nis_freeresult (result);
 
-  if (__builtin_expect (parse_res < 1, 0))
+  if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)
        {
index 400db0a7eed0217eae6f9e431e388047d8d366d4..dd1833bbf688362424073e3a1bab183dc79f97e4 100644 (file)
@@ -183,7 +183,7 @@ __yp_bind (const char *domain, dom_binding **ypdb)
     {
       is_new = 1;
       ysd = (dom_binding *) calloc (1, sizeof *ysd);
-      if (__builtin_expect (ysd == NULL, 0))
+      if (__glibc_unlikely (ysd == NULL))
        return YPERR_RESRC;
     }
 
@@ -471,7 +471,7 @@ yp_match (const char *indomain, const char *inmap, const char *inkey,
   *outvallen = resp.val.valdat_len;
   *outval = malloc (*outvallen + 1);
   int status = YPERR_RESRC;
-  if (__builtin_expect (*outval != NULL, 1))
+  if (__glibc_likely (*outval != NULL))
     {
       memcpy (*outval, resp.val.valdat_val, *outvallen);
       (*outval)[*outvallen] = '\0';
@@ -770,7 +770,7 @@ yp_all (const char *indomain, const char *inmap,
                          (caddr_t) &req, (xdrproc_t) __xdr_ypresp_all,
                          (caddr_t) &data, RPCTIMEOUT);
 
-      if (__builtin_expect (result != RPC_SUCCESS, 0))
+      if (__glibc_unlikely (result != RPC_SUCCESS))
        {
          /* Print the error message only on the last try.  */
          if (try == MAXTRIES - 1)
@@ -811,7 +811,7 @@ yp_maplist (const char *indomain, struct ypmaplist **outmaplist)
                         (caddr_t) &indomain, (xdrproc_t) xdr_ypresp_maplist,
                         (caddr_t) &resp);
 
-  if (__builtin_expect (result == YPERR_SUCCESS, 1))
+  if (__glibc_likely (result == YPERR_SUCCESS))
     {
       *outmaplist = resp.maps;
       /* We don't free the list, this will be done by ypserv
index 474a473bf8f2be9f550e31595ac44bbc03154886..f7241c51e4ea2ead9fafda8ba711c90f957dbe8e 100644 (file)
@@ -1,3 +1,76 @@
+2014-02-10  Ondřej Bílka  <neleai@seznam.cz>
+
+       * allocatestack.c (queue_stack, allocate_stack,
+       __deallocate_stack, __reclaim_stacks): Use glibc_likely instead
+       __builtin_expect.
+       * cancellation.c (__pthread_enable_asynccancel,
+       __pthread_disable_asynccancel): Likewise.
+       * cleanup_defer.c (__pthread_register_cancel_defer,
+       __pthread_unregister_cancel_restore): Likewise.
+       * cleanup_defer_compat.c (_pthread_cleanup_push_defer,
+       _pthread_cleanup_pop_restore): Likewise.
+       * cond-perf.c (main): Likewise.
+       * nptl-init.c (sigcancel_handler, sighandler_setxid): Likewise.
+       * perf.c (get_clockfreq): Likewise.
+       * pthread_barrier_destroy.c (pthread_barrier_destroy): Likewise.
+       * pthread_barrier_init.c (pthread_barrier_init): Likewise.
+       * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
+       * pthread_cond_wait.c (__pthread_cond_wait): Likewise.
+       * pthread_create.c (__free_tcb, start_thread, __pthread_create_2_1):
+       Likewise.
+       * pthread_getattr_np.c (pthread_getattr_np): Likewise.
+       * pthread_getspecific.c (__pthread_getspecific): Likewise.
+       * pthread_join.c (pthread_join): Likewise.
+       * pthread_key_delete.c (pthread_key_delete): Likewise.
+       * pthread_mutex_init.c (__pthread_mutex_init): Likewise.
+       * pthread_mutex_lock.c (__pthread_mutex_lock,
+       __pthread_mutex_lock_full): Likewise.
+       * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
+       * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
+       * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
+       * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Likewise.
+       * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise.
+       * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise.
+       * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
+       * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
+       * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
+       * pthread_setschedprio.c (pthread_setschedprio): Likewise.
+       * pthread_setspecific.c (__pthread_setspecific): Likewise.
+       * sem_init.c (__new_sem_init): Likewise.
+       * sem_open.c (__where_is_shmfs): Likewise.
+       * sigaction.c: Likewise.
+       * sockperf.c (get_clockfreq): Likewise.
+       * sysdeps/pthread/createthread.c (do_clone, create_thread): Likewise.
+       * sysdeps/pthread/setxid.h: Likewise.
+       * sysdeps/pthread/timer_create.c (timer_create): Likewise.
+       * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init,
+       __unwind_freeres, _Unwind_Resume, __gcc_personality_v0,
+       _Unwind_ForcedUnwind): Likewise.
+       * sysdeps/unix/sysv/linux/getpid.c (__getpid): Likewise.
+       * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
+       (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Likewise.
+       * sysdeps/unix/sysv/linux/mq_notify.c (mq_notify): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Likewise.
+       * sysdeps/unix/sysv/linux/pthread_setaffinity.c
+       (__pthread_setaffinity_new): Likewise.
+       * sysdeps/unix/sysv/linux/pthread_sigqueue.c (pthread_sigqueue):
+       Likewise.
+       * sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise.
+       * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
+       * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_robust_trylock,
+       __lll_robust_lock, __lll_cond_lock, __lll_robust_timedlock): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (__lll_lock,
+       __lll_cond_lock, __lll_timedlock, __lll_robust_timedlock): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c
+       (pthread_barrier_destroy): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c
+       (pthread_barrier_init): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sem_init.c (__new_sem_init): Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/timer_create.c (__timer_create_old):
+       Likewise.
+       * unwind.c (unwind_stop): Likewise.
+
 2014-02-08  Mike Frysinger  <vapier@gentoo.org>
 
        * sem_open.c (__where_is_shmfs): Compare f.f_type to RAMFS_MAGIC too.
index 13eca47cf25d105d49a8be2274f1d78f53cc71af..1e22f7da900baa1534962ef32e98405111d3fa85 100644 (file)
@@ -306,7 +306,7 @@ queue_stack (struct pthread *stack)
   stack_list_add (&stack->list, &stack_cache);
 
   stack_cache_actsize += stack->stackblock_size;
-  if (__builtin_expect (stack_cache_actsize > stack_cache_maxsize, 0))
+  if (__glibc_unlikely (stack_cache_actsize > stack_cache_maxsize))
     __free_stacks (stack_cache_maxsize);
 }
 
@@ -368,7 +368,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
     }
 
   /* Get memory for the stack.  */
-  if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0))
+  if (__glibc_unlikely (attr->flags & ATTR_FLAG_STACKADDR))
     {
       uintptr_t adj;
 
@@ -504,7 +504,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
          mem = mmap (NULL, size, prot,
                      MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
 
-         if (__builtin_expect (mem == MAP_FAILED, 0))
+         if (__glibc_unlikely (mem == MAP_FAILED))
            return errno;
 
          /* SIZE is guaranteed to be greater than zero.
@@ -525,7 +525,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 
          /* Make sure the coloring offsets does not disturb the alignment
             of the TCB and static TLS block.  */
-         if (__builtin_expect ((coloring & __static_tls_align_m1) != 0, 0))
+         if (__glibc_unlikely ((coloring & __static_tls_align_m1) != 0))
            coloring = (((coloring + __static_tls_align_m1)
                         & ~(__static_tls_align_m1))
                        & ~pagesize_m1);
@@ -629,7 +629,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
        }
 
       /* Create or resize the guard area if necessary.  */
-      if (__builtin_expect (guardsize > pd->guardsize, 0))
+      if (__glibc_unlikely (guardsize > pd->guardsize))
        {
 #ifdef NEED_SEPARATE_REGISTER_STACK
          char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
@@ -752,7 +752,7 @@ __deallocate_stack (struct pthread *pd)
      not reset the 'used' flag in the 'tid' field.  This is done by
      the kernel.  If no thread has been created yet this field is
      still zero.  */
-  if (__builtin_expect (! pd->user_stack, 1))
+  if (__glibc_likely (! pd->user_stack))
     (void) queue_stack (pd);
   else
     /* Free the memory associated with the ELF TLS.  */
@@ -916,7 +916,7 @@ __reclaim_stacks (void)
   INIT_LIST_HEAD (&stack_used);
   INIT_LIST_HEAD (&__stack_user);
 
-  if (__builtin_expect (THREAD_GETMEM (self, user_stack), 0))
+  if (__glibc_unlikely (THREAD_GETMEM (self, user_stack)))
     list_add (&self->list, &__stack_user);
   else
     list_add (&self->list, &stack_used);
index bddea1f3fafaf3be69dd4174ad058372f86da64f..aaf102dd0f40079729e62245ef58862eec151966 100644 (file)
@@ -40,7 +40,7 @@ __pthread_enable_asynccancel (void)
 
       int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval,
                                              oldval);
-      if (__builtin_expect (curval == oldval, 1))
+      if (__glibc_likely (curval == oldval))
        {
          if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval))
            {
@@ -79,7 +79,7 @@ __pthread_disable_asynccancel (int oldtype)
 
       int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval,
                                              oldval);
-      if (__builtin_expect (curval == oldval, 1))
+      if (__glibc_likely (curval == oldval))
        break;
 
       /* Prepare the next round.  */
index 404949715513f7ed5fbf4180d4c9f3f18a539a27..a8fc40304edd1d9b1113e818aa44ee3e2588768a 100644 (file)
@@ -34,14 +34,14 @@ __pthread_register_cancel_defer (__pthread_unwind_buf_t *buf)
   int cancelhandling = THREAD_GETMEM (self, cancelhandling);
 
   /* Disable asynchronous cancellation for now.  */
-  if (__builtin_expect (cancelhandling & CANCELTYPE_BITMASK, 0))
+  if (__glibc_unlikely (cancelhandling & CANCELTYPE_BITMASK))
     while (1)
       {
        int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling,
                                                cancelhandling
                                                & ~CANCELTYPE_BITMASK,
                                                cancelhandling);
-       if (__builtin_expect (curval == cancelhandling, 1))
+       if (__glibc_likely (curval == cancelhandling))
          /* Successfully replaced the value.  */
          break;
 
@@ -78,7 +78,7 @@ __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *buf)
                                                  cancelhandling
                                                  | CANCELTYPE_BITMASK,
                                                  cancelhandling);
-         if (__builtin_expect (curval == cancelhandling, 1))
+         if (__glibc_likely (curval == cancelhandling))
            /* Successfully replaced the value.  */
            break;
 
index b57fd4e2855ca02a3e2b99e4acf1215e9107e52b..9c52f5fc53ac613743b40c4ee0975a742ce52da3 100644 (file)
@@ -34,14 +34,14 @@ _pthread_cleanup_push_defer (buffer, routine, arg)
   int cancelhandling = THREAD_GETMEM (self, cancelhandling);
 
   /* Disable asynchronous cancellation for now.  */
-  if (__builtin_expect (cancelhandling & CANCELTYPE_BITMASK, 0))
+  if (__glibc_unlikely (cancelhandling & CANCELTYPE_BITMASK))
     while (1)
       {
        int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling,
                                                cancelhandling
                                                & ~CANCELTYPE_BITMASK,
                                                cancelhandling);
-       if (__builtin_expect (curval == cancelhandling, 1))
+       if (__glibc_likely (curval == cancelhandling))
          /* Successfully replaced the value.  */
          break;
 
@@ -78,7 +78,7 @@ _pthread_cleanup_pop_restore (buffer, execute)
                                                  cancelhandling
                                                  | CANCELTYPE_BITMASK,
                                                  cancelhandling);
-         if (__builtin_expect (curval == cancelhandling, 1))
+         if (__glibc_likely (curval == cancelhandling))
            /* Successfully replaced the value.  */
            break;
 
index e37914e6b7c48d37244371618e7f624f8e2ff2e0..9c9488e2743f17eb4beeaadf45ef83a38a9f9bf9 100644 (file)
@@ -70,7 +70,7 @@ main (int argc, char *argv[])
   pthread_t th[nthreads];
   int i;
   for (i = 0; __builtin_expect (i < nthreads, 1); ++i)
-    if (__builtin_expect ((err = pthread_create (&th[i], NULL, cons, (void *) (long) i)) != 0, 0))
+    if (__glibc_unlikely ((err = pthread_create (&th[i], NULL, cons, (void *) (long) i)) != 0))
       printf ("pthread_create: %s\n", strerror (err));
 
   for (i = 0; __builtin_expect (i < nrounds, 1); ++i)
index 4d1f7d872140e8514fb29a58eb90410dee4fb834..794156ba8e74e839b9b6a533c8057c1ca50c72d7 100644 (file)
@@ -175,7 +175,7 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx)
   /* Determine the process ID.  It might be negative if the thread is
      in the middle of a fork() call.  */
   pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
-  if (__builtin_expect (pid < 0, 0))
+  if (__glibc_unlikely (pid < 0))
     pid = -pid;
 
   /* Safety check.  It would be possible to call this function for
@@ -232,7 +232,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
   /* Determine the process ID.  It might be negative if the thread is
      in the middle of a fork() call.  */
   pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
-  if (__builtin_expect (pid < 0, 0))
+  if (__glibc_unlikely (pid < 0))
     pid = -pid;
 
   /* Safety check.  It would be possible to call this function for
index ceb30c6bcca40304513014f6a9a87a577b844bfb..3ecab2ca5635fc57e7c3a4312e9c8faee443bf59 100644 (file)
@@ -633,7 +633,7 @@ get_clockfreq (void)
     return result;
 
   fd = open ("/proc/cpuinfo", O_RDONLY);
-  if (__builtin_expect (fd != -1, 1))
+  if (__glibc_likely (fd != -1))
     {
       /* XXX AFAIK the /proc filesystem can generate "files" only up
          to a size of 4096 bytes.  */
@@ -645,7 +645,7 @@ get_clockfreq (void)
        {
          char *mhz = memmem (buf, n, "cpu MHz", 7);
 
-         if (__builtin_expect (mhz != NULL, 1))
+         if (__glibc_likely (mhz != NULL))
            {
              char *endp = buf + n;
              int seen_decpoint = 0;
index 60fe2dfbffdbd5dea3fe23386e0f4ea12dd71c12..c59a8612216ceb3d8f12de3a517f6c3f82617b76 100644 (file)
@@ -32,7 +32,7 @@ pthread_barrier_destroy (barrier)
 
   lll_lock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG);
 
-  if (__builtin_expect (ibarrier->left == ibarrier->init_count, 1))
+  if (__glibc_likely (ibarrier->left == ibarrier->init_count))
     /* The barrier is not used anymore.  */
     result = 0;
   else
index 0e603ba59e3a83a4a6ec95331e59ce0bb7d8950e..ac180a9a5ca13c9682f210699108f42cb6d5a51c 100644 (file)
@@ -36,7 +36,7 @@ pthread_barrier_init (barrier, attr, count)
 {
   struct pthread_barrier *ibarrier;
 
-  if (__builtin_expect (count == 0, 0))
+  if (__glibc_unlikely (count == 0))
     return EINVAL;
 
   const struct pthread_barrierattr *iattr
index b975b8f126ad6e9afac44f152a6aa12054564a9a..1698085361f1992e88083025e44142dea4de56a1 100644 (file)
@@ -87,7 +87,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
 
   /* Work around the fact that the kernel rejects negative timeout values
      despite them being valid.  */
-  if (__builtin_expect (abstime->tv_sec < 0, 0))
+  if (__glibc_unlikely (abstime->tv_sec < 0))
     goto timeout;
 
   /* Remember the mutex we are using here.  If there is already a
@@ -143,7 +143,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
          --rt.tv_sec;
        }
       /* Did we already time out?  */
-      if (__builtin_expect (rt.tv_sec < 0, 0))
+      if (__glibc_unlikely (rt.tv_sec < 0))
        {
          if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
            goto bc_out;
@@ -217,7 +217,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
        break;
 
       /* Not woken yet.  Maybe the time expired?  */
-      if (__builtin_expect (err == -ETIMEDOUT, 0))
+      if (__glibc_unlikely (err == -ETIMEDOUT))
        {
        timeout:
          /* Yep.  Adjust the counters.  */
index 6222d922ffdc962dfaa8c81a58aa870767a9fba9..9d2dfceec5c6b4ee8be669b0b28d20a8146dcb32 100644 (file)
@@ -119,7 +119,7 @@ __pthread_cond_wait (cond, mutex)
 
   /* Now we can release the mutex.  */
   err = __pthread_mutex_unlock_usercnt (mutex, 0);
-  if (__builtin_expect (err, 0))
+  if (__glibc_unlikely (err))
     {
       lll_unlock (cond->__data.__lock, pshared);
       return err;
index 9d7f52f57e86a13d5c06b126cee0f846c462b586..cee0806d52e8f675fb1a47b1392b7ca5d6cde1fe 100644 (file)
@@ -211,7 +211,7 @@ __free_tcb (struct pthread *pd)
        abort ();
 
       /* Free TPP data.  */
-      if (__builtin_expect (pd->tpp != NULL, 0))
+      if (__glibc_unlikely (pd->tpp != NULL))
        {
          struct priority_protection_data *tpp = pd->tpp;
 
@@ -246,7 +246,7 @@ start_thread (void *arg)
   __ctype_init ();
 
   /* Allow setxid from now onwards.  */
-  if (__builtin_expect (atomic_exchange_acq (&pd->setxid_futex, 0) == -2, 0))
+  if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2))
     lll_futex_wake (&pd->setxid_futex, 1, LLL_PRIVATE);
 
 #ifdef __NR_set_robust_list
@@ -265,7 +265,7 @@ start_thread (void *arg)
   /* If the parent was running cancellation handlers while creating
      the thread the new thread inherited the signal mask.  Reset the
      cancellation signal mask.  */
-  if (__builtin_expect (pd->parent_cancelhandling & CANCELING_BITMASK, 0))
+  if (__glibc_unlikely (pd->parent_cancelhandling & CANCELING_BITMASK))
     {
       INTERNAL_SYSCALL_DECL (err);
       sigset_t mask;
@@ -285,12 +285,12 @@ start_thread (void *arg)
 
   int not_first_call;
   not_first_call = setjmp ((struct __jmp_buf_tag *) unwind_buf.cancel_jmp_buf);
-  if (__builtin_expect (! not_first_call, 1))
+  if (__glibc_likely (! not_first_call))
     {
       /* Store the new cleanup handler info.  */
       THREAD_SETMEM (pd, cleanup_jmp_buf, &unwind_buf);
 
-      if (__builtin_expect (pd->stopped_start, 0))
+      if (__glibc_unlikely (pd->stopped_start))
        {
          int oldtype = CANCEL_ASYNC ();
 
@@ -327,12 +327,12 @@ start_thread (void *arg)
   /* If this is the last thread we terminate the process now.  We
      do not notify the debugger, it might just irritate it if there
      is no thread left.  */
-  if (__builtin_expect (atomic_decrement_and_test (&__nptl_nthreads), 0))
+  if (__glibc_unlikely (atomic_decrement_and_test (&__nptl_nthreads)))
     /* This was the last thread.  */
     exit (0);
 
   /* Report the death of the thread if this is wanted.  */
-  if (__builtin_expect (pd->report_events, 0))
+  if (__glibc_unlikely (pd->report_events))
     {
       /* See whether TD_DEATH is in any of the mask.  */
       const int idx = __td_eventword (TD_DEATH);
@@ -412,7 +412,7 @@ start_thread (void *arg)
   if (IS_DETACHED (pd))
     /* Free the TCB.  */
     __free_tcb (pd);
-  else if (__builtin_expect (pd->cancelhandling & SETXID_BITMASK, 0))
+  else if (__glibc_unlikely (pd->cancelhandling & SETXID_BITMASK))
     {
       /* Some other thread might call any of the setXid functions and expect
         us to reply.  In this case wait until we did that.  */
@@ -482,7 +482,7 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
   int err = ALLOCATE_STACK (iattr, &pd);
   int retval = 0;
 
-  if (__builtin_expect (err != 0, 0))
+  if (__glibc_unlikely (err != 0))
     /* Something went wrong.  Maybe a parameter of the attributes is
        invalid or we could not allocate memory.  Note we have to
        translate error codes.  */
index e79f282fee77e98d05c2b50e4ff9e7e205157f1b..21110c36b0b243bc5fc4cb0dd0686f2a68805419 100644 (file)
@@ -57,7 +57,7 @@ pthread_getattr_np (thread_id, attr)
   iattr->guardsize = thread->reported_guardsize;
 
   /* The sizes are subject to alignment.  */
-  if (__builtin_expect (thread->stackblock != NULL, 1))
+  if (__glibc_likely (thread->stackblock != NULL))
     {
       iattr->stacksize = thread->stackblock_size;
       iattr->stackaddr = (char *) thread->stackblock + iattr->stacksize;
index e0e7daca242deacdb2fca7ea45037b004ded635b..e0cc1993adec368e6f54d36cda06177e2d1f8b83 100644 (file)
@@ -28,7 +28,7 @@ __pthread_getspecific (key)
 
   /* Special case access to the first 2nd-level block.  This is the
      usual case.  */
-  if (__builtin_expect (key < PTHREAD_KEY_2NDLEVEL_SIZE, 1))
+  if (__glibc_likely (key < PTHREAD_KEY_2NDLEVEL_SIZE))
     data = &THREAD_SELF->specific_1stblock[key];
   else
     {
@@ -58,7 +58,7 @@ __pthread_getspecific (key)
     {
       uintptr_t seq = data->seq;
 
-      if (__builtin_expect (seq != __pthread_keys[key].seq, 0))
+      if (__glibc_unlikely (seq != __pthread_keys[key].seq))
        result = data->data = NULL;
     }
 
index 69f844a860c58753da269bd0896026dc8b92e974..5a43182d8a88680a6d20f73a129d4133dce9255a 100644 (file)
@@ -99,7 +99,7 @@ pthread_join (threadid, thread_return)
   pthread_cleanup_pop (0);
 
 
-  if (__builtin_expect (result == 0, 1))
+  if (__glibc_likely (result == 0))
     {
       /* We mark the thread as terminated and as joined.  */
       pd->tid = -1;
index a79a0ea52a1f09a1032e0f9bc150621def7d6ce4..d2981b8af1e9fdd23c563ebf8feeef69cb44c603 100644 (file)
@@ -27,7 +27,7 @@ pthread_key_delete (key)
 {
   int result = EINVAL;
 
-  if (__builtin_expect (key < PTHREAD_KEYS_MAX, 1))
+  if (__glibc_likely (key < PTHREAD_KEYS_MAX))
     {
       unsigned int seq = __pthread_keys[key].seq;
 
index d67dcdb5e2fcf75e7d59885b420bb811ea28e429..2b3468835c2f773f7ae61c5bf460eee98c541007 100644 (file)
@@ -59,7 +59,7 @@ __pthread_mutex_init (mutex, mutexattr)
 
     case PTHREAD_PRIO_INHERIT << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT:
 #ifndef __ASSUME_FUTEX_LOCK_PI
-      if (__builtin_expect (tpi_supported == 0, 0))
+      if (__glibc_unlikely (tpi_supported == 0))
        {
          int lock = 0;
          INTERNAL_SYSCALL_DECL (err);
@@ -68,7 +68,7 @@ __pthread_mutex_init (mutex, mutexattr)
          assert (INTERNAL_SYSCALL_ERROR_P (ret, err));
          tpi_supported = INTERNAL_SYSCALL_ERRNO (ret, err) == ENOSYS ? -1 : 1;
        }
-      if (__builtin_expect (tpi_supported < 0, 0))
+      if (__glibc_unlikely (tpi_supported < 0))
        return ENOTSUP;
 #endif
       break;
index add76e8a23dafd631d7f852e6251fb509689bd74..2c317770f9b9d2a027efbed1b32af3a36d45395f 100644 (file)
@@ -71,7 +71,7 @@ __pthread_mutex_lock (mutex)
                                 | PTHREAD_MUTEX_ELISION_FLAGS_NP), 0))
     return __pthread_mutex_lock_full (mutex);
 
-  if (__builtin_expect (type == PTHREAD_MUTEX_TIMED_NP, 1))
+  if (__glibc_likely (type == PTHREAD_MUTEX_TIMED_NP))
     {
       FORCE_ELISION (mutex, goto elision);
     simple:
@@ -80,7 +80,7 @@ __pthread_mutex_lock (mutex)
       assert (mutex->__data.__owner == 0);
     }
 #ifdef HAVE_ELISION
-  else if (__builtin_expect (type == PTHREAD_MUTEX_TIMED_ELISION_NP, 1))
+  else if (__glibc_likely (type == PTHREAD_MUTEX_TIMED_ELISION_NP))
     {
   elision: __attribute__((unused))
       /* This case can never happen on a system without elision,
@@ -101,7 +101,7 @@ __pthread_mutex_lock (mutex)
       if (mutex->__data.__owner == id)
        {
          /* Just bump the counter.  */
-         if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+         if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
            /* Overflow of the counter.  */
            return EAGAIN;
 
@@ -150,7 +150,7 @@ __pthread_mutex_lock (mutex)
       pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
       assert (PTHREAD_MUTEX_TYPE (mutex) == PTHREAD_MUTEX_ERRORCHECK_NP);
       /* Check whether we already hold the mutex.  */
-      if (__builtin_expect (mutex->__data.__owner == id, 0))
+      if (__glibc_unlikely (mutex->__data.__owner == id))
        return EDEADLK;
       goto simple;
     }
@@ -229,7 +229,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
            }
 
          /* Check whether we already hold the mutex.  */
-         if (__builtin_expect ((oldval & FUTEX_TID_MASK) == id, 0))
+         if (__glibc_unlikely ((oldval & FUTEX_TID_MASK) == id))
            {
              int kind = PTHREAD_MUTEX_TYPE (mutex);
              if (kind == PTHREAD_MUTEX_ROBUST_ERRORCHECK_NP)
@@ -245,7 +245,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
                                 NULL);
 
                  /* Just bump the counter.  */
-                 if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+                 if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                    /* Overflow of the counter.  */
                    return EAGAIN;
 
@@ -296,7 +296,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
        oldval = mutex->__data.__lock;
 
        /* Check whether we already hold the mutex.  */
-       if (__builtin_expect ((oldval & FUTEX_TID_MASK) == id, 0))
+       if (__glibc_unlikely ((oldval & FUTEX_TID_MASK) == id))
          {
            if (kind == PTHREAD_MUTEX_ERRORCHECK_NP)
              {
@@ -309,7 +309,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
                THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
 
                /* Just bump the counter.  */
-               if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+               if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                  /* Overflow of the counter.  */
                  return EAGAIN;
 
@@ -359,7 +359,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
            assert (robust || (oldval & FUTEX_OWNER_DIED) == 0);
          }
 
-       if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
+       if (__glibc_unlikely (oldval & FUTEX_OWNER_DIED))
          {
            atomic_and (&mutex->__data.__lock, ~FUTEX_OWNER_DIED);
 
@@ -427,7 +427,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
            if (kind == PTHREAD_MUTEX_RECURSIVE_NP)
              {
                /* Just bump the counter.  */
-               if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+               if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                  /* Overflow of the counter.  */
                  return EAGAIN;
 
index 8e7a52b54f040781add4699dc72795e1c23a7384..03619230ff161748ff83a215c9606a949699d586 100644 (file)
@@ -61,7 +61,7 @@ pthread_mutex_timedlock (mutex, abstime)
       if (mutex->__data.__owner == id)
        {
          /* Just bump the counter.  */
-         if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+         if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
            /* Overflow of the counter.  */
            return EAGAIN;
 
@@ -84,7 +84,7 @@ pthread_mutex_timedlock (mutex, abstime)
       /* Error checking mutex.  */
     case PTHREAD_MUTEX_ERRORCHECK_NP:
       /* Check whether we already hold the mutex.  */
-      if (__builtin_expect (mutex->__data.__owner == id, 0))
+      if (__glibc_unlikely (mutex->__data.__owner == id))
        return EDEADLK;
 
       /* FALLTHROUGH */
@@ -175,7 +175,7 @@ pthread_mutex_timedlock (mutex, abstime)
            }
 
          /* Check whether we already hold the mutex.  */
-         if (__builtin_expect ((oldval & FUTEX_TID_MASK) == id, 0))
+         if (__glibc_unlikely ((oldval & FUTEX_TID_MASK) == id))
            {
              int kind = PTHREAD_MUTEX_TYPE (mutex);
              if (kind == PTHREAD_MUTEX_ROBUST_ERRORCHECK_NP)
@@ -191,7 +191,7 @@ pthread_mutex_timedlock (mutex, abstime)
                                 NULL);
 
                  /* Just bump the counter.  */
-                 if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+                 if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                    /* Overflow of the counter.  */
                    return EAGAIN;
 
@@ -250,7 +250,7 @@ pthread_mutex_timedlock (mutex, abstime)
        oldval = mutex->__data.__lock;
 
        /* Check whether we already hold the mutex.  */
-       if (__builtin_expect ((oldval & FUTEX_TID_MASK) == id, 0))
+       if (__glibc_unlikely ((oldval & FUTEX_TID_MASK) == id))
          {
            if (kind == PTHREAD_MUTEX_ERRORCHECK_NP)
              {
@@ -263,7 +263,7 @@ pthread_mutex_timedlock (mutex, abstime)
                THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
 
                /* Just bump the counter.  */
-               if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+               if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                  /* Overflow of the counter.  */
                  return EAGAIN;
 
@@ -337,7 +337,7 @@ pthread_mutex_timedlock (mutex, abstime)
            assert (robust || (oldval & FUTEX_OWNER_DIED) == 0);
          }
 
-       if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
+       if (__glibc_unlikely (oldval & FUTEX_OWNER_DIED))
          {
            atomic_and (&mutex->__data.__lock, ~FUTEX_OWNER_DIED);
 
@@ -400,7 +400,7 @@ pthread_mutex_timedlock (mutex, abstime)
            if (kind == PTHREAD_MUTEX_RECURSIVE_NP)
              {
                /* Just bump the counter.  */
-               if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+               if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                  /* Overflow of the counter.  */
                  return EAGAIN;
 
index 4d5f75d24f88e0696ba2339a3f74376325c5f21d..e46f22ca2c044a3a8e77bc2c8540634dbda3f7a5 100644 (file)
@@ -50,7 +50,7 @@ __pthread_mutex_trylock (mutex)
       if (mutex->__data.__owner == id)
        {
          /* Just bump the counter.  */
-         if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+         if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
            /* Overflow of the counter.  */
            return EAGAIN;
 
@@ -133,7 +133,7 @@ __pthread_mutex_trylock (mutex)
            }
 
          /* Check whether we already hold the mutex.  */
-         if (__builtin_expect ((oldval & FUTEX_TID_MASK) == id, 0))
+         if (__glibc_unlikely ((oldval & FUTEX_TID_MASK) == id))
            {
              int kind = PTHREAD_MUTEX_TYPE (mutex);
              if (kind == PTHREAD_MUTEX_ROBUST_ERRORCHECK_NP)
@@ -149,7 +149,7 @@ __pthread_mutex_trylock (mutex)
                                 NULL);
 
                  /* Just bump the counter.  */
-                 if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+                 if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                    /* Overflow of the counter.  */
                    return EAGAIN;
 
@@ -211,7 +211,7 @@ __pthread_mutex_trylock (mutex)
        oldval = mutex->__data.__lock;
 
        /* Check whether we already hold the mutex.  */
-       if (__builtin_expect ((oldval & FUTEX_TID_MASK) == id, 0))
+       if (__glibc_unlikely ((oldval & FUTEX_TID_MASK) == id))
          {
            if (kind == PTHREAD_MUTEX_ERRORCHECK_NP)
              {
@@ -224,7 +224,7 @@ __pthread_mutex_trylock (mutex)
                THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
 
                /* Just bump the counter.  */
-               if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+               if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                  /* Overflow of the counter.  */
                  return EAGAIN;
 
@@ -270,7 +270,7 @@ __pthread_mutex_trylock (mutex)
            oldval = mutex->__data.__lock;
          }
 
-       if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
+       if (__glibc_unlikely (oldval & FUTEX_OWNER_DIED))
          {
            atomic_and (&mutex->__data.__lock, ~FUTEX_OWNER_DIED);
 
@@ -337,7 +337,7 @@ __pthread_mutex_trylock (mutex)
            if (kind == PTHREAD_MUTEX_RECURSIVE_NP)
              {
                /* Just bump the counter.  */
-               if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+               if (__glibc_unlikely (mutex->__data.__count + 1 == 0))
                  /* Overflow of the counter.  */
                  return EAGAIN;
 
index 8fe5b67f09949998e8427a12bb34e6b234edc355..95ae9337c8e0524bd973c82649586df765922a52 100644 (file)
@@ -60,7 +60,7 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
 
       return 0;
     }
-  else if (__builtin_expect (type == PTHREAD_MUTEX_TIMED_ELISION_NP, 1))
+  else if (__glibc_likely (type == PTHREAD_MUTEX_TIMED_ELISION_NP))
     {
       /* Don't reset the owner/users fields for elision.  */
       return lll_unlock_elision (mutex->__data.__lock,
index a06c3f2d8baade47bb117be51068f0ae96572bf2..3773f7db2a97174fd750657b5b66c51afdc3f557 100644 (file)
@@ -45,7 +45,7 @@ __pthread_rwlock_rdlock (rwlock)
              || PTHREAD_RWLOCK_PREFER_READER_P (rwlock)))
        {
          /* Increment the reader counter.  Avoid overflow.  */
-         if (__builtin_expect (++rwlock->__data.__nr_readers == 0, 0))
+         if (__glibc_unlikely (++rwlock->__data.__nr_readers == 0))
            {
              /* Overflow on number of readers.  */
              --rwlock->__data.__nr_readers;
@@ -67,7 +67,7 @@ __pthread_rwlock_rdlock (rwlock)
        }
 
       /* Remember that we are a reader.  */
-      if (__builtin_expect (++rwlock->__data.__nr_readers_queued == 0, 0))
+      if (__glibc_unlikely (++rwlock->__data.__nr_readers_queued == 0))
        {
          /* Overflow on number of queued readers.  */
          --rwlock->__data.__nr_readers_queued;
index 770cc343cf06b4fafbec0ac84d43528873fb6bdc..81b2ee4096049e4cb741df68ab9a49a542e6cc2c 100644 (file)
@@ -78,7 +78,7 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
 
       /* Work around the fact that the kernel rejects negative timeout values
         despite them being valid.  */
-      if (__builtin_expect (abstime->tv_sec < 0, 0))
+      if (__glibc_unlikely (abstime->tv_sec < 0))
        {
          result = ETIMEDOUT;
          break;
index 2e1390b34fff3935cd98ee68e2e75ab0976e884d..26f2139c9f9d3dda764d8f4537e9ed34c238ed5d 100644 (file)
@@ -69,7 +69,7 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
 
       /* Work around the fact that the kernel rejects negative timeout values
         despite them being valid.  */
-      if (__builtin_expect (abstime->tv_sec < 0, 0))
+      if (__glibc_unlikely (abstime->tv_sec < 0))
        {
          result = ETIMEDOUT;
          break;
index 697aa80c70cae1adc9e68ae774bdac314b98a165..f7b1e6b8acba758314667ea3ef09ff2497b784dc 100644 (file)
@@ -32,7 +32,7 @@ __pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
       && (rwlock->__data.__nr_writers_queued == 0
          || PTHREAD_RWLOCK_PREFER_READER_P (rwlock)))
     {
-      if (__builtin_expect (++rwlock->__data.__nr_readers == 0, 0))
+      if (__glibc_unlikely (++rwlock->__data.__nr_readers == 0))
        {
          --rwlock->__data.__nr_readers;
          result = EAGAIN;
index 3bb05030ed836cbfff6f61795782cff3fac1495f..5c3ca866bf76133039dec671c5d0467022b7a22a 100644 (file)
@@ -55,7 +55,7 @@ __pthread_setcancelstate (state, oldstate)
         atomically since other bits could be modified as well.  */
       int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval,
                                              oldval);
-      if (__builtin_expect (curval == oldval, 1))
+      if (__glibc_likely (curval == oldval))
        {
          if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval))
            __do_cancel ();
index 0a7691f5b685a72a65fef3317e56082f5a51d5bf..fb1631f0ab18491e8f0c7a1441dafd564dd32afe 100644 (file)
@@ -55,7 +55,7 @@ __pthread_setcanceltype (type, oldtype)
         atomically since other bits could be modified as well.  */
       int curval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, newval,
                                              oldval);
-      if (__builtin_expect (curval == oldval, 1))
+      if (__glibc_likely (curval == oldval))
        {
          if (CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS (newval))
            {
index 033bfecf624afd74b4780b49defa9984f4ec8438..c58ba947196b82d56d15d365a47581375b1b4a57 100644 (file)
@@ -48,7 +48,7 @@ pthread_setschedprio (threadid, prio)
     param.sched_priority = pd->tpp->priomax;
 
   /* Try to set the scheduler information.  */
-  if (__builtin_expect (sched_setparam (pd->tid, &param) == -1, 0))
+  if (__glibc_unlikely (sched_setparam (pd->tid, &param) == -1))
     result = errno;
   else
     {
index 877fb02200fc84ead302e0837c4665577e6da0db..0ace86168f511046df04833cc6184d028a94ce06 100644 (file)
@@ -36,7 +36,7 @@ __pthread_setspecific (key, value)
 
   /* Special case access to the first 2nd-level block.  This is the
      usual case.  */
-  if (__builtin_expect (key < PTHREAD_KEY_2NDLEVEL_SIZE, 1))
+  if (__glibc_likely (key < PTHREAD_KEY_2NDLEVEL_SIZE))
     {
       /* Verify the key is sane.  */
       if (KEY_UNUSED ((seq = __pthread_keys[key].seq)))
index 8bfb9c1f0cf05f95db827dadb5b45dc7117212a3..7af27751134c22694a38166fb4812e4d58bd717e 100644 (file)
@@ -31,7 +31,7 @@ __new_sem_init (sem, pshared, value)
      unsigned int value;
 {
   /* Parameter sanity check.  */
-  if (__builtin_expect (value > SEM_VALUE_MAX, 0))
+  if (__glibc_unlikely (value > SEM_VALUE_MAX))
     {
       __set_errno (EINVAL);
       return -1;
@@ -66,7 +66,7 @@ __old_sem_init (sem, pshared, value)
      unsigned int value;
 {
   /* Parameter sanity check.  */
-  if (__builtin_expect (value > SEM_VALUE_MAX, 0))
+  if (__glibc_unlikely (value > SEM_VALUE_MAX))
     {
       __set_errno (EINVAL);
       return -1;
index b57e6b7573c855622181532152cb553e85af22b3..cf91859dabd6da1e776a9599b31bb3c3e3164709 100644 (file)
@@ -74,10 +74,10 @@ __where_is_shmfs (void)
   /* OK, do it the hard way.  Look through the /proc/mounts file and if
      this does not exist through /etc/fstab to find the mount point.  */
   fp = __setmntent ("/proc/mounts", "r");
-  if (__builtin_expect (fp == NULL, 0))
+  if (__glibc_unlikely (fp == NULL))
     {
       fp = __setmntent (_PATH_MNTTAB, "r");
-      if (__builtin_expect (fp == NULL, 0))
+      if (__glibc_unlikely (fp == NULL))
        /* There is nothing we can do.  Blind guesses are not helpful.  */
        return;
     }
index 33cf9ade41b58ae1d86c36c3da58f83c2cf99d78..7b01bfcd9c34be092d0b61a00dfd36dda666efb4 100644 (file)
@@ -34,7 +34,7 @@ __sigaction (sig, act, oact)
      const struct sigaction *act;
      struct sigaction *oact;
 {
-  if (__builtin_expect (sig == SIGCANCEL || sig == SIGSETXID, 0))
+  if (__glibc_unlikely (sig == SIGCANCEL || sig == SIGSETXID))
     {
       __set_errno (EINVAL);
       return -1;
index d29a6ee26a624ce232fb11aba30614a02109f95a..740fb883f04152b056acfad0aad6ee0f406e0213 100644 (file)
@@ -479,7 +479,7 @@ get_clockfreq (void)
     return result;
 
   fd = open ("/proc/cpuinfo", O_RDONLY);
-  if (__builtin_expect (fd != -1, 1))
+  if (__glibc_likely (fd != -1))
     {
       /* XXX AFAIK the /proc filesystem can generate "files" only up
          to a size of 4096 bytes.  */
@@ -491,7 +491,7 @@ get_clockfreq (void)
        {
          char *mhz = memmem (buf, n, "cpu MHz", 7);
 
-         if (__builtin_expect (mhz != NULL, 1))
+         if (__glibc_likely (mhz != NULL))
            {
              char *endp = buf + n;
              int seen_decpoint = 0;
index 2a9a723ddb7d3b70d6099ba9beee4124ee713d5e..93f93eebd4ab3a21013637da42331530a824f809 100644 (file)
@@ -56,7 +56,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
   PREPARE_CREATE;
 #endif
 
-  if (__builtin_expect (stopped != 0, 0))
+  if (__glibc_unlikely (stopped != 0))
     /* We make sure the thread does not run far by forcing it to get a
        lock.  We lock it here too so that the new thread cannot continue
        until we tell it to.  */
@@ -75,7 +75,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
   int rc = ARCH_CLONE (fct, STACK_VARIABLES_ARGS, clone_flags,
                       pd, &pd->tid, TLS_VALUE, &pd->tid);
 
-  if (__builtin_expect (rc == -1, 0))
+  if (__glibc_unlikely (rc == -1))
     {
       atomic_decrement (&__nptl_nthreads); /* Oops, we lied for a second.  */
 
@@ -93,7 +93,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
     }
 
   /* Now we have the possibility to set scheduling parameters etc.  */
-  if (__builtin_expect (stopped != 0, 0))
+  if (__glibc_unlikely (stopped != 0))
     {
       INTERNAL_SYSCALL_DECL (err);
       int res = 0;
@@ -104,7 +104,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
          res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid,
                                  attr->cpusetsize, attr->cpuset);
 
-         if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0))
+         if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err)))
            {
              /* The operation failed.  We have to kill the thread.  First
                 send it the cancellation signal.  */
@@ -129,7 +129,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
          res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid,
                                  pd->schedpolicy, &pd->schedparam);
 
-         if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0))
+         if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err)))
            goto err_out;
        }
     }
@@ -183,7 +183,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
                     | CLONE_CHILD_CLEARTID | CLONE_SYSVSEM
                     | 0);
 
-  if (__builtin_expect (THREAD_GETMEM (THREAD_SELF, report_events), 0))
+  if (__glibc_unlikely (THREAD_GETMEM (THREAD_SELF, report_events)))
     {
       /* The parent thread is supposed to report events.  Check whether
         the TD_CREATE event is needed, too.  */
index 65a1ce7bf9e7db63377cdf15e1e2d0941029b5e0..76c88e0feb49b43476280756225ce1d07a81fa90 100644 (file)
@@ -48,7 +48,7 @@
   ({                                                                   \
     extern __typeof (__nptl_setxid) __nptl_setxid __attribute__((weak));\
     int __result;                                                      \
-    if (__builtin_expect (__nptl_setxid        != NULL, 0))                    \
+    if (__glibc_unlikely (__nptl_setxid        != NULL))                             \
       {                                                                        \
        struct xid_command __cmd;                                       \
        __cmd.syscall_no = __NR_##name;                                 \
index 359a770c05fd9316f38fbd5c58683451007465ef..461d28e353dda71b7b8d4f24a176b7a07585d105 100644 (file)
@@ -68,7 +68,7 @@ timer_create (clock_id, evp, timerid)
   pthread_mutex_lock (&__timer_mutex);
 
   newtimer = __timer_alloc ();
-  if (__builtin_expect (newtimer == NULL, 0))
+  if (__glibc_unlikely (newtimer == NULL))
     {
       __set_errno (EAGAIN);
       goto unlock_bail;
@@ -123,7 +123,7 @@ timer_create (clock_id, evp, timerid)
        thread = __timer_thread_alloc (&newtimer->attr, clock_id);
 
       /* Out of luck; no threads are available.  */
-      if (__builtin_expect (thread == NULL, 0))
+      if (__glibc_unlikely (thread == NULL))
        {
          __set_errno (EAGAIN);
          goto unlock_bail;
index cb94ea6c21bb5f60a9be6d506da0123fe43a9f0a..9d7bdc5b90d015388da5ad1995dc15dec6358995 100644 (file)
@@ -42,7 +42,7 @@ pthread_cancel_init (void)
   void *getcfa;
   void *handle;
 
-  if (__builtin_expect (libgcc_s_handle != NULL, 1))
+  if (__glibc_likely (libgcc_s_handle != NULL))
     {
       /* Force gcc to reload all values.  */
       asm volatile ("" ::: "memory");
@@ -93,7 +93,7 @@ __unwind_freeres (void)
 void
 _Unwind_Resume (struct _Unwind_Exception *exc)
 {
-  if (__builtin_expect (libgcc_s_handle == NULL, 0))
+  if (__glibc_unlikely (libgcc_s_handle == NULL))
     pthread_cancel_init ();
   else
     atomic_read_barrier ();
@@ -109,7 +109,7 @@ __gcc_personality_v0 (int version, _Unwind_Action actions,
                      struct _Unwind_Exception *ue_header,
                      struct _Unwind_Context *context)
 {
-  if (__builtin_expect (libgcc_s_handle == NULL, 0))
+  if (__glibc_unlikely (libgcc_s_handle == NULL))
     pthread_cancel_init ();
   else
     atomic_read_barrier ();
@@ -125,7 +125,7 @@ _Unwind_Reason_Code
 _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
                      void *stop_argument)
 {
-  if (__builtin_expect (libgcc_s_handle == NULL, 0))
+  if (__glibc_unlikely (libgcc_s_handle == NULL))
     pthread_cancel_init ();
   else
     atomic_read_barrier ();
@@ -140,7 +140,7 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
 _Unwind_Word
 _Unwind_GetCFA (struct _Unwind_Context *context)
 {
-  if (__builtin_expect (libgcc_s_handle == NULL, 0))
+  if (__glibc_unlikely (libgcc_s_handle == NULL))
     pthread_cancel_init ();
   else
     atomic_read_barrier ();
index f806f2ff87bd287eec8faaf6385b44555c613b7d..937b1d4e113b1cff4a5c698f83d662e130d596af 100644 (file)
@@ -27,10 +27,10 @@ static inline __attribute__((always_inline)) pid_t really_getpid (pid_t oldval);
 static inline __attribute__((always_inline)) pid_t
 really_getpid (pid_t oldval)
 {
-  if (__builtin_expect (oldval == 0, 1))
+  if (__glibc_likely (oldval == 0))
     {
       pid_t selftid = THREAD_GETMEM (THREAD_SELF, tid);
-      if (__builtin_expect (selftid != 0, 1))
+      if (__glibc_likely (selftid != 0))
        return selftid;
     }
 
@@ -53,7 +53,7 @@ __getpid (void)
   pid_t result = INTERNAL_SYSCALL (getpid, err, 0);
 #else
   pid_t result = THREAD_GETMEM (THREAD_SELF, pid);
-  if (__builtin_expect (result <= 0, 0))
+  if (__glibc_unlikely (result <= 0))
     result = really_getpid (result);
 #endif
   return result;
index 5c9ada18a00e9620fa526e4122e11a3a417a50a4..c894b1ecdabb82f3d5788858f630609925339a75 100644 (file)
@@ -35,7 +35,7 @@ __lll_robust_lock_wait (int *futex, int private)
 
   do
     {
-      if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
+      if (__glibc_unlikely (oldval & FUTEX_OWNER_DIED))
        return oldval;
 
       int newval = oldval | FUTEX_WAITERS;
@@ -72,7 +72,7 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime,
 
   /* Work around the fact that the kernel rejects negative timeout values
      despite them being valid.  */
-  if (__builtin_expect (abstime->tv_sec < 0, 0))
+  if (__glibc_unlikely (abstime->tv_sec < 0))
     return ETIMEDOUT;
 
   do
@@ -100,7 +100,7 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime,
 #endif
 
       /* Wait.  */
-      if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
+      if (__glibc_unlikely (oldval & FUTEX_OWNER_DIED))
        return oldval;
 
       int newval = oldval | FUTEX_WAITERS;
index 0d209196674df291b4869bbae5afe3c8666cf315..3138ad2c3c0ca15e709079d8cd832ceaf116f43f 100644 (file)
@@ -266,7 +266,7 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
 
   /* If we cannot create the netlink socket we cannot provide
      SIGEV_THREAD support.  */
-  if (__builtin_expect (netlink_socket == -1, 0))
+  if (__glibc_unlikely (netlink_socket == -1))
     {
       __set_errno (ENOSYS);
       return -1;
@@ -299,7 +299,7 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification)
   int retval = INLINE_SYSCALL (mq_notify, 2, mqdes, &se);
 
   /* If it failed, free the allocated memory.  */
-  if (__builtin_expect (retval != 0, 0))
+  if (__glibc_unlikely (retval != 0))
     free (data.attr);
 
   return retval;
index fe856708a4bc624f5ae54b27925a6961fce38497..ab92c3fc8f58beb9007cb29728f3f00554fd5bd1 100644 (file)
@@ -306,7 +306,7 @@ extern int __lll_robust_timedlock_wait
   ((void) ({                                                                 \
     int *__futex = &(lock);                                                  \
     int __val = atomic_exchange_rel (__futex, 0);                            \
-    if (__builtin_expect (__val > 1, 0))                                     \
+    if (__glibc_unlikely (__val > 1))                                        \
       lll_futex_wake (__futex, 1, private);                                  \
   }))
 
@@ -314,7 +314,7 @@ extern int __lll_robust_timedlock_wait
   ((void) ({                                                                 \
     int *__futex = &(lock);                                                  \
     int __val = atomic_exchange_rel (__futex, 0);                            \
-    if (__builtin_expect (__val & FUTEX_WAITERS, 0))                         \
+    if (__glibc_unlikely (__val & FUTEX_WAITERS))                            \
       lll_futex_wake (__futex, 1, private);                                  \
   }))
 
index 68059db8dbeb35e430d7c0182a327408422fc80a..74762b749b260abcd4f8c10beac9e3eeb48be1e0 100644 (file)
@@ -31,7 +31,7 @@ raise (sig)
      fork function temporarily invalidated the PID field.  Adjust for
      that.  */
   pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
-  if (__builtin_expect (pid < 0, 0))
+  if (__glibc_unlikely (pid < 0))
     pid = -pid;
 
   return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
index 43e5c02b37921352d873473e0f65e2bbc4e19b99..f8957ae17c0c61b8f2bff3e05efb3daae94d25eb 100644 (file)
@@ -40,7 +40,7 @@ __pthread_kill (threadid, signo)
      if a thread exits between ESRCH test and tgkill, we might return
      EINVAL, because pd->tid would be cleared by the kernel.  */
   pid_t tid = atomic_forced_read (pd->tid);
-  if (__builtin_expect (tid <= 0, 0))
+  if (__glibc_unlikely (tid <= 0))
     /* Not a valid thread handle.  */
     return ESRCH;
 
index 288d73f8c854f91d77a27c0b6fcd54a4aa8340e2..874cf4b578d2e186164aa0c6c7b332d4a8031d0d 100644 (file)
@@ -61,7 +61,7 @@ __pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
   INTERNAL_SYSCALL_DECL (err);
   int res;
 
-  if (__builtin_expect (__kernel_cpumask_size == 0, 0))
+  if (__glibc_unlikely (__kernel_cpumask_size == 0))
     {
       res = __determine_cpumask_size (pd->tid);
       if (res != 0)
index 9c3e73cdea494fa598c75d5d80e64317e3eed6c7..8dee3a69d2064cb6e818d9d7f56a7ffbf15dbba6 100644 (file)
@@ -44,7 +44,7 @@ pthread_sigqueue (threadid, signo, value)
      if a thread exits between ESRCH test and tgkill, we might return
      EINVAL, because pd->tid would be cleared by the kernel.  */
   pid_t tid = atomic_forced_read (pd->tid);
-  if (__builtin_expect (tid <= 0, 0))
+  if (__glibc_unlikely (tid <= 0))
     /* Not a valid thread handle.  */
     return ESRCH;
 
index 321d9c3543f975bb7e037637000a0e0fa356fcda..67c9b1f23e5db230bf0f419bbc954fd57d3dc4f1 100644 (file)
@@ -50,7 +50,7 @@ raise (sig)
     /* raise is an async-safe function.  It could be called while the
        fork/vfork function temporarily invalidated the PID field.  Adjust for
        that.  */
-    if (__builtin_expect (pid <= 0, 0))
+    if (__glibc_unlikely (pid <= 0))
       pid = (pid & INT_MAX) == 0 ? selftid : -pid;
 
   return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
index 80dc90543be4ed89d0f10d0795536d408e14a8bf..864dcbccc0341583513352bf31470b92f65069d9 100644 (file)
@@ -233,7 +233,7 @@ static inline void
 __attribute__ ((always_inline))
 __lll_lock (int *futex, int private)
 {
-  if (__builtin_expect (atomic_compare_and_exchange_bool_acq (futex, 1, 0), 0))
+  if (__glibc_unlikely (atomic_compare_and_exchange_bool_acq (futex, 1, 0)))
     {
       if (__builtin_constant_p (private) && private == LLL_PRIVATE)
        __lll_lock_wait_private (futex);
@@ -260,7 +260,7 @@ static inline void
 __attribute__ ((always_inline))
 __lll_cond_lock (int *futex, int private)
 {
-  if (__builtin_expect (atomic_compare_and_exchange_bool_acq (futex, 2, 0), 0))
+  if (__glibc_unlikely (atomic_compare_and_exchange_bool_acq (futex, 2, 0)))
     __lll_lock_wait (futex, private);
 }
 #define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
@@ -278,7 +278,7 @@ __attribute__ ((always_inline))
 __lll_timedlock (int *futex, const struct timespec *abstime, int private)
 {
   int result = 0;
-  if (__builtin_expect (atomic_compare_and_exchange_bool_acq (futex, 1, 0), 0))
+  if (__glibc_unlikely (atomic_compare_and_exchange_bool_acq (futex, 1, 0)))
     result = __lll_timedlock_wait (futex, abstime, private);
   return result;
 }
@@ -307,7 +307,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
        int *__futexp = (futex);                                                      \
                                                                              \
        lll_compare_and_swap (__futexp, __oldval, __newval, "slr %2,%2");      \
-       if (__builtin_expect (__oldval > 1, 0))                               \
+       if (__glibc_unlikely (__oldval > 1))                                  \
         lll_futex_wake (__futexp, 1, private);                               \
     })
 #define lll_unlock(futex, private) __lll_unlock(&(futex), private)
@@ -320,7 +320,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
        int *__futexp = (futex);                                                      \
                                                                              \
        lll_compare_and_swap (__futexp, __oldval, __newval, "slr %2,%2");      \
-       if (__builtin_expect (__oldval & FUTEX_WAITERS, 0))                   \
+       if (__glibc_unlikely (__oldval & FUTEX_WAITERS))                              \
         lll_futex_wake (__futexp, 1, private);                               \
     })
 #define lll_robust_unlock(futex, private) \
index d851d745428f528f8a70fbd2d350f1967bdef962..d4ed7a9bd7e32d4dc5f32742ea903ad8386508a7 100644 (file)
@@ -223,7 +223,7 @@ __lll_lock (int *futex, int private)
 {
   int val = atomic_compare_and_exchange_val_24_acq (futex, 1, 0);
 
-  if (__builtin_expect (val != 0, 0))
+  if (__glibc_unlikely (val != 0))
     {
       if (__builtin_constant_p (private) && private == LLL_PRIVATE)
        __lll_lock_wait_private (futex);
@@ -251,7 +251,7 @@ __lll_cond_lock (int *futex, int private)
 {
   int val = atomic_compare_and_exchange_val_24_acq (futex, 2, 0);
 
-  if (__builtin_expect (val != 0, 0))
+  if (__glibc_unlikely (val != 0))
     __lll_lock_wait (futex, private);
 }
 #define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
@@ -272,7 +272,7 @@ __lll_timedlock (int *futex, const struct timespec *abstime, int private)
   int val = atomic_compare_and_exchange_val_24_acq (futex, 1, 0);
   int result = 0;
 
-  if (__builtin_expect (val != 0, 0))
+  if (__glibc_unlikely (val != 0))
     result = __lll_timedlock_wait (futex, abstime, private);
   return result;
 }
@@ -296,7 +296,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
   ((void) ({                                                                 \
     int *__futex = &(lock);                                                  \
     int __val = atomic_exchange_24_rel (__futex, 0);                         \
-    if (__builtin_expect (__val > 1, 0))                                     \
+    if (__glibc_unlikely (__val > 1))                                        \
       lll_futex_wake (__futex, 1, private);                                  \
   }))
 
@@ -304,7 +304,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime,
   ((void) ({                                                                 \
     int *__futex = &(lock);                                                  \
     int __val = atomic_exchange_rel (__futex, 0);                            \
-    if (__builtin_expect (__val & FUTEX_WAITERS, 0))                         \
+    if (__glibc_unlikely (__val & FUTEX_WAITERS))                            \
       lll_futex_wake (__futex, 1, private);                                  \
   }))
 
index 4ce7871fbd2fb8180757132d808a7640364610ec..2221a27e22302c5bffaa500d3a26629dcb8d7550 100644 (file)
@@ -33,7 +33,7 @@ pthread_barrier_destroy (barrier)
 
   lll_lock (ibarrier->b.lock, private);
 
-  if (__builtin_expect (ibarrier->b.left == ibarrier->b.init_count, 1))
+  if (__glibc_likely (ibarrier->b.left == ibarrier->b.init_count))
     /* The barrier is not used anymore.  */
     result = 0;
   else
index 9bc7a0533392a9e8831cc681ebca0ee135664756..6af686361d26643c221e2a3aadc98c7d6a6a0521 100644 (file)
@@ -28,7 +28,7 @@ pthread_barrier_init (barrier, attr, count)
 {
   union sparc_pthread_barrier *ibarrier;
 
-  if (__builtin_expect (count == 0, 0))
+  if (__glibc_unlikely (count == 0))
     return EINVAL;
 
   struct pthread_barrierattr *iattr = (struct pthread_barrierattr *) attr;
index d415366f4cb6fee2fa43e5a9470c45d9cc6bb70f..cbefdc4823a7584e4c3b83ce521ca6f7ba9b0994 100644 (file)
@@ -32,7 +32,7 @@ __new_sem_init (sem, pshared, value)
      unsigned int value;
 {
   /* Parameter sanity check.  */
-  if (__builtin_expect (value > SEM_VALUE_MAX, 0))
+  if (__glibc_unlikely (value > SEM_VALUE_MAX))
     {
       __set_errno (EINVAL);
       return -1;
@@ -66,7 +66,7 @@ __old_sem_init (sem, pshared, value)
      unsigned int value;
 {
   /* Parameter sanity check.  */
-  if (__builtin_expect (value > SEM_VALUE_MAX, 0))
+  if (__glibc_unlikely (value > SEM_VALUE_MAX))
     {
       __set_errno (EINVAL);
       return -1;
index e46eef426cf28ca39ffd5ce245ac3ab75d3c9286..7624f2cdb2fd39ca666390d16ed809204021cd9e 100644 (file)
@@ -50,7 +50,7 @@ __timer_create_old (clockid_t clock_id, struct sigevent *evp, int *timerid)
            break;
          }
 
-      if (__builtin_expect (i == OLD_TIMER_MAX, 0))
+      if (__glibc_unlikely (i == OLD_TIMER_MAX))
        {
          /* No free slot.  */
          (void) __timer_delete_new (newp);
index fb2489cd9680d0d305e027dda1657ae06b7e9fef..a71015a2f16339ccaba1b4ad4fb19c644d05c592 100644 (file)
@@ -62,7 +62,7 @@ unwind_stop (int version, _Unwind_Action actions,
                                    adj))
     do_longjump = 1;
 
-  if (__builtin_expect (curp != NULL, 0))
+  if (__glibc_unlikely (curp != NULL))
     {
       /* Handle the compatibility stuff.  Execute all handlers
         registered with the old method which would be unwound by this
index d6b928cf2da0fbb3e2bad1d4ff0ba28c8cbdde76..98d40a1c55ffb3f074a64ecbde32c163e85b21ed 100644 (file)
@@ -77,7 +77,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
     char strdata[0];
   } *dataset = NULL;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s\" in hosts cache!"), (char *) key);
@@ -434,7 +434,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
              struct dataset *newp
                = (struct dataset *) mempool_alloc (db, total + req->key_len,
                                                    1);
-             if (__builtin_expect (newp != NULL, 1))
+             if (__glibc_likely (newp != NULL))
                {
                  /* Adjust pointer into the memory block.  */
                  key_copy = (char *) newp + (key_copy - (char *) dataset);
index 2c35a3494326e20766303067117fd952d84e6ddc..5e8a42f596296dace36b85e2eed1d2418c337fd9 100644 (file)
@@ -138,7 +138,7 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
           bool first, struct database_dyn *table,
           uid_t owner, bool prune_wakeup)
 {
-  if (__builtin_expect (debug_level >= 2, 0))
+  if (__glibc_unlikely (debug_level >= 2))
     {
       const char *str;
       char buf[INET6_ADDRSTRLEN + 1];
@@ -311,7 +311,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
   bool *mark;
   size_t memory_needed = cnt * sizeof (bool);
   bool mark_use_alloca;
-  if (__builtin_expect (memory_needed <= MAX_STACK_USE, 1))
+  if (__glibc_likely (memory_needed <= MAX_STACK_USE))
     {
       mark = alloca (cnt * sizeof (bool));
       memset (mark, '\0', memory_needed);
@@ -327,7 +327,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
   char *const data = table->data;
   bool any = false;
 
-  if (__builtin_expect (debug_level > 2, 0))
+  if (__glibc_unlikely (debug_level > 2))
     dbg_log (_("pruning %s cache; time %ld"),
             dbnames[table - dbs], (long int) now);
 
@@ -343,7 +343,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
          struct datahead *dh = (struct datahead *) (data + runp->packet);
 
          /* Some debug support.  */
-         if (__builtin_expect (debug_level > 2, 0))
+         if (__glibc_unlikely (debug_level > 2))
            {
              char buf[INET6_ADDRSTRLEN];
              const char *str;
@@ -422,7 +422,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
     }
   while (cnt > 0);
 
-  if (__builtin_expect (fd != -1, 0))
+  if (__glibc_unlikely (fd != -1))
     {
       /* Reply to the INVALIDATE initiator that the cache has been
         invalidated.  */
@@ -436,7 +436,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
 
       /* Now we have to get the write lock since we are about to modify
         the table.  */
-      if (__builtin_expect (pthread_rwlock_trywrlock (&table->lock) != 0, 0))
+      if (__glibc_unlikely (pthread_rwlock_trywrlock (&table->lock) != 0))
        {
          ++table->head->wrlockdelayed;
          pthread_rwlock_wrlock (&table->lock);
@@ -492,7 +492,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
               MS_ASYNC);
 
       /* One extra pass if we do debugging.  */
-      if (__builtin_expect (debug_level > 0, 0))
+      if (__glibc_unlikely (debug_level > 0))
        {
          struct hashentry *runp = head;
 
@@ -517,7 +517,7 @@ prune_cache (struct database_dyn *table, time_t now, int fd)
        }
     }
 
-  if (__builtin_expect (! mark_use_alloca, 0))
+  if (__glibc_unlikely (! mark_use_alloca))
     free (mark);
 
   /* Run garbage collection if any entry has been removed or replaced.  */
index f3732f5ef4e16e92fb7388037859bc1c331b5c79..f463f45b864c81497c28cb11309863386862a799 100644 (file)
@@ -999,7 +999,7 @@ register_traced_file (size_t dbidx, struct traced_file *finfo)
   if (! dbs[dbidx].enabled || ! dbs[dbidx].check_file)
     return;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     dbg_log (_("register trace file %s for database %s"),
             finfo->fname, dbnames[dbidx]);
 
@@ -1129,7 +1129,7 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
 #endif
   (void) TEMP_FAILURE_RETRY (sendmsg (fd, &msg, MSG_NOSIGNAL));
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     dbg_log (_("provide access to FD %d, for %s"), db->ro_fd, key);
 }
 #endif /* SCM_RIGHTS */
@@ -1201,7 +1201,7 @@ request from '%s' [%ld] not handled due to missing permission"),
        }
 
       /* Is this service enabled?  */
-      if (__builtin_expect (!db->enabled, 0))
+      if (__glibc_unlikely (!db->enabled))
        {
          /* No, sent the prepared record.  */
          if (TEMP_FAILURE_RETRY (send (fd, db->disabled_iov->iov_base,
@@ -1220,7 +1220,7 @@ request from '%s' [%ld] not handled due to missing permission"),
        }
 
       /* Be sure we can read the data.  */
-      if (__builtin_expect (pthread_rwlock_tryrdlock (&db->lock) != 0, 0))
+      if (__glibc_unlikely (pthread_rwlock_tryrdlock (&db->lock) != 0))
        {
          ++db->head->rdlockdelayed;
          pthread_rwlock_rdlock (&db->lock);
@@ -1236,7 +1236,7 @@ request from '%s' [%ld] not handled due to missing permission"),
          ssize_t nwritten;
 
 #ifdef HAVE_SENDFILE
-         if (__builtin_expect (db->mmap_used, 1))
+         if (__glibc_likely (db->mmap_used))
            {
              assert (db->wr_fd != -1);
              assert ((char *) cached->data > (char *) db->data);
@@ -1603,7 +1603,7 @@ nscd_run_prune (void *p)
   dbs[my_number].head->timestamp = now;
 
   struct timespec prune_ts;
-  if (__builtin_expect (clock_gettime (timeout_clock, &prune_ts) == -1, 0))
+  if (__glibc_unlikely (clock_gettime (timeout_clock, &prune_ts) == -1))
     /* Should never happen.  */
     abort ();
 
@@ -1656,7 +1656,7 @@ nscd_run_prune (void *p)
             we need to wake up occasionally to update the timestamp.
             Wait 90% of the update period.  */
 #define UPDATE_MAPPING_TIMEOUT (MAPPING_TIMEOUT * 9 / 10)
-         if (__builtin_expect (! dont_need_update, 0))
+         if (__glibc_unlikely (! dont_need_update))
            {
              next_wait = MIN (UPDATE_MAPPING_TIMEOUT, next_wait);
              dbs[my_number].head->timestamp = now;
@@ -1756,7 +1756,7 @@ nscd_run_worker (void *p)
 #ifdef SO_PEERCRED
       pid_t pid = 0;
 
-      if (__builtin_expect (debug_level > 0, 0))
+      if (__glibc_unlikely (debug_level > 0))
        {
          struct ucred caller;
          socklen_t optlen = sizeof (caller);
@@ -1849,7 +1849,7 @@ fd_ready (int fd)
     }
 
   bool do_signal = true;
-  if (__builtin_expect (nready == 0, 0))
+  if (__glibc_unlikely (nready == 0))
     {
       ++client_queued;
       do_signal = false;
@@ -2264,7 +2264,7 @@ main_loop_epoll (int efd)
                                                 sizeof (inev)));
                if (nb < (ssize_t) sizeof (struct inotify_event))
                  {
-                   if (__builtin_expect (nb == -1 && errno != EAGAIN, 0))
+                   if (__glibc_unlikely (nb == -1 && errno != EAGAIN))
                      {
                        /* Something went wrong when reading the inotify
                           data.  Better disable inotify.  */
index 8f5d39b138cba7a9f901abb3f8e47401fc4b71ff..b5a33eb3478bcb31645f071abcdc0f0e3bc25ac9 100644 (file)
@@ -452,7 +452,7 @@ addgrbyX (struct database_dyn *db, int fd, request_header *req,
   bool use_malloc = false;
   int errval = 0;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s\" in group cache!"), keystr);
@@ -465,7 +465,7 @@ addgrbyX (struct database_dyn *db, int fd, request_header *req,
     {
       errno = 0;
 
-      if (__builtin_expect (buflen > 32768, 0))
+      if (__glibc_unlikely (buflen > 32768))
        {
          char *old_buffer = buffer;
          buflen *= 2;
index abedf9a63e71144219dc53b7e9bf69460ee01fc4..a79b67aa7e4677ca2a2c5e1cfe085dbb3ab1b6e6 100644 (file)
@@ -480,7 +480,7 @@ addhstbyX (struct database_dyn *db, int fd, request_header *req,
   int errval = 0;
   int32_t ttl = INT32_MAX;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       const char *str;
       char buf[INET6_ADDRSTRLEN + 1];
@@ -502,7 +502,7 @@ addhstbyX (struct database_dyn *db, int fd, request_header *req,
     {
       errno = 0;
 
-      if (__builtin_expect (buflen > 32768, 0))
+      if (__glibc_unlikely (buflen > 32768))
        {
          char *old_buffer = buffer;
          buflen *= 2;
index a727fa9c8be7bc82d2ea76031cf9c5efa74f3715..1bf9f0d7f4ea85b9c227132a9c19c8f9a246ca82 100644 (file)
@@ -71,7 +71,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
     char strdata[0];
   } *dataset = NULL;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s\" in group cache!"), (char *) key);
@@ -112,7 +112,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
      mempool_alloc.  */
   // XXX This really should use alloca.  need to change the backends.
   gid_t *groups = (gid_t *) malloc (size * sizeof (gid_t));
-  if (__builtin_expect (groups == NULL, 0))
+  if (__glibc_unlikely (groups == NULL))
     /* No more memory.  */
     goto out;
 
index 0d09e21d5e7f917784a7e8956f95a32b4f7994ba..b4090fb6a59856a729b35b2fdfb8cc31ce213381 100644 (file)
@@ -124,11 +124,11 @@ gc (struct database_dyn *db)
   /* In prune_cache we are also using a dynamically allocated array.
      If the array in the caller is too large we have malloc'ed it.  */
   size_t stack_used = sizeof (bool) * db->head->module;
-  if (__builtin_expect (stack_used > MAX_STACK_USE, 0))
+  if (__glibc_unlikely (stack_used > MAX_STACK_USE))
     stack_used = 0;
   size_t nmark = (db->head->first_free / BLOCK_ALIGN + BITS - 1) / BITS;
   size_t memory_needed = nmark * sizeof (BITMAP_T);
-  if (__builtin_expect (stack_used + memory_needed <= MAX_STACK_USE, 1))
+  if (__glibc_likely (stack_used + memory_needed <= MAX_STACK_USE))
     {
       mark = (BITMAP_T *) alloca_account (memory_needed, stack_used);
       mark_use_malloc = false;
@@ -146,7 +146,7 @@ gc (struct database_dyn *db)
   struct hashentry **he;
   struct hashentry **he_data;
   bool he_use_malloc;
-  if (__builtin_expect (stack_used + memory_needed <= MAX_STACK_USE, 1))
+  if (__glibc_likely (stack_used + memory_needed <= MAX_STACK_USE))
     {
       he = alloca_account (memory_needed, stack_used);
       he_use_malloc = false;
@@ -421,7 +421,7 @@ gc (struct database_dyn *db)
        }
       while (runp != moves->next);
 
-      if (__builtin_expect (debug_level >= 3, 0))
+      if (__glibc_unlikely (debug_level >= 3))
        dbg_log (_("freed %zu bytes in %s cache"),
                 db->head->first_free
                 - ((char *) moves->to + moves->size - db->data),
@@ -432,7 +432,7 @@ gc (struct database_dyn *db)
       db->head->first_free = (char *) moves->to + moves->size - db->data;
 
       /* Consistency check.  */
-      if (__builtin_expect (debug_level >= 3, 0))
+      if (__glibc_unlikely (debug_level >= 3))
        {
          for (size_t idx = 0; idx < db->head->module; ++idx)
            {
@@ -527,7 +527,7 @@ mempool_alloc (struct database_dyn *db, size_t len, int data_alloc)
  retry:
   res = db->data + db->head->first_free;
 
-  if (__builtin_expect (db->head->first_free + len > db->head->data_size, 0))
+  if (__glibc_unlikely (db->head->first_free + len > db->head->data_size))
     {
       if (! tried_resize)
        {
index be01fe867031ea3d2c3581d80048a4dd553a9dcc..426d3c5e396bb0d21b4926f91233063f4b97b9eb 100644 (file)
@@ -120,7 +120,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
                 const char *key, uid_t uid, struct hashentry *he,
                 struct datahead *dh, struct dataset **resultp)
 {
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s\" in netgroup cache!"), key);
@@ -398,7 +398,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
   {
     struct dataset *newp
       = (struct dataset *) mempool_alloc (db, total + req->key_len, 1);
-    if (__builtin_expect (newp != NULL, 1))
+    if (__glibc_likely (newp != NULL))
       {
        /* Adjust pointer into the memory block.  */
        key_copy = (char *) newp + (key_copy - buffer);
@@ -494,7 +494,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
     key = (char *) rawmemchr (key, '\0') + 1;
   const char *domain = *key++ ? key : NULL;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s (%s,%s,%s)\" in netgroup cache!"),
@@ -531,7 +531,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
                                            1);
   struct indataset dataset_mem;
   bool cacheable = true;
-  if (__builtin_expect (dataset == NULL, 0))
+  if (__glibc_unlikely (dataset == NULL))
     {
       cacheable = false;
       dataset = &dataset_mem;
index b5c9f871a7e94e1645b5f3d231a39fd3c895fc37..98f77e79018a9c00c7ff5452fa4dd91bd0104612 100644 (file)
@@ -331,7 +331,7 @@ __nscd_acquire_maplock (volatile struct locked_map_ptr *mapptr)
                                                                1, 0) != 0, 0))
     {
       // XXX Best number of rounds?
-      if (__builtin_expect (++cnt > 5, 0))
+      if (__glibc_unlikely (++cnt > 5))
        return false;
 
       atomic_delay ();
@@ -369,7 +369,7 @@ __nscd_drop_map_ref (struct mapped_database *map, int *gc_cycle)
   if (map != NO_MAPPING)
     {
       int now_cycle = map->head->gc_cycle;
-      if (__builtin_expect (now_cycle != *gc_cycle, 0))
+      if (__glibc_unlikely (now_cycle != *gc_cycle))
        {
          /* We might have read inconsistent data.  */
          *gc_cycle = now_cycle;
index 155cfef2eb27ec51e73de0c15904aec6ce53312b..328c2617daf9a3c55eebfa978aed9a40badd4524 100644 (file)
@@ -42,7 +42,7 @@ extern int __nss_have_localdomain attribute_hidden;
 int
 __nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
 {
-  if (__builtin_expect (__nss_have_localdomain >= 0, 0))
+  if (__glibc_unlikely (__nss_have_localdomain >= 0))
     {
       if (__nss_have_localdomain == 0)
        __nss_have_localdomain = getenv ("LOCALDOMAIN") != NULL ? 1 : -1;
@@ -171,7 +171,7 @@ __nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
     }
   else
     {
-      if (__builtin_expect (ai_resp.found == -1, 0))
+      if (__glibc_unlikely (ai_resp.found == -1))
        {
          /* The daemon does not cache this database.  */
          __nss_not_use_nscd_hosts = 1;
index ed5dc11159679b4fb98c92497fcd94938290e97d..d9b91a470f0273709e57cdeae73d5af131046e7d 100644 (file)
@@ -143,7 +143,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
   /* No value found so far.  */
   *result = NULL;
 
-  if (__builtin_expect (gr_resp.found == -1, 0))
+  if (__glibc_unlikely (gr_resp.found == -1))
     {
       /* The daemon does not cache this database.  */
       __nss_not_use_nscd_group = 1;
@@ -164,7 +164,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
               & (__alignof__ (char *) - 1));
       total_len = (align + (1 + gr_resp.gr_mem_cnt) * sizeof (char *)
                   + gr_resp.gr_name_len + gr_resp.gr_passwd_len);
-      if (__builtin_expect (buflen < total_len, 0))
+      if (__glibc_unlikely (buflen < total_len))
        {
        no_room:
          __set_errno (ERANGE);
@@ -190,7 +190,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
       if (gr_name == NULL)
        {
          /* Handle a simple, usual case: no group members.  */
-         if (__builtin_expect (gr_resp.gr_mem_cnt == 0, 1))
+         if (__glibc_likely (gr_resp.gr_mem_cnt == 0))
            {
              size_t n = gr_resp.gr_name_len + gr_resp.gr_passwd_len;
              if (__builtin_expect (__readall (sock, resultbuf->gr_name, n)
@@ -217,7 +217,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
 
              /* Get this data.  */
              size_t n = __readvall (sock, vec, 2);
-             if (__builtin_expect (n != total_len, 0))
+             if (__glibc_unlikely (n != total_len))
                goto out_close;
            }
        }
@@ -239,7 +239,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
          p += len[cnt];
        }
 
-      if (__builtin_expect (gr_name + gr_name_len + total_len > recend, 0))
+      if (__glibc_unlikely (gr_name + gr_name_len + total_len > recend))
        {
          /* len array might contain garbage during nscd GC cycle,
             retry rather than fail in that case.  */
@@ -247,7 +247,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
            retval = -2;
          goto out_close;
        }
-      if (__builtin_expect (total_len > buflen, 0))
+      if (__glibc_unlikely (total_len > buflen))
        {
          /* len array might contain garbage during nscd GC cycle,
             retry rather than fail in that case.  */
index 3368fc448297f482b9f61dadd33c72a542d6689d..fe885ee320b0ed7011c4376bcb4f39c51cc7af23 100644 (file)
@@ -140,7 +140,7 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
               struct hostent *resultbuf, char *buffer, size_t buflen,
               struct hostent **result, int *h_errnop)
 {
-  if (__builtin_expect (__nss_have_localdomain >= 0, 0))
+  if (__glibc_unlikely (__nss_have_localdomain >= 0))
     {
       if (__nss_have_localdomain == 0)
        __nss_have_localdomain = getenv ("LOCALDOMAIN") != NULL ? 1 : -1;
@@ -232,7 +232,7 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
   /* No value found so far.  */
   *result = NULL;
 
-  if (__builtin_expect (hst_resp.found == -1, 0))
+  if (__glibc_unlikely (hst_resp.found == -1))
     {
       /* The daemon does not cache this database.  */
       __nss_not_use_nscd_hosts = 1;
@@ -377,7 +377,7 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
          goto out_close;
        }
       /* See whether this would exceed the buffer capacity.  */
-      if (__builtin_expect (cp > buffer + buflen, 0))
+      if (__glibc_unlikely (cp > buffer + buflen))
        {
          /* aliases_len array might contain garbage during nscd GC cycle,
             retry rather than fail in that case.  */
index 5454ab62adde3e1fdacdac55a6be5bf5c3d5289a..278b9db8ff55f5de0aa3b4fa10ff73490191eb01 100644 (file)
@@ -134,7 +134,7 @@ nscd_getpw_r (const char *key, size_t keylen, request_type type,
   /* No value found so far.  */
   *result = NULL;
 
-  if (__builtin_expect (pw_resp.found == -1, 0))
+  if (__glibc_unlikely (pw_resp.found == -1))
     {
       /* The daemon does not cache this database.  */
       __nss_not_use_nscd_passwd = 1;
@@ -165,9 +165,9 @@ nscd_getpw_r (const char *key, size_t keylen, request_type type,
       p += pw_resp.pw_shell_len;
 
       ssize_t total = p - buffer;
-      if (__builtin_expect (pw_name + total > recend, 0))
+      if (__glibc_unlikely (pw_name + total > recend))
        goto out_close;
-      if (__builtin_expect (buflen < total, 0))
+      if (__glibc_unlikely (buflen < total))
        {
          __set_errno (ERANGE);
          retval = ERANGE;
@@ -179,7 +179,7 @@ nscd_getpw_r (const char *key, size_t keylen, request_type type,
        {
          ssize_t nbytes = __readall (sock, buffer, total);
 
-         if (__builtin_expect (nbytes != total, 0))
+         if (__glibc_unlikely (nbytes != total))
            {
              /* The `errno' to some value != ERANGE.  */
              __set_errno (ENOENT);
index 38f159eecf2e63a2c34fb6766c398e4ad568c717..4e3f702b84690275944d5165dad2378e34f10aae 100644 (file)
@@ -189,7 +189,7 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
   /* No value found so far.  */
   *result = NULL;
 
-  if (__builtin_expect (serv_resp.found == -1, 0))
+  if (__glibc_unlikely (serv_resp.found == -1))
     {
       /* The daemon does not cache this database.  */
       __nss_not_use_nscd_services = 1;
@@ -300,7 +300,7 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
        }
 
       /* See whether this would exceed the buffer capacity.  */
-      if (__builtin_expect (cp > buf + buflen, 0))
+      if (__glibc_unlikely (cp > buf + buflen))
        {
          /* aliases_len array might contain garbage during nscd GC cycle,
             retry rather than fail in that case.  */
index e4fb2e59f8df01eac15e46625d8dbba816aed358..0d61643f10d9de6f82e286316e84bd939e67a0d7 100644 (file)
@@ -110,7 +110,7 @@ __readvall (int fd, const struct iovec *iov, int iovcnt)
   ssize_t ret = TEMP_FAILURE_RETRY (__readv (fd, iov, iovcnt));
   if (ret <= 0)
     {
-      if (__builtin_expect (ret == 0 || errno != EAGAIN, 1))
+      if (__glibc_likely (ret == 0 || errno != EAGAIN))
        /* A genuine error or no data to read.  */
        return ret;
 
@@ -226,7 +226,7 @@ open_socket (request_type type, const char *key, size_t keylen)
       ssize_t wres = TEMP_FAILURE_RETRY (__send (sock, &reqdata,
                                                 real_sizeof_reqdata,
                                                 MSG_NOSIGNAL));
-      if (__builtin_expect (wres == (ssize_t) real_sizeof_reqdata, 1))
+      if (__glibc_likely (wres == (ssize_t) real_sizeof_reqdata))
        /* We managed to send the request.  */
        return sock;
 
@@ -339,13 +339,13 @@ __nscd_get_mapping (request_type type, const char *key,
   int *ip = (void *) CMSG_DATA (cmsg);
   mapfd = *ip;
 
-  if (__builtin_expect (n != keylen && n != keylen + sizeof (mapsize), 0))
+  if (__glibc_unlikely (n != keylen && n != keylen + sizeof (mapsize)))
     goto out_close;
 
-  if (__builtin_expect (strcmp (resdata, key) != 0, 0))
+  if (__glibc_unlikely (strcmp (resdata, key) != 0))
     goto out_close;
 
-  if (__builtin_expect (n == keylen, 0))
+  if (__glibc_unlikely (n == keylen))
     {
       struct stat64 st;
       if (__builtin_expect (fstat64 (mapfd, &st) != 0, 0)
@@ -358,7 +358,7 @@ __nscd_get_mapping (request_type type, const char *key,
 
   /* The file is large enough, map it now.  */
   void *mapping = __mmap (NULL, mapsize, PROT_READ, MAP_SHARED, mapfd, 0);
-  if (__builtin_expect (mapping != MAP_FAILED, 1))
+  if (__glibc_likely (mapping != MAP_FAILED))
     {
       /* Check whether the database is correct and up-to-date.  */
       struct database_pers_head *head = mapping;
@@ -383,7 +383,7 @@ __nscd_get_mapping (request_type type, const char *key,
                                               ALIGN)
                     + head->data_size);
 
-      if (__builtin_expect (mapsize < size, 0))
+      if (__glibc_unlikely (mapsize < size))
        goto out_unmap;
 
       /* Allocate a record for the mapping.  */
@@ -433,7 +433,7 @@ __nscd_get_map_ref (request_type type, const char *name,
 
   cur = mapptr->mapped;
 
-  if (__builtin_expect (cur != NO_MAPPING, 1))
+  if (__glibc_likely (cur != NO_MAPPING))
     {
       /* If not mapped or timestamp not updated, request new map.  */
       if (cur == NULL
@@ -443,7 +443,7 @@ __nscd_get_map_ref (request_type type, const char *name,
        cur = __nscd_get_mapping (type, name,
                                  (struct mapped_database **) &mapptr->mapped);
 
-      if (__builtin_expect (cur != NO_MAPPING, 1))
+      if (__glibc_likely (cur != NO_MAPPING))
        {
          if (__builtin_expect (((*gc_cyclep = cur->head->gc_cycle) & 1) != 0,
                                0))
index 8bc3e6ce3d1f49c0e2626b32513c6fac5cf9fcf5..a11ef061fd542ce3960587fafaf056a09e072e47 100644 (file)
@@ -130,7 +130,7 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
     }
   else
     {
-      if (__builtin_expect (initgr_resp.found == -1, 0))
+      if (__glibc_unlikely (initgr_resp.found == -1))
        {
          /* The daemon does not cache this database.  */
          __nss_not_use_nscd_group = 1;
index 4acb0be412b1b0a009611d2fe97876750f02fc98..104bf21c30460bb89066fc75bdbec48f4ce87c27 100644 (file)
@@ -124,7 +124,7 @@ __nscd_setnetgrent (const char *group, struct __netgrent *datap)
     }
   else
     {
-      if (__builtin_expect (netgroup_resp.found == -1, 0))
+      if (__glibc_unlikely (netgroup_resp.found == -1))
        {
          /* The daemon does not cache this database.  */
          __nss_not_use_nscd_netgroup = 1;
@@ -248,7 +248,7 @@ __nscd_innetgr (const char *netgroup, const char *host, const char *user,
     retval = innetgroup_resp.result;
   else
     {
-      if (__builtin_expect (innetgroup_resp.found == -1, 0))
+      if (__glibc_unlikely (innetgroup_resp.found == -1))
        {
          /* The daemon does not cache this database.  */
          __nss_not_use_nscd_netgroup = 1;
index 5adb8ad8e3b290e4d165511395dc183257c4e837..fa355c3891565c4040dae63b9a997e66a0bd49eb 100644 (file)
@@ -430,7 +430,7 @@ addpwbyX (struct database_dyn *db, int fd, request_header *req,
   bool use_malloc = false;
   int errval = 0;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s\" in password cache!"), keystr);
@@ -443,7 +443,7 @@ addpwbyX (struct database_dyn *db, int fd, request_header *req,
     {
       errno = 0;
 
-      if (__builtin_expect (buflen > 32768, 0))
+      if (__glibc_unlikely (buflen > 32768))
        {
          char *old_buffer = buffer;
          buflen *= 2;
index c0c8e22f5c3409d65b1f1911de023ce094133c08..e477254251e1137c36c552a73451c28c67d07efe 100644 (file)
@@ -212,7 +212,7 @@ preserve_capabilities (void)
 
   cap_free (tmp_caps);
 
-  if (__builtin_expect (res != 0, 0))
+  if (__glibc_unlikely (res != 0))
     {
       cap_free (new_caps);
       dbg_log (_("Failed to drop capabilities"));
index 52058a6e02cb542f5f2331b370e069bb70fe9b08..12ce9b2ca4497e4c13baa2fb3769eb7cde921d6b 100644 (file)
@@ -389,7 +389,7 @@ addservbyX (struct database_dyn *db, int fd, request_header *req,
   bool use_malloc = false;
   int errval = 0;
 
-  if (__builtin_expect (debug_level > 0, 0))
+  if (__glibc_unlikely (debug_level > 0))
     {
       if (he == NULL)
        dbg_log (_("Haven't found \"%s\" in services cache!"), key);
@@ -402,7 +402,7 @@ addservbyX (struct database_dyn *db, int fd, request_header *req,
     {
       errno = 0;
 
-      if (__builtin_expect (buflen > 32768, 0))
+      if (__glibc_unlikely (buflen > 32768))
        {
          char *old_buffer = buffer;
          buflen *= 2;
index 36242f9d44aa382c995af0876eeac05c61a2b040..00b2ecf612a91ae0f9793dba60f46d57db221d6e 100644 (file)
@@ -272,7 +272,7 @@ internal_getent (struct STRUCTURE *result,
         || ! (parse_result = parse_line (p, result, data, buflen, errnop
                                          EXTRA_ARGS)));
 
-  if (__builtin_expect (parse_result == -1, 0))
+  if (__glibc_unlikely (parse_result == -1))
     {
       H_ERRNO_SET (NETDB_INTERNAL);
       return NSS_STATUS_TRYAGAIN;
index f748d3df46dd29c0a3cc832f442ef6251df3fce9..4f14a8b8396050557f34ad92e91f380eb872343b 100644 (file)
@@ -348,12 +348,12 @@ fnmatch (pattern, string, flags)
 #else
       n = strlen (pattern);
 #endif
-      if (__builtin_expect (n < 1024, 1))
+      if (__glibc_likely (n < 1024))
        {
          wpattern = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
                                                 alloca_used);
          n = mbsrtowcs (wpattern, &p, n + 1, &ps);
-         if (__builtin_expect (n == (size_t) -1, 0))
+         if (__glibc_unlikely (n == (size_t) -1))
            /* Something wrong.
               XXX Do we have to set `errno' to something which mbsrtows hasn't
               already done?  */
@@ -368,12 +368,12 @@ fnmatch (pattern, string, flags)
        {
        prepare_wpattern:
          n = mbsrtowcs (NULL, &pattern, 0, &ps);
-         if (__builtin_expect (n == (size_t) -1, 0))
+         if (__glibc_unlikely (n == (size_t) -1))
            /* Something wrong.
               XXX Do we have to set `errno' to something which mbsrtows hasn't
               already done?  */
            return -1;
-         if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
+         if (__glibc_unlikely (n >= (size_t) -1 / sizeof (wchar_t)))
            {
              __set_errno (ENOMEM);
              return -2;
@@ -393,12 +393,12 @@ fnmatch (pattern, string, flags)
       n = strlen (string);
 #endif
       p = string;
-      if (__builtin_expect (n < 1024, 1))
+      if (__glibc_likely (n < 1024))
        {
          wstring = (wchar_t *) alloca_account ((n + 1) * sizeof (wchar_t),
                                                alloca_used);
          n = mbsrtowcs (wstring, &p, n + 1, &ps);
-         if (__builtin_expect (n == (size_t) -1, 0))
+         if (__glibc_unlikely (n == (size_t) -1))
            {
              /* Something wrong.
                 XXX Do we have to set `errno' to something which
@@ -417,12 +417,12 @@ fnmatch (pattern, string, flags)
        {
        prepare_wstring:
          n = mbsrtowcs (NULL, &string, 0, &ps);
-         if (__builtin_expect (n == (size_t) -1, 0))
+         if (__glibc_unlikely (n == (size_t) -1))
            /* Something wrong.
               XXX Do we have to set `errno' to something which mbsrtows hasn't
               already done?  */
            goto free_return;
-         if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
+         if (__glibc_unlikely (n >= (size_t) -1 / sizeof (wchar_t)))
            {
              free (wpattern_malloc);
              __set_errno (ENOMEM);
index 2d481f1c7f98fa7a5d90d9fcc17b8292177a0b6d..a859acb67a8663d40143597c3f3b0de350be829a 100644 (file)
@@ -601,7 +601,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 
                  fputc_unlocked ('\n', fp);
 
-                 if (__builtin_expect (fclose (fp) != EOF, 1))
+                 if (__glibc_likely (fclose (fp) != EOF))
                    {
                      _IO_flockfile (stderr);
 
index f1431088a23ba81efe70ed514d18c86b1ba51a80..aa4bb92f826e2c5cfb834de3f6ae5cb40880813b 100644 (file)
@@ -354,7 +354,7 @@ glob (pattern, flags, errfunc, pglob)
              /* It is an illegal expression.  */
            illegal_brace:
 #ifdef _LIBC
-             if (__builtin_expect (!alloca_onealt, 0))
+             if (__glibc_unlikely (!alloca_onealt))
 #endif
                free (onealt);
              return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
@@ -404,7 +404,7 @@ glob (pattern, flags, errfunc, pglob)
              if (result && result != GLOB_NOMATCH)
                {
 #ifdef _LIBC
-                 if (__builtin_expect (!alloca_onealt, 0))
+                 if (__glibc_unlikely (!alloca_onealt))
 #endif
                    free (onealt);
                  if (!(flags & GLOB_APPEND))
@@ -425,7 +425,7 @@ glob (pattern, flags, errfunc, pglob)
            }
 
 #ifdef _LIBC
-         if (__builtin_expect (!alloca_onealt, 0))
+         if (__glibc_unlikely (!alloca_onealt))
 #endif
            free (onealt);
 
@@ -488,7 +488,7 @@ glob (pattern, flags, errfunc, pglob)
        }
       else
        {
-         if (__builtin_expect (pattern[0] == '\0', 0))
+         if (__glibc_unlikely (pattern[0] == '\0'))
            {
              dirs.gl_pathv = NULL;
              goto no_matches;
@@ -671,7 +671,7 @@ glob (pattern, flags, errfunc, pglob)
                                                2 * pwbuflen);
                          if (newp == NULL)
                            {
-                             if (__builtin_expect (malloc_pwtmpbuf, 0))
+                             if (__glibc_unlikely (malloc_pwtmpbuf))
                                free (pwtmpbuf);
                              retval = GLOB_NOSPACE;
                              goto out;
@@ -717,7 +717,7 @@ glob (pattern, flags, errfunc, pglob)
            {
              if (flags & GLOB_TILDE_CHECK)
                {
-                 if (__builtin_expect (malloc_home_dir, 0))
+                 if (__glibc_unlikely (malloc_home_dir))
                    free (home_dir);
                  retval = GLOB_NOMATCH;
                  goto out;
@@ -730,7 +730,7 @@ glob (pattern, flags, errfunc, pglob)
          /* Now construct the full directory.  */
          if (dirname[1] == '\0')
            {
-             if (__builtin_expect (malloc_dirname, 0))
+             if (__glibc_unlikely (malloc_dirname))
                free (dirname);
 
              dirname = home_dir;
@@ -750,7 +750,7 @@ glob (pattern, flags, errfunc, pglob)
                  newp = malloc (home_len + dirlen);
                  if (newp == NULL)
                    {
-                     if (__builtin_expect (malloc_home_dir, 0))
+                     if (__glibc_unlikely (malloc_home_dir))
                        free (home_dir);
                      retval = GLOB_NOSPACE;
                      goto out;
@@ -760,7 +760,7 @@ glob (pattern, flags, errfunc, pglob)
              mempcpy (mempcpy (newp, home_dir, home_len),
                       &dirname[1], dirlen);
 
-             if (__builtin_expect (malloc_dirname, 0))
+             if (__glibc_unlikely (malloc_dirname))
                free (dirname);
 
              dirname = newp;
@@ -859,7 +859,7 @@ glob (pattern, flags, errfunc, pglob)
                if (pwtmpbuf == NULL)
                  {
                  nomem_getpw:
-                   if (__builtin_expect (malloc_user_name, 0))
+                   if (__glibc_unlikely (malloc_user_name))
                      free (user_name);
                    retval = GLOB_NOSPACE;
                    goto out;
@@ -884,7 +884,7 @@ glob (pattern, flags, errfunc, pglob)
                                          2 * buflen);
                    if (newp == NULL)
                      {
-                       if (__builtin_expect (malloc_pwtmpbuf, 0))
+                       if (__glibc_unlikely (malloc_pwtmpbuf))
                          free (pwtmpbuf);
                        goto nomem_getpw;
                      }
@@ -897,7 +897,7 @@ glob (pattern, flags, errfunc, pglob)
            p = getpwnam (user_name);
 #  endif
 
-           if (__builtin_expect (malloc_user_name, 0))
+           if (__glibc_unlikely (malloc_user_name))
              free (user_name);
 
            /* If we found a home directory use this.  */
@@ -906,7 +906,7 @@ glob (pattern, flags, errfunc, pglob)
                size_t home_len = strlen (p->pw_dir);
                size_t rest_len = end_name == NULL ? 0 : strlen (end_name);
 
-               if (__builtin_expect (malloc_dirname, 0))
+               if (__glibc_unlikely (malloc_dirname))
                  free (dirname);
                malloc_dirname = 0;
 
@@ -918,7 +918,7 @@ glob (pattern, flags, errfunc, pglob)
                    dirname = malloc (home_len + rest_len + 1);
                    if (dirname == NULL)
                      {
-                       if (__builtin_expect (malloc_pwtmpbuf, 0))
+                       if (__glibc_unlikely (malloc_pwtmpbuf))
                          free (pwtmpbuf);
                        retval = GLOB_NOSPACE;
                        goto out;
@@ -931,12 +931,12 @@ glob (pattern, flags, errfunc, pglob)
                dirlen = home_len + rest_len;
                dirname_modified = 1;
 
-               if (__builtin_expect (malloc_pwtmpbuf, 0))
+               if (__glibc_unlikely (malloc_pwtmpbuf))
                  free (pwtmpbuf);
              }
            else
              {
-               if (__builtin_expect (malloc_pwtmpbuf, 0))
+               if (__glibc_unlikely (malloc_pwtmpbuf))
                  free (pwtmpbuf);
 
                if (flags & GLOB_TILDE_CHECK)
@@ -1035,7 +1035,7 @@ glob (pattern, flags, errfunc, pglob)
            *(char *) &dirname[--dirlen] = '\0';
        }
 
-      if (__builtin_expect ((flags & GLOB_ALTDIRFUNC) != 0, 0))
+      if (__glibc_unlikely ((flags & GLOB_ALTDIRFUNC) != 0))
        {
          /* Use the alternative access functions also in the recursive
             call.  */
@@ -1253,7 +1253,7 @@ glob (pattern, flags, errfunc, pglob)
     }
 
  out:
-  if (__builtin_expect (malloc_dirname, 0))
+  if (__glibc_unlikely (malloc_dirname))
     free (dirname);
 
   return retval;
@@ -1530,7 +1530,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
           of the function to copy this name into the result.  */
        flags |= GLOB_NOCHECK;
 
-      if (__builtin_expect (!alloca_fullname, 0))
+      if (__glibc_unlikely (!alloca_fullname))
        free (fullname);
     }
   else
@@ -1573,7 +1573,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
                }
              d64buf;
 
-             if (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0))
+             if (__glibc_unlikely (flags & GLOB_ALTDIRFUNC))
                {
                  struct dirent *d32 = (*pglob->gl_readdir) (stream);
                  if (d32 != NULL)
@@ -1732,7 +1732,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
   if (stream != NULL)
     {
       save = errno;
-      if (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0))
+      if (__glibc_unlikely (flags & GLOB_ALTDIRFUNC))
        (*pglob->gl_closedir) (stream);
       else
        closedir (stream);
index 366ec18aebf69d23aac617432a5c2a43d80e2248..b6b65dd993ec7e2ee5e3e88f8800c2e254cb9d5f 100644 (file)
@@ -823,7 +823,7 @@ exec_comm_child (char *comm, int *fildes, int showerr, int noexec)
     args[1] = "-nc";
 
   /* Redirect output.  */
-  if (__builtin_expect (fildes[1] != STDOUT_FILENO, 1))
+  if (__glibc_likely (fildes[1] != STDOUT_FILENO))
     {
       __dup2 (fildes[1], STDOUT_FILENO);
       __close (fildes[1]);
index f8f192e5afb54f22667066e461a91a0e8d00d3a0..541c25a348037913aab6b0e790c908bf7fd1beb2 100644 (file)
@@ -398,7 +398,7 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
  buffer += pad;
  buflen = buflen > pad ? buflen - pad : 0;
 
- if (__builtin_expect (buflen < sizeof (struct host_data), 0))
+ if (__glibc_unlikely (buflen < sizeof (struct host_data)))
    {
      *errnop = ERANGE;
      *h_errnop = NETDB_INTERNAL;
@@ -452,7 +452,7 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
       break;
     case AF_INET6:
       /* Only lookup with the byte string format if the user wants it.  */
-      if (__builtin_expect (_res.options & RES_USEBSTRING, 0))
+      if (__glibc_unlikely (_res.options & RES_USEBSTRING))
        {
          qp = stpcpy (qbuf, "\\[x");
          for (n = 0; n < IN6ADDRSZ; ++n)
@@ -613,7 +613,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
   int have_to_map = 0;
   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
   buffer += pad;
-  if (__builtin_expect (buflen < sizeof (struct host_data) + pad, 0))
+  if (__glibc_unlikely (buflen < sizeof (struct host_data) + pad))
     {
       /* The buffer is too small.  */
     too_small:
@@ -727,14 +727,14 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
          n = -1;
        }
 
-      if (__builtin_expect (n < 0 || (*name_ok) (bp) == 0, 0))
+      if (__glibc_unlikely (n < 0 || (*name_ok) (bp) == 0))
        {
          ++had_error;
          continue;
        }
       cp += n;                         /* name */
 
-      if (__builtin_expect (cp + 10 > end_of_message, 0))
+      if (__glibc_unlikely (cp + 10 > end_of_message))
        {
          ++had_error;
          continue;
@@ -748,7 +748,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
       cp += INT32SZ;                   /* TTL */
       n = __ns_get16 (cp);
       cp += INT16SZ;                   /* len */
-      if (__builtin_expect (class != C_IN, 0))
+      if (__glibc_unlikely (class != C_IN))
        {
          /* XXX - debug? syslog? */
          cp += n;
@@ -764,7 +764,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
          if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
            continue;
          n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf);
-         if (__builtin_expect (n < 0 || (*name_ok) (tbuf) == 0, 0))
+         if (__glibc_unlikely (n < 0 || (*name_ok) (tbuf) == 0))
            {
              ++had_error;
              continue;
@@ -782,7 +782,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
          linebuflen -= n;
          /* Get canonical name.  */
          n = strlen (tbuf) + 1;        /* For the \0.  */
-         if (__builtin_expect (n > linebuflen, 0))
+         if (__glibc_unlikely (n > linebuflen))
            goto too_small;
          if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN)
            {
@@ -798,7 +798,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
       if (qtype == T_PTR && type == T_CNAME)
        {
          n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf);
-         if (__builtin_expect (n < 0 || res_dnok (tbuf) == 0, 0))
+         if (__glibc_unlikely (n < 0 || res_dnok (tbuf) == 0))
            {
              ++had_error;
              continue;
@@ -806,7 +806,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
          cp += n;
          /* Get canonical name.  */
          n = strlen (tbuf) + 1;   /* For the \0.  */
-         if (__builtin_expect (n > linebuflen, 0))
+         if (__glibc_unlikely (n > linebuflen))
            goto too_small;
          if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN)
            {
@@ -833,7 +833,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
 
       if (type == T_A && qtype == T_AAAA && map)
        have_to_map = 1;
-      else if (__builtin_expect (type != qtype, 0))
+      else if (__glibc_unlikely (type != qtype))
        {
          syslog (LOG_NOTICE | LOG_AUTH,
               "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
@@ -845,7 +845,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
       switch (type)
        {
        case T_PTR:
-         if (__builtin_expect (strcasecmp (tname, bp) != 0, 0))
+         if (__glibc_unlikely (strcasecmp (tname, bp) != 0))
            {
              syslog (LOG_NOTICE | LOG_AUTH, AskedForGot, qname, bp);
              cp += n;
@@ -862,7 +862,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
              n = -1;
            }
 
-         if (__builtin_expect (n < 0 || res_hnok (bp) == 0, 0))
+         if (__glibc_unlikely (n < 0 || res_hnok (bp) == 0))
            {
              ++had_error;
              break;
@@ -892,7 +892,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
          if (have_to_map)
            {
              n = strlen (bp) + 1;      /* for the \0 */
-             if (__builtin_expect (n >= MAXHOSTNAMELEN, 0))
+             if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
                {
                  ++had_error;
                  break;
@@ -938,7 +938,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
          linebuflen -= sizeof (align) - ((u_long) bp % sizeof (align));
          bp += sizeof (align) - ((u_long) bp % sizeof (align));
 
-         if (__builtin_expect (n > linebuflen, 0))
+         if (__glibc_unlikely (n > linebuflen))
            goto too_small;
          bp = __mempcpy (*hap++ = bp, cp, n);
          cp += n;
@@ -1009,7 +1009,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
   int qdcount = ntohs (hp->qdcount);
   const u_char *cp = answer->buf + HFIXEDSZ;
   const u_char *end_of_message = answer->buf + anslen;
-  if (__builtin_expect (qdcount != 1, 0))
+  if (__glibc_unlikely (qdcount != 1))
     {
       *h_errnop = NO_RECOVERY;
       return NSS_STATUS_UNAVAIL;
@@ -1063,7 +1063,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
 
          n = -1;
        }
-      if (__builtin_expect (n < 0 || res_hnok (buffer) == 0, 0))
+      if (__glibc_unlikely (n < 0 || res_hnok (buffer) == 0))
        {
          ++had_error;
          continue;
@@ -1077,7 +1077,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
 
       cp += n;                         /* name */
 
-      if (__builtin_expect (cp + 10 > end_of_message, 0))
+      if (__glibc_unlikely (cp + 10 > end_of_message))
        {
          ++had_error;
          continue;
@@ -1107,7 +1107,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
              *ttlp = ttl;
 
          n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf);
-         if (__builtin_expect (n < 0 || res_hnok (tbuf) == 0, 0))
+         if (__glibc_unlikely (n < 0 || res_hnok (tbuf) == 0))
            {
              ++had_error;
              continue;
@@ -1124,9 +1124,9 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
                }
 
              n = strlen (tbuf) + 1;
-             if (__builtin_expect (n > buflen, 0))
+             if (__glibc_unlikely (n > buflen))
                goto too_small;
-             if (__builtin_expect (n >= MAXHOSTNAMELEN, 0))
+             if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
                {
                  ++had_error;
                  continue;
@@ -1143,7 +1143,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
       // We should not see any types other than those explicitly listed
       // below.  Some types sent by server seem missing, though.  Just
       // collect the data for now.
-      if (__builtin_expect (type != T_A && type != T_AAAA, 0))
+      if (__glibc_unlikely (type != T_A && type != T_AAAA))
 #else
       if (__builtin_expect (type == T_SIG, 0)
          || __builtin_expect (type == T_KEY, 0)
index 8e80a6010e1f25d86c2bdd48c3378ade70150db8..b8aee218e192f41229bbefd312d78fc2599bcbbb 100644 (file)
@@ -268,7 +268,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
   uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct net_data);
   buffer += pad;
 
-  if (__builtin_expect (buflen < sizeof (*net_data) + pad, 0))
+  if (__glibc_unlikely (buflen < sizeof (*net_data) + pad))
     {
       /* The buffer is too small.  */
     too_small:
index 5e1a747a4ada5910ce7a67842f2a4c7a613381e7..ea133f8d8212c76eaee9c12ef4bd980c1fff6549 100644 (file)
@@ -334,7 +334,7 @@ __res_vinit(res_state statp, int preinit) {
                                sa6->sin6_flowinfo = 0;
                                sa6->sin6_addr = a6;
 
-                               if (__builtin_expect (el == NULL, 1))
+                               if (__glibc_likely (el == NULL))
                                    sa6->sin6_scope_id = 0;
                                else {
                                    int try_numericscope = 1;
index 6170763fa376013d2a438059e4ee776c5604a939..1635e6a0351fb5e2ead565a8c9159331d901f038 100644 (file)
@@ -180,7 +180,7 @@ res_nmkquery(res_state statp,
                n = ns_name_compress((char *)data, cp, buflen,
                                     (const u_char **) dnptrs,
                                     (const u_char **) lastdnptr);
-               if (__builtin_expect (n < 0, 0))
+               if (__glibc_unlikely (n < 0))
                        return (-1);
                cp += n;
                buflen -= n;
@@ -195,7 +195,7 @@ res_nmkquery(res_state statp,
                /*
                 * Initialize answer section
                 */
-               if (__builtin_expect (buflen < 1 + RRFIXEDSZ + datalen, 0))
+               if (__glibc_unlikely (buflen < 1 + RRFIXEDSZ + datalen))
                        return (-1);
                *cp++ = '\0';   /* no domain name */
                NS_PUT16 (type, cp);
index 1325f9772ddcffc9aaa1b3a81a73fbce161e9b3c..88230f43eb7a3979ed4c596074c3ecf420c2bb1e 100644 (file)
@@ -202,7 +202,7 @@ __libc_res_nquery(res_state statp,
                        goto again;
                }
        }
-       if (__builtin_expect (n <= 0, 0)) {
+       if (__glibc_unlikely (n <= 0))       {
                /* If the query choked with EDNS0, retry without EDNS0.  */
                if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0
                    && ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
index 7f2e85f3240eb73845c56dab61ccb10ecd17de8f..f46630d30f7ca9a8e952a95539c1226b0ab4aa6e 100644 (file)
@@ -358,7 +358,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
        }
 
 #ifdef USE_HOOKS
-       if (__builtin_expect (statp->qhook || statp->rhook, 0)) {
+       if (__glibc_unlikely (statp->qhook || statp->rhook))       {
                if (anssiz < MAXPACKET && ansp) {
                        u_char *buf = malloc (MAXPACKET);
                        if (buf == NULL)
@@ -499,7 +499,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
                        goto next_ns;
            same_ns:
 #ifdef USE_HOOKS
-               if (__builtin_expect (statp->qhook != NULL, 0)) {
+               if (__glibc_unlikely (statp->qhook != NULL))       {
                        int done = 0, loops = 0;
 
                        do {
@@ -541,7 +541,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
                                           : &((struct sockaddr_in *) nsap)->sin_addr),
                                          tmpbuf, sizeof (tmpbuf))));
 
-               if (__builtin_expect (v_circuit, 0)) {
+               if (__glibc_unlikely (v_circuit))       {
                        /* Use VC; at most one attempt per server. */
                        try = statp->retry;
                        n = send_vc(statp, buf, buflen, buf2, buflen2,
@@ -595,7 +595,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
                        __res_iclose(statp, false);
                }
 #ifdef USE_HOOKS
-               if (__builtin_expect (statp->rhook, 0)) {
+               if (__glibc_unlikely (statp->rhook))       {
                        int done = 0, loops = 0;
 
                        do {
@@ -814,7 +814,7 @@ send_vc(res_state statp,
        if (rlen > *thisanssizp) {
                /* Yes, we test ANSCP here.  If we have two buffers
                   both will be allocatable.  */
-               if (__builtin_expect (anscp != NULL, 1)) {
+               if (__glibc_likely (anscp != NULL))       {
                        u_char *newp = malloc (MAXPACKET);
                        if (newp == NULL) {
                                *terrno = ENOMEM;
@@ -835,7 +835,7 @@ send_vc(res_state statp,
        } else
                len = rlen;
 
-       if (__builtin_expect (len < HFIXEDSZ, 0)) {
+       if (__glibc_unlikely (len < HFIXEDSZ))       {
                /*
                 * Undersized message.
                 */
@@ -851,13 +851,13 @@ send_vc(res_state statp,
                cp += n;
                len -= n;
        }
-       if (__builtin_expect (n <= 0, 0)) {
+       if (__glibc_unlikely (n <= 0))       {
                *terrno = errno;
                Perror(statp, stderr, "read(vc)", errno);
                __res_iclose(statp, false);
                return (0);
        }
-       if (__builtin_expect (truncating, 0)) {
+       if (__glibc_unlikely (truncating))       {
                /*
                 * Flush rest of answer so connection stays in synch.
                 */
@@ -917,7 +917,7 @@ reopen (res_state statp, int *terrno, int ns)
 
                /* only try IPv6 if IPv6 NS and if not failed before */
                if (nsap->sa_family == AF_INET6 && !statp->ipv6_unavail) {
-                       if (__builtin_expect (__have_o_nonblock >= 0, 1)) {
+                       if (__glibc_likely (__have_o_nonblock >= 0))       {
                                EXT(statp).nssocks[ns] =
                                  socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK,
                                         0);
@@ -928,14 +928,14 @@ reopen (res_state statp, int *terrno, int ns)
                                             && errno == EINVAL ? -1 : 1);
 #endif
                        }
-                       if (__builtin_expect (__have_o_nonblock < 0, 0))
+                       if (__glibc_unlikely (__have_o_nonblock < 0))
                                EXT(statp).nssocks[ns] =
                                  socket(PF_INET6, SOCK_DGRAM, 0);
                        if (EXT(statp).nssocks[ns] < 0)
                            statp->ipv6_unavail = errno == EAFNOSUPPORT;
                        slen = sizeof (struct sockaddr_in6);
                } else if (nsap->sa_family == AF_INET) {
-                       if (__builtin_expect (__have_o_nonblock >= 0, 1)) {
+                       if (__glibc_likely (__have_o_nonblock >= 0))       {
                                EXT(statp).nssocks[ns]
                                  = socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK,
                                           0);
@@ -946,7 +946,7 @@ reopen (res_state statp, int *terrno, int ns)
                                             && errno == EINVAL ? -1 : 1);
 #endif
                        }
-                       if (__builtin_expect (__have_o_nonblock < 0, 0))
+                       if (__glibc_unlikely (__have_o_nonblock < 0))
                                EXT(statp).nssocks[ns]
                                  = socket(PF_INET, SOCK_DGRAM, 0);
                        slen = sizeof (struct sockaddr_in);
@@ -973,7 +973,7 @@ reopen (res_state statp, int *terrno, int ns)
                        __res_iclose(statp, false);
                        return (0);
                }
-               if (__builtin_expect (__have_o_nonblock < 0, 0)) {
+               if (__glibc_unlikely (__have_o_nonblock < 0))       {
                        /* Make socket non-blocking.  */
                        int fl = __fcntl (EXT(statp).nssocks[ns], F_GETFL);
                        if  (fl != -1)
@@ -1055,7 +1055,7 @@ send_dg(res_state statp,
        n = 0;
        if (nwritten == 0)
          n = __poll (pfd, 1, 0);
-       if (__builtin_expect (n == 0, 0)) {
+       if (__glibc_unlikely (n == 0))       {
                n = __poll (pfd, 1, ptimeout);
                need_recompute = 1;
        }
@@ -1130,7 +1130,7 @@ send_dg(res_state statp,
                    reqs[1].msg_hdr.msg_controllen = 0;
 
                    int ndg = __sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
-                   if (__builtin_expect (ndg == 2, 1))
+                   if (__glibc_likely (ndg == 2))
                      {
                        if (reqs[0].msg_len != buflen
                            || reqs[1].msg_len != buflen2)
@@ -1146,7 +1146,7 @@ send_dg(res_state statp,
                    else
                      {
 #ifndef __ASSUME_SENDMMSG
-                       if (__builtin_expect (have_sendmmsg == 0, 0))
+                       if (__glibc_unlikely (have_sendmmsg == 0))
                          {
                            if (ndg < 0 && errno == ENOSYS)
                              {
@@ -1246,7 +1246,7 @@ send_dg(res_state statp,
                *thisresplenp = recvfrom(pfd[0].fd, (char*)*thisansp,
                                         *thisanssizp, 0,
                                        (struct sockaddr *)&from, &fromlen);
-               if (__builtin_expect (*thisresplenp <= 0, 0)) {
+               if (__glibc_unlikely (*thisresplenp <= 0))       {
                        if (errno == EINTR || errno == EAGAIN) {
                                need_recompute = 1;
                                goto wait;
@@ -1255,7 +1255,7 @@ send_dg(res_state statp,
                        goto err_out;
                }
                *gotsomewhere = 1;
-               if (__builtin_expect (*thisresplenp < HFIXEDSZ, 0)) {
+               if (__glibc_unlikely (*thisresplenp < HFIXEDSZ))       {
                        /*
                         * Undersized message.
                         */
index 061c4d47f848f0f31c2cf661a095e3dd879bcbd0..299c3e083ffc1656d8293ea0d0b50544b47ee606 100644 (file)
@@ -42,7 +42,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
   wint_t wthousands = __towctrans (L',', map);
 
 #ifndef COMPILE_WPRINTF
-  if (__builtin_expect (map != NULL, 0))
+  if (__glibc_unlikely (map != NULL))
     {
       mbstate_t state;
       memset (&state, '\0', sizeof (state));
index acd97d2f7df87be13b69540787e45896cce71db2..4b470156a6537b21b8d4709220d1a182735ce19a 100644 (file)
@@ -60,7 +60,7 @@ perror (const char *s)
       || (fd = __dup (fd)) == -1
       || (fp = fdopen (fd, "w+")) == NULL)
     {
-      if (__builtin_expect (fd != -1, 0))
+      if (__glibc_unlikely (fd != -1))
        __close (fd);
 
       /* Use standard error as is.  */
index 7a3292cf9712bbd7c26a7c0ea11d93bc5f0f3c43..9cd4b4b00ccece5f45f3b99ed7d2a897cccf74fc 100644 (file)
@@ -1094,7 +1094,7 @@ ___printf_fp (FILE *fp,
     /* Write the exponent if it is needed.  */
     if (type != 'f')
       {
-       if (__builtin_expect (expsign != 0 && exponent == 4 && spec == 'g', 0))
+       if (__glibc_unlikely (expsign != 0 && exponent == 4 && spec == 'g'))
          {
            /* This is another special case.  The exponent of the number is
               really smaller than -4, which requires the 'e'/'E' format.
@@ -1180,7 +1180,7 @@ ___printf_fp (FILE *fp,
 
          size_t nbuffer = (2 + chars_needed * factor + decimal_len
                            + ngroups * thousands_sep_len);
-         if (__builtin_expect (buffer_malloced, 0))
+         if (__glibc_unlikely (buffer_malloced))
            {
              buffer = (char *) malloc (nbuffer);
              if (buffer == NULL)
@@ -1208,7 +1208,7 @@ ___printf_fp (FILE *fp,
        }
 
       tmpptr = buffer;
-      if (__builtin_expect (info->i18n, 0))
+      if (__glibc_unlikely (info->i18n))
        {
 #ifdef COMPILE_WPRINTF
          wstartp = _i18n_number_rewrite (wstartp, wcp,
@@ -1228,7 +1228,7 @@ ___printf_fp (FILE *fp,
       PRINT (tmpptr, wstartp, wide ? wcp - wstartp : cp - tmpptr);
 
       /* Free the memory if necessary.  */
-      if (__builtin_expect (buffer_malloced, 0))
+      if (__glibc_unlikely (buffer_malloced))
        {
          free (buffer);
          free (wbuffer);
index 3d0386269e086cb47b5e44901b5e95c1dad3e803..d8cd50907fb29d46c7a6e758300cbcdae416813d 100644 (file)
@@ -38,7 +38,7 @@ tmpnam (char *s)
                        0))
     return NULL;
 
-  if (__builtin_expect (__gen_tempname (tmpbuf, 0, 0, __GT_NOCREATE), 0))
+  if (__glibc_unlikely (__gen_tempname (tmpbuf, 0, 0, __GT_NOCREATE)))
     return NULL;
 
   if (s == NULL)
index 2e1e91af78b509f903bce8f4bc95df48425aebfe..e0d224530cc67498c3fa5b37838d5bdcdf08eb28 100644 (file)
@@ -269,7 +269,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 #define ADDW(Ch)                                                           \
   do                                                                       \
     {                                                                      \
-      if (__builtin_expect (wpsize == wpmax, 0))                           \
+      if (__glibc_unlikely (wpsize == wpmax))                                \
        {                                                                   \
          CHAR_T *old = wp;                                                 \
          size_t newsize = (UCHAR_MAX + 1 > 2 * wpmax                       \
@@ -392,7 +392,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              do
                {
                  c = inchar ();
-                 if (__builtin_expect (c == EOF, 0))
+                 if (__glibc_unlikely (c == EOF))
                    input_error ();
                  else if (c != (unsigned char) *f++)
                    {
@@ -420,7 +420,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
          c = inchar ();
 
          /* Characters other than format specs must just match.  */
-         if (__builtin_expect (c == EOF, 0))
+         if (__glibc_unlikely (c == EOF))
            input_error ();
 
          /* We saw white space char as the last character in the format
@@ -428,12 +428,12 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
          if (skip_space)
            {
              while (ISSPACE (c))
-               if (__builtin_expect (inchar () == EOF, 0))
+               if (__glibc_unlikely (inchar () == EOF))
                  input_error ();
              skip_space = 0;
            }
 
-         if (__builtin_expect (c != fc, 0))
+         if (__glibc_unlikely (c != fc))
            {
              ungetc (c, s);
              conv_error ();
@@ -581,7 +581,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
        }
 
       /* End of the format string?  */
-      if (__builtin_expect (*f == L_('\0'), 0))
+      if (__glibc_unlikely (*f == L_('\0')))
        conv_error ();
 
       /* Find the conversion specifier.  */
@@ -610,9 +610,9 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
        {
        case L_('%'):   /* Must match a literal '%'.  */
          c = inchar ();
-         if (__builtin_expect (c == EOF, 0))
+         if (__glibc_unlikely (c == EOF))
            input_error ();
-         if (__builtin_expect (c != fc, 0))
+         if (__glibc_unlikely (c != fc))
            {
              ungetc_not_eof (c, s);
              conv_error ();
@@ -710,7 +710,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 #endif
 
              c = inchar ();
-             if (__builtin_expect (c == EOF, 0))
+             if (__glibc_unlikely (c == EOF))
                input_error ();
 
 #ifdef COMPILE_WSCANF
@@ -758,7 +758,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                    }
 
                  n = __wcrtomb (!(flags & SUPPRESS) ? str : NULL, c, &state);
-                 if (__builtin_expect (n == (size_t) -1, 0))
+                 if (__glibc_unlikely (n == (size_t) -1))
                    /* No valid wide character.  */
                    input_error ();
 
@@ -836,7 +836,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
          STRING_ARG (wstr, wchar_t, (width > 1024 ? 1024 : width));
 
          c = inchar ();
-         if (__builtin_expect (c == EOF, 0))
+         if (__glibc_unlikely (c == EOF))
            input_error ();
 
 #ifdef COMPILE_WSCANF
@@ -946,14 +946,14 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                      {
                        /* Possibly correct character, just not enough
                           input.  */
-                       if (__builtin_expect (inchar () == EOF, 0))
+                       if (__glibc_unlikely (inchar () == EOF))
                          encode_error ();
 
                        buf[0] = c;
                        continue;
                      }
 
-                   if (__builtin_expect (n != 1, 0))
+                   if (__glibc_unlikely (n != 1))
                      encode_error ();
 
                    /* We have a match.  */
@@ -991,7 +991,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              STRING_ARG (str, char, 100);
 
              c = inchar ();
-             if (__builtin_expect (c == EOF, 0))
+             if (__glibc_unlikely (c == EOF))
                input_error ();
 
 #ifdef COMPILE_WSCANF
@@ -1060,7 +1060,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 
                    n = __wcrtomb (!(flags & SUPPRESS) ? str : NULL, c,
                                   &state);
-                   if (__builtin_expect (n == (size_t) -1, 0))
+                   if (__glibc_unlikely (n == (size_t) -1))
                      encode_error ();
 
                    assert (n <= MB_CUR_MAX);
@@ -1262,14 +1262,14 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                        {
                          /* Possibly correct character, just not enough
                             input.  */
-                         if (__builtin_expect (inchar () == EOF, 0))
+                         if (__glibc_unlikely (inchar () == EOF))
                            encode_error ();
 
                          buf[0] = c;
                          continue;
                        }
 
-                     if (__builtin_expect (n != 1, 0))
+                     if (__glibc_unlikely (n != 1))
                        encode_error ();
 
                      /* We have a match.  */
@@ -1368,7 +1368,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 
        number:
          c = inchar ();
-         if (__builtin_expect (c == EOF, 0))
+         if (__glibc_unlikely (c == EOF))
            input_error ();
 
          /* Check for a sign.  */
@@ -1434,7 +1434,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 #endif
 
              /* Get the alternative digit forms if there are any.  */
-             if (__builtin_expect (map != NULL, 0))
+             if (__glibc_unlikely (map != NULL))
                {
                  /*  Adding new level for extra digits set in locale file.  */
                  ++to_level;
@@ -1502,7 +1502,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                    {
                      /* Get the string for the digits with value N.  */
 #ifdef COMPILE_WSCANF
-                     if (__builtin_expect (map != NULL, 0))
+                     if (__glibc_unlikely (map != NULL))
                        wcdigits[n] = wcdigits_extended[n];
                      else
                        wcdigits[n] = (const wchar_t *)
@@ -1521,7 +1521,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                      const char *cmpp;
                      int avail = width > 0 ? width : INT_MAX;
 
-                     if (__builtin_expect (map != NULL, 0))
+                     if (__glibc_unlikely (map != NULL))
                        mbdigits[n] = mbdigits_extended[n];
                      else
                        mbdigits[n]
@@ -1795,7 +1795,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              else
                num.ul = __strtoul_internal (wp, &tw, base, flags & GROUP);
            }
-         if (__builtin_expect (wp == tw, 0))
+         if (__glibc_unlikely (wp == tw))
            conv_error ();
 
          if (!(flags & SUPPRESS))
@@ -1842,7 +1842,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
          c = inchar ();
          if (width > 0)
            --width;
-         if (__builtin_expect (c == EOF, 0))
+         if (__glibc_unlikely (c == EOF))
            input_error ();
 
          got_digit = got_dot = got_e = 0;
@@ -1851,7 +1851,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
          if (c == L_('-') || c == L_('+'))
            {
              negative = c == L_('-');
-             if (__builtin_expect (width == 0 || inchar () == EOF, 0))
+             if (__glibc_unlikely (width == 0 || inchar () == EOF))
                /* EOF is only an input error before we read any chars.  */
                conv_error ();
              if (width > 0)
@@ -2334,7 +2334,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                *ARG (float *) = negative ? -d : d;
            }
 
-         if (__builtin_expect (tw == wp, 0))
+         if (__glibc_unlikely (tw == wp))
            conv_error ();
 
          if (!(flags & SUPPRESS))
@@ -2374,7 +2374,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
 
          while ((fc = *f++) != L'\0' && fc != L']');
 
-         if (__builtin_expect (fc == L'\0', 0))
+         if (__glibc_unlikely (fc == L'\0'))
            conv_error ();
          wchar_t *twend = (wchar_t *) f - 1;
 #else
@@ -2410,7 +2410,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              /* Add the character to the flag map.  */
              wp[fc] = 1;
 
-         if (__builtin_expect (fc == '\0', 0))
+         if (__glibc_unlikely (fc == '\0'))
            conv_error();
 #endif
 
@@ -2418,7 +2418,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
            {
              size_t now = read_in;
 #ifdef COMPILE_WSCANF
-             if (__builtin_expect (inchar () == WEOF, 0))
+             if (__glibc_unlikely (inchar () == WEOF))
                input_error ();
 
              do
@@ -2530,7 +2530,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              size_t cnt = 0;
              mbstate_t cstate;
 
-             if (__builtin_expect (inchar () == EOF, 0))
+             if (__glibc_unlikely (inchar () == EOF))
                input_error ();
 
              memset (&cstate, '\0', sizeof (cstate));
@@ -2613,13 +2613,13 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                }
              while (inchar () != EOF);
 
-             if (__builtin_expect (cnt != 0, 0))
+             if (__glibc_unlikely (cnt != 0))
                /* We stopped in the middle of recognizing another
                   character.  That's a problem.  */
                encode_error ();
 #endif
 
-             if (__builtin_expect (now == read_in, 0))
+             if (__glibc_unlikely (now == read_in))
                /* We haven't succesfully read any character.  */
                conv_error ();
 
@@ -2645,7 +2645,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
            {
              size_t now = read_in;
 
-             if (__builtin_expect (inchar () == EOF, 0))
+             if (__glibc_unlikely (inchar () == EOF))
                input_error ();
 
 #ifdef COMPILE_WSCANF
@@ -2754,7 +2754,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
                    }
 
                  n = __wcrtomb (!(flags & SUPPRESS) ? str : NULL, c, &state);
-                 if (__builtin_expect (n == (size_t) -1, 0))
+                 if (__glibc_unlikely (n == (size_t) -1))
                    encode_error ();
 
                  assert (n <= MB_CUR_MAX);
@@ -2817,7 +2817,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
              while (--width > 0 && inchar () != EOF);
 #endif
 
-             if (__builtin_expect (now == read_in, 0))
+             if (__glibc_unlikely (now == read_in))
                /* We haven't succesfully read any character.  */
                conv_error ();
 
@@ -2911,9 +2911,9 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
   if (errp != NULL)
     *errp |= errval;
 
-  if (__builtin_expect (done == EOF, 0))
+  if (__glibc_unlikely (done == EOF))
     {
-      if (__builtin_expect (ptrs_to_free != NULL, 0))
+      if (__glibc_unlikely (ptrs_to_free != NULL))
        {
          struct ptrs_to_free *p = ptrs_to_free;
          while (p != NULL)
@@ -2928,7 +2928,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
            }
        }
     }
-  else if (__builtin_expect (strptr != NULL, 0))
+  else if (__glibc_unlikely (strptr != NULL))
     {
       free (*strptr);
       *strptr = NULL;
index 299a9c0fc8c96a49d3a3898ac9b2318b73896046..04f8e9a5d9f61ca8745a3a2da2c84fbc0cc0578e 100644 (file)
@@ -57,7 +57,7 @@ __cxa_finalize (void *d)
 
              /* It is possible that that last exit function registered
                 more exit functions.  Start the loop over.  */
-             if (__builtin_expect (check != __new_exitfn_called, 0))
+             if (__glibc_unlikely (check != __new_exitfn_called))
                goto restart;
            }
        }
index d2f88d3ed83b13929c9ef03659be9a16c349a535..1a6d9864f6e38a74b98deced4a57a4099fef62c3 100644 (file)
@@ -52,7 +52,7 @@ __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
   /* See if we already encountered the DSO.  */
   __rtld_lock_lock_recursive (GL(dl_load_lock));
 
-  if (__builtin_expect (dso_symbol_cache != dso_symbol, 0))
+  if (__glibc_unlikely (dso_symbol_cache != dso_symbol))
     {
       ElfW(Addr) caller = (ElfW(Addr)) dso_symbol;
 
index 10d2969df02772940c8e115642600ed7e096b3ba..82e58873a4da89a598207c68a9ac1f668ff92a85 100644 (file)
@@ -35,7 +35,7 @@ __drand48_iterate (xsubi, buffer)
   uint64_t result;
 
   /* Initialize buffer, if not yet done.  */
-  if (__builtin_expect (!buffer->__init, 0))
+  if (__glibc_unlikely (!buffer->__init))
     {
       buffer->__a = 0x5deece66dull;
       buffer->__c = 0xb;
index 9bc16872b4016a898e6fa9e4d32a8a9a30084778..e6ad267afe00927f87c584b6854f79ad95d3b24c 100644 (file)
@@ -77,7 +77,7 @@ putenv (string)
 #endif
       int result = __add_to_environ (name, NULL, string, 1);
 
-      if (__builtin_expect (use_malloc, 0))
+      if (__glibc_unlikely (use_malloc))
        free (name);
 
       return result;
index 6b5f9be8d5afd65da5216a26f69deef283c83742..e244e1833133813767dae659871e0983c7f40865 100644 (file)
@@ -191,17 +191,17 @@ __add_to_environ (name, value, combined, replace)
 # endif
 
          np = KNOWN_VALUE (new_value);
-         if (__builtin_expect (np == NULL, 1))
+         if (__glibc_likely (np == NULL))
 #endif
            {
 #ifdef USE_TSEARCH
-             if (__builtin_expect (! use_alloca, 0))
+             if (__glibc_unlikely (! use_alloca))
                np = new_value;
              else
 #endif
                {
                  np = malloc (varlen);
-                 if (__builtin_expect (np == NULL, 0))
+                 if (__glibc_unlikely (np == NULL))
                    {
                      UNLOCK;
                      return -1;
index c80306deef5adb9936b8143fa3c20afc75ac2be6..6707e482a443008af8294cc23d797333aad4894e 100644 (file)
@@ -545,7 +545,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 
   struct __locale_data *current = loc->__locales[LC_NUMERIC];
 
-  if (__builtin_expect (group, 0))
+  if (__glibc_unlikely (group))
     {
       grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
       if (*grouping <= 0 || *grouping == CHAR_MAX)
@@ -709,7 +709,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
   while (c == L'0' || ((wint_t) thousands != L'\0' && c == (wint_t) thousands))
     c = *++cp;
 #else
-  if (__builtin_expect (thousands == NULL, 1))
+  if (__glibc_likely (thousands == NULL))
     while (c == '0')
       c = *++cp;
   else
@@ -789,7 +789,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
            /* Not a digit or separator: end of the integer part.  */
            break;
 #else
-         if (__builtin_expect (thousands == NULL, 1))
+         if (__glibc_likely (thousands == NULL))
            break;
          else
            {
@@ -1181,10 +1181,10 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
     exponent -= incr;
   }
 
-  if (__builtin_expect (exponent > MAX_10_EXP + 1 - (intmax_t) int_no, 0))
+  if (__glibc_unlikely (exponent > MAX_10_EXP + 1 - (intmax_t) int_no))
     return overflow_value (negative);
 
-  if (__builtin_expect (exponent < MIN_10_EXP - (DIG + 1), 0))
+  if (__glibc_unlikely (exponent < MIN_10_EXP - (DIG + 1)))
     return underflow_value (negative);
 
   if (int_no > 0)
@@ -1245,7 +1245,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 
       /* Now we know the exponent of the number in base two.
         Check it against the maximum possible exponent.  */
-      if (__builtin_expect (bits > MAX_EXP, 0))
+      if (__glibc_unlikely (bits > MAX_EXP))
        return overflow_value (negative);
 
       /* We have already the first BITS bits of the result.  Together with
index 95c2df398ab22f6b6d03a72f785c6f848aea3019..c77b43dc0ce75794233d6b10266f1a94a72a77e3 100644 (file)
@@ -255,7 +255,7 @@ INTERNAL (__strtol_l) (nptr, endptr, base, group, loc)
      in the format described in <locale.h>.  */
   const char *grouping;
 
-  if (__builtin_expect (group, 0))
+  if (__glibc_unlikely (group))
     {
       grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
       if (*grouping <= 0 || *grouping == CHAR_MAX)
@@ -297,7 +297,7 @@ INTERNAL (__strtol_l) (nptr, endptr, base, group, loc)
   /* Skip white space.  */
   while (ISSPACE (*s))
     ++s;
-  if (__builtin_expect (*s == L_('\0'), 0))
+  if (__glibc_unlikely (*s == L_('\0')))
     goto noconv;
 
   /* Check for a sign.  */
@@ -331,7 +331,7 @@ INTERNAL (__strtol_l) (nptr, endptr, base, group, loc)
   if (base != 10)
     grouping = NULL;
 
-  if (__builtin_expect (grouping != NULL, 0))
+  if (__glibc_unlikely (grouping != NULL))
     {
 # ifndef USE_WIDE_CHAR
       thousands_len = strlen (thousands);
@@ -499,7 +499,7 @@ INTERNAL (__strtol_l) (nptr, endptr, base, group, loc)
     overflow = 1;
 #endif
 
-  if (__builtin_expect (overflow, 0))
+  if (__glibc_unlikely (overflow))
     {
       __set_errno (ERANGE);
 #if UNSIGNED
index 93e5e18c6652f1b9afef19d4d6640f8482a9c08c..b2842fe57f949f94614b7858316938050f80752d 100644 (file)
@@ -53,7 +53,7 @@ memmem (const void *haystack_start, size_t haystack_len,
 
   /* Sanity check, otherwise the loop might search through the whole
      memory.  */
-  if (__builtin_expect (haystack_len < needle_len, 0))
+  if (__glibc_unlikely (haystack_len < needle_len))
     return NULL;
 
   /* Use optimizations in memchr when possible, to reduce the search
index 5eed633e2b3c6dcc2d99d195909049fe2b201164..3d732a2d2800baeecd9402d9631bb3de5d692e0d 100644 (file)
@@ -32,7 +32,7 @@ strerror (errnum)
   char *ret = __strerror_r (errnum, NULL, 0);
   int saved_errno;
 
-  if (__builtin_expect (ret != NULL, 1))
+  if (__glibc_likely (ret != NULL))
     return ret;
   saved_errno = errno;
   if (buf == NULL)
index 8d53afbaf070213f9c5dbfdb6af8eacebf75de05..b3ab7ae44a33089459d70074a528cb9d206289e0 100644 (file)
@@ -40,7 +40,7 @@ __strnlen (const char *str, size_t maxlen)
   if (maxlen == 0)
     return 0;
 
-  if (__builtin_expect (end_ptr < str, 0))
+  if (__glibc_unlikely (end_ptr < str))
     end_ptr = (const char *) ~0UL;
 
   /* Handle the first few characters by reading one character at a time.
index 1b4e4b7ea029397e437bbfc71c83244dbd450752..caaa191d28a4afd38ac1031246c8ee7821b6b64e 100644 (file)
@@ -44,7 +44,7 @@ simple_memmem (const void *haystack, size_t haystack_len, const void *needle,
 
   /* Sanity check, otherwise the loop might search through the whole
      memory.  */
-  if (__builtin_expect (haystack_len < needle_len, 0))
+  if (__glibc_unlikely (haystack_len < needle_len))
     return NULL;
 
   for (begin = (const char *) haystack; begin <= last_possible; ++begin)
index 1b6a20b8266f67d84edee588734f575551725af7..6ffa5f259009f44914767b1677085450d4b9d7cc 100644 (file)
@@ -196,7 +196,7 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
 # endif
        }
 #endif
-      if (__builtin_expect (*sockp < 0, 0))
+      if (__glibc_unlikely (*sockp < 0))
        {
          struct rpc_createerr *ce = &get_rpc_createerr ();
          ce->cf_stat = RPC_SYSTEMERROR;
index f10f87250d2784d72e8964e2319912fa18366bea..d9df0cc35b9cc5f9cb8e0ded5889e41cee59cbca 100644 (file)
@@ -59,7 +59,7 @@ __get_socket (struct sockaddr_in *saddr)
   laddr.sin_addr.s_addr = htonl (INADDR_ANY);
 
   int cc = __bind (so, (struct sockaddr *) &laddr, namelen);
-  if (__builtin_expect (cc < 0, 0))
+  if (__glibc_unlikely (cc < 0))
     {
     fail:
       __close (so);
@@ -67,7 +67,7 @@ __get_socket (struct sockaddr_in *saddr)
     }
 
   cc = __connect (so, (struct sockaddr *) saddr, namelen);
-  if (__builtin_expect (cc < 0, 0))
+  if (__glibc_unlikely (cc < 0))
     goto fail;
 
   return so;
index 8963bf6deb9bdf2c65a565355bb97b68dcf4b8c8..c7d6870731058da41c32fcaaa0f74f739fba8dd5 100644 (file)
@@ -46,7 +46,7 @@ init (void)
 void
 _Unwind_Resume (struct _Unwind_Exception *exc)
 {
-  if (__builtin_expect (libgcc_s_resume == NULL, 0))
+  if (__glibc_unlikely (libgcc_s_resume == NULL))
     init ();
   libgcc_s_resume (exc);
 }
@@ -57,7 +57,7 @@ __gcc_personality_v0 (int version, _Unwind_Action actions,
                       struct _Unwind_Exception *ue_header,
                       struct _Unwind_Context *context)
 {
-  if (__builtin_expect (libgcc_s_personality == NULL, 0))
+  if (__glibc_unlikely (libgcc_s_personality == NULL))
     init ();
   return libgcc_s_personality (version, actions, exception_class,
                               ue_header, context);
index 6eb3495f886241cc855a09843dd94383b163bb7d..4cf81ee207317415bb4d1038c585971c62c17135 100644 (file)
@@ -39,7 +39,7 @@ elf_irel (const Elf32_Rel *reloc)
   Elf32_Addr *const reloc_addr = (void *) reloc->r_offset;
   const unsigned long int r_type = ELF32_R_TYPE (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_386_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_386_IRELATIVE))
     {
       Elf32_Addr value = elf_ifunc_invoke(*reloc_addr);
       *reloc_addr = value;
index 917550c64fd8582e29048731dcc02b80c4854c13..368bee21645d775b3fbf6230a468d47a71f8ce79 100644 (file)
@@ -123,7 +123,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
         to intercept the calls to collect information.  In this case we
         don't store the address in the GOT so that all future calls also
         end in this function.  */
-      if (__builtin_expect (profile, 0))
+      if (__glibc_unlikely (profile))
        {
          got[2] = (Elf32_Addr) &_dl_runtime_profile;
 
@@ -308,7 +308,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
 # if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_386_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_386_RELATIVE))
     {
 #  if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       /* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -325,7 +325,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
        *reloc_addr += map->l_addr;
     }
 #  ifndef RTLD_BOOTSTRAP
-  else if (__builtin_expect (r_type == R_386_NONE, 0))
+  else if (__glibc_unlikely (r_type == R_386_NONE))
     return;
 #  endif
   else
@@ -660,7 +660,7 @@ elf_machine_lazy_rel (struct link_map *map,
   Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
   /* Check for unexpected PLT reloc type.  */
-  if (__builtin_expect (r_type == R_386_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_386_JMP_SLOT))
     {
       if (__builtin_expect (map->l_mach.plt, 0) == 0)
        *reloc_addr += l_addr;
@@ -668,7 +668,7 @@ elf_machine_lazy_rel (struct link_map *map,
        *reloc_addr = (map->l_mach.plt
                       + (((Elf32_Addr) reloc_addr) - map->l_mach.gotplt) * 4);
     }
-  else if (__builtin_expect (r_type == R_386_TLS_DESC, 1))
+  else if (__glibc_likely (r_type == R_386_TLS_DESC))
     {
       struct tlsdesc volatile * __attribute__((__unused__)) td =
        (struct tlsdesc volatile *)reloc_addr;
@@ -715,10 +715,10 @@ elf_machine_lazy_rel (struct link_map *map,
 # endif
        }
     }
-  else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
+  else if (__glibc_unlikely (r_type == R_386_IRELATIVE))
     {
       Elf32_Addr value = map->l_addr + *reloc_addr;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = ((Elf32_Addr (*) (void)) value) ();
       *reloc_addr = value;
     }
@@ -736,9 +736,9 @@ elf_machine_lazy_rela (struct link_map *map,
 {
   Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
-  if (__builtin_expect (r_type == R_386_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_386_JMP_SLOT))
     ;
-  else if (__builtin_expect (r_type == R_386_TLS_DESC, 1))
+  else if (__glibc_likely (r_type == R_386_TLS_DESC))
     {
       struct tlsdesc volatile * __attribute__((__unused__)) td =
        (struct tlsdesc volatile *)reloc_addr;
@@ -746,10 +746,10 @@ elf_machine_lazy_rela (struct link_map *map,
       td->arg = (void*)reloc;
       td->entry = _dl_tlsdesc_resolve_rela;
     }
-  else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
+  else if (__glibc_unlikely (r_type == R_386_IRELATIVE))
     {
       Elf32_Addr value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = ((Elf32_Addr (*) (void)) value) ();
       *reloc_addr = value;
     }
index 21bb9908d11a6532787a3edfc989d78ec00d6c53..0f96743390184bc674f5898a35537961e29de82f 100644 (file)
@@ -48,7 +48,7 @@ __ieee754_atanh (double x)
   double t;
   if (isless (xa, 0.5))
     {
-      if (__builtin_expect (xa < 0x1.0p-28, 0))
+      if (__glibc_unlikely (xa < 0x1.0p-28))
        {
          math_force_eval (huge + x);
          return x;
@@ -57,7 +57,7 @@ __ieee754_atanh (double x)
       t = xa + xa;
       t = 0.5 * __log1p (t + t * xa / (1.0 - xa));
     }
-  else if (__builtin_expect (isless (xa, 1.0), 1))
+  else if (__glibc_likely (isless (xa, 1.0)))
     t = 0.5 * __log1p ((xa + xa) / (1.0 - xa));
   else
     {
index 10e23e2218b956047e59e1beb1f2f7e285c8c7a9..588fbfdee8b6ff2811d067ad9dabc183645bbff0 100644 (file)
@@ -43,10 +43,10 @@ __ieee754_exp2 (double x)
   static const double lomark = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
 
   /* Check for usual case.  */
-  if (__builtin_expect (isless (x, himark), 1))
+  if (__glibc_likely (isless (x, himark)))
     {
       /* Exceptional cases:  */
-      if (__builtin_expect (!isgreaterequal (x, lomark), 0))
+      if (__glibc_unlikely (!isgreaterequal (x, lomark)))
        {
          if (__isinf (x))
            /* e^-inf == 0, with no error.  */
index c83c2aedb25fb5fd21a90f5500d6cdaa0e78992d..e82b302200e2794371e4c2c4caf70e24123ed297 100644 (file)
@@ -45,7 +45,7 @@ __ieee754_fmod (double x, double y)
     }
 
   /* determine ix = ilogb(x) */
-  if (__builtin_expect (hx < 0x00100000, 0))            /* subnormal x */
+  if (__glibc_unlikely (hx < 0x00100000))                  /* subnormal x */
     {
       if (hx == 0)
        {
@@ -62,7 +62,7 @@ __ieee754_fmod (double x, double y)
     ix = (hx >> 20) - 1023;
 
   /* determine iy = ilogb(y) */
-  if (__builtin_expect (hy < 0x00100000, 0))            /* subnormal y */
+  if (__glibc_unlikely (hy < 0x00100000))                  /* subnormal y */
     {
       if (hy == 0)
        {
@@ -79,7 +79,7 @@ __ieee754_fmod (double x, double y)
     iy = (hy >> 20) - 1023;
 
   /* set up {hx,lx}, {hy,ly} and align y to x */
-  if (__builtin_expect (ix >= -1022, 1))
+  if (__glibc_likely (ix >= -1022))
     hx = 0x00100000 | (0x000fffff & hx);
   else                  /* subnormal x, shift x to normal */
     {
@@ -95,7 +95,7 @@ __ieee754_fmod (double x, double y)
          lx = 0;
        }
     }
-  if (__builtin_expect (iy >= -1022, 1))
+  if (__glibc_likely (iy >= -1022))
     hy = 0x00100000 | (0x000fffff & hy);
   else                  /* subnormal y, shift y to normal */
     {
@@ -144,7 +144,7 @@ __ieee754_fmod (double x, double y)
       hx = hx + hx + (lx >> 31); lx = lx + lx;
       iy -= 1;
     }
-  if (__builtin_expect (iy >= -1022, 1))        /* normalize output */
+  if (__glibc_likely (iy >= -1022))              /* normalize output */
     {
       hx = ((hx - 0x00100000) | ((iy + 1023) << 20));
       INSERT_WORDS (x, hx | sx, lx);
index 1c427556bc35729b8e62a85f812ce25a20e4ce81..a35a9e560826f41862bfda13d4a102ceb034a790 100644 (file)
@@ -122,7 +122,7 @@ __ieee754_gamma_r (double x, int *signgamp)
 
   EXTRACT_WORDS (hx, lx, x);
 
-  if (__builtin_expect (((hx & 0x7fffffff) | lx) == 0, 0))
+  if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
     {
       /* Return value for x == 0 is Inf with divide by zero exception.  */
       *signgamp = 0;
@@ -135,13 +135,13 @@ __ieee754_gamma_r (double x, int *signgamp)
       *signgamp = 0;
       return (x - x) / (x - x);
     }
-  if (__builtin_expect ((unsigned int) hx == 0xfff00000 && lx == 0, 0))
+  if (__glibc_unlikely ((unsigned int) hx == 0xfff00000 && lx == 0))
     {
       /* x == -Inf.  According to ISO this is NaN.  */
       *signgamp = 0;
       return x - x;
     }
-  if (__builtin_expect ((hx & 0x7ff00000) == 0x7ff00000, 0))
+  if (__glibc_unlikely ((hx & 0x7ff00000) == 0x7ff00000))
     {
       /* Positive infinity (return positive infinity) or NaN (return
         NaN).  */
index 88242bc4f6e9b2cb6a774f69201d7d37e35bcdc5..5cbfcbeb48e00fd6a330fa36037217957b060f29 100644 (file)
@@ -70,7 +70,7 @@ __ieee754_hypot (double x, double y)
       return a + b;
     }                                       /* x/y > 2**60 */
   k = 0;
-  if (__builtin_expect (ha > 0x5f300000, 0))            /* a>2**500 */
+  if (__glibc_unlikely (ha > 0x5f300000))                  /* a>2**500 */
     {
       if (ha >= 0x7ff00000)             /* Inf or NaN */
        {
index ab754c6ee0efdcedde3029cb8438c7998c29e9d3..bc7ca0609ff50586c295f07dcc447daf325e7dd5 100644 (file)
@@ -89,7 +89,7 @@ __ieee754_j1 (double x)
 
   GET_HIGH_WORD (hx, x);
   ix = hx & 0x7fffffff;
-  if (__builtin_expect (ix >= 0x7ff00000, 0))
+  if (__glibc_unlikely (ix >= 0x7ff00000))
     return one / x;
   y = fabs (x);
   if (ix >= 0x40000000)         /* |x| >= 2.0 */
@@ -121,7 +121,7 @@ __ieee754_j1 (double x)
       else
        return z;
     }
-  if (__builtin_expect (ix < 0x3e400000, 0))            /* |x|<2**-27 */
+  if (__glibc_unlikely (ix < 0x3e400000))                  /* |x|<2**-27 */
     {
       if (huge + x > one)
        return 0.5 * x;                 /* inexact if x!=0 necessary */
@@ -163,12 +163,12 @@ __ieee754_y1 (double x)
   EXTRACT_WORDS (hx, lx, x);
   ix = 0x7fffffff & hx;
   /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
-  if (__builtin_expect (ix >= 0x7ff00000, 0))
+  if (__glibc_unlikely (ix >= 0x7ff00000))
     return one / (x + x * x);
-  if (__builtin_expect ((ix | lx) == 0, 0))
+  if (__glibc_unlikely ((ix | lx) == 0))
     return -HUGE_VAL + x;
   /* -inf and overflow exception.  */;
-  if (__builtin_expect (hx < 0, 0))
+  if (__glibc_unlikely (hx < 0))
     return zero / (zero * x);
   if (ix >= 0x40000000)         /* |x| >= 2.0 */
     {
@@ -203,7 +203,7 @@ __ieee754_y1 (double x)
        }
       return z;
     }
-  if (__builtin_expect (ix <= 0x3c900000, 0))        /* x < 2**-54 */
+  if (__glibc_unlikely (ix <= 0x3c900000))              /* x < 2**-54 */
     {
       return (-tpi / x);
     }
index f48e43a0d998a15dd16badff462a6ce1d31ebc28..236878ba1dd46b9aea156f51ffa49d5b432ca707 100644 (file)
@@ -60,7 +60,7 @@ __ieee754_jn (int n, double x)
   EXTRACT_WORDS (hx, lx, x);
   ix = 0x7fffffff & hx;
   /* if J(n,NaN) is NaN */
-  if (__builtin_expect ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000, 0))
+  if (__glibc_unlikely ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000))
     return x + x;
   if (n < 0)
     {
@@ -74,7 +74,7 @@ __ieee754_jn (int n, double x)
     return (__ieee754_j1 (x));
   sgn = (n & 1) & (hx >> 31);   /* even n -- 0, odd n -- sign(x) */
   x = fabs (x);
-  if (__builtin_expect ((ix | lx) == 0 || ix >= 0x7ff00000, 0))
+  if (__glibc_unlikely ((ix | lx) == 0 || ix >= 0x7ff00000))
     /* if x is 0 or inf */
     b = zero;
   else if ((double) n <= x)
@@ -253,12 +253,12 @@ __ieee754_yn (int n, double x)
   EXTRACT_WORDS (hx, lx, x);
   ix = 0x7fffffff & hx;
   /* if Y(n,NaN) is NaN */
-  if (__builtin_expect ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000, 0))
+  if (__glibc_unlikely ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000))
     return x + x;
-  if (__builtin_expect ((ix | lx) == 0, 0))
+  if (__glibc_unlikely ((ix | lx) == 0))
     return -HUGE_VAL + x;
   /* -inf and overflow exception.  */;
-  if (__builtin_expect (hx < 0, 0))
+  if (__glibc_unlikely (hx < 0))
     return zero / (zero * x);
   sign = 1;
   if (n < 0)
@@ -270,7 +270,7 @@ __ieee754_yn (int n, double x)
     return (__ieee754_y0 (x));
   if (n == 1)
     return (sign * __ieee754_y1 (x));
-  if (__builtin_expect (ix == 0x7ff00000, 0))
+  if (__glibc_unlikely (ix == 0x7ff00000))
     return zero;
   if (ix >= 0x52D00000)      /* x > 2**302 */
     { /* (x >> n**2)
index 0b2889cb3b4980ba3f21dc71257ce796c07a0211..05d318b786e5d1881d555ce80b55d032687fdcb1 100644 (file)
@@ -77,23 +77,23 @@ __ieee754_log (double x)
   ux = num.i[HIGH_HALF];
   dx = num.i[LOW_HALF];
   n = 0;
-  if (__builtin_expect (ux < 0x00100000, 0))
+  if (__glibc_unlikely (ux < 0x00100000))
     {
-      if (__builtin_expect (((ux & 0x7fffffff) | dx) == 0, 0))
+      if (__glibc_unlikely (((ux & 0x7fffffff) | dx) == 0))
        return MHALF / 0.0;     /* return -INF */
-      if (__builtin_expect (ux < 0, 0))
+      if (__glibc_unlikely (ux < 0))
        return (x - x) / 0.0;   /* return NaN  */
       n -= 54;
       x *= two54.d;             /* scale x     */
       num.d = x;
     }
-  if (__builtin_expect (ux >= 0x7ff00000, 0))
+  if (__glibc_unlikely (ux >= 0x7ff00000))
     return x + x;               /* INF or NaN  */
 
   /* Regular values of x */
 
   w = x - 1;
-  if (__builtin_expect (ABS (w) > U03, 1))
+  if (__glibc_likely (ABS (w) > U03))
     goto case_03;
 
   /*--- Stage I, the case abs(x-1) < 0.03 */
index c3d465a4a912989ac5968d2129fcd88376d822db..8548ee39428d1a2a24871bc56fb6b139e6d226a8 100644 (file)
@@ -63,15 +63,15 @@ __ieee754_log10 (double x)
   k = 0;
   if (hx < 0x00100000)
     {                           /* x < 2**-1022  */
-      if (__builtin_expect (((hx & 0x7fffffff) | lx) == 0, 0))
+      if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
        return -two54 / (x - x);        /* log(+-0)=-inf */
-      if (__builtin_expect (hx < 0, 0))
+      if (__glibc_unlikely (hx < 0))
        return (x - x) / (x - x);       /* log(-#) = NaN */
       k -= 54;
       x *= two54;               /* subnormal number, scale up x */
       GET_HIGH_WORD (hx, x);
     }
-  if (__builtin_expect (hx >= 0x7ff00000, 0))
+  if (__glibc_unlikely (hx >= 0x7ff00000))
     return x + x;
   k += (hx >> 20) - 1023;
   i = ((u_int32_t) k & 0x80000000) >> 31;
index 890a4a2bd0d33d523efbcff9d1ab378f817b7422..997d7cefc81ed79784dd4f00dfc38b39c9d91a00 100644 (file)
@@ -81,15 +81,15 @@ __ieee754_log2 (double x)
   k = 0;
   if (hx < 0x00100000)
     {                           /* x < 2**-1022  */
-      if (__builtin_expect (((hx & 0x7fffffff) | lx) == 0, 0))
+      if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
        return -two54 / (x - x);        /* log(+-0)=-inf */
-      if (__builtin_expect (hx < 0, 0))
+      if (__glibc_unlikely (hx < 0))
        return (x - x) / (x - x);       /* log(-#) = NaN */
       k -= 54;
       x *= two54;               /* subnormal number, scale up x */
       GET_HIGH_WORD (hx, x);
     }
-  if (__builtin_expect (hx >= 0x7ff00000, 0))
+  if (__glibc_unlikely (hx >= 0x7ff00000))
     return x + x;
   k += (hx >> 20) - 1023;
   hx &= 0x000fffff;
index 851b510aaa71834fa3e25b86aa8aed7aaf694aac..4ff28bf85dff8afc33f9b154d06ef26bb002a650 100644 (file)
@@ -49,7 +49,7 @@ __ieee754_sinh (double x)
   ix = jx & 0x7fffffff;
 
   /* x is INF or NaN */
-  if (__builtin_expect (ix >= 0x7ff00000, 0))
+  if (__glibc_unlikely (ix >= 0x7ff00000))
     return x + x;
 
   h = 0.5;
@@ -58,7 +58,7 @@ __ieee754_sinh (double x)
   /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
   if (ix < 0x40360000)                  /* |x|<22 */
     {
-      if (__builtin_expect (ix < 0x3e300000, 0))        /* |x|<2**-28 */
+      if (__glibc_unlikely (ix < 0x3e300000))              /* |x|<2**-28 */
        if (shuge + x > one)
          return x;
       /* sinh(tiny) = tiny with inexact */
index 55007468485e2adc28fdfc460d56a6bebc0f17a3..a33758d3c90bec3ea067d5f69994f5a4ee387a10 100644 (file)
@@ -36,12 +36,12 @@ __asinh (double x)
   int32_t hx, ix;
   GET_HIGH_WORD (hx, x);
   ix = hx & 0x7fffffff;
-  if (__builtin_expect (ix < 0x3e300000, 0))            /* |x|<2**-28 */
+  if (__glibc_unlikely (ix < 0x3e300000))                  /* |x|<2**-28 */
     {
       if (huge + x > one)
        return x;                       /* return x inexact except 0 */
     }
-  if (__builtin_expect (ix > 0x41b00000, 0))            /* |x| > 2**28 */
+  if (__glibc_unlikely (ix > 0x41b00000))                  /* |x| > 2**28 */
     {
       if (ix >= 0x7ff00000)
        return x + x;                           /* x is inf or NaN */
index cfaa22d18444a44956de55888416ad47c73a97bc..389acd4cdefff769654df7f612344038aaa04cc1 100644 (file)
@@ -174,7 +174,7 @@ __fma (double x, double y, double z)
     }
 
   /* Ensure correct sign of exact 0 + 0.  */
-  if (__builtin_expect ((x == 0 || y == 0) && z == 0, 0))
+  if (__glibc_unlikely ((x == 0 || y == 0) && z == 0))
     return x * y + z;
 
   fenv_t env;
@@ -216,7 +216,7 @@ __fma (double x, double y, double z)
   /* Perform m2 + a2 addition with round to odd.  */
   u.d = a2 + m2;
 
-  if (__builtin_expect (adjust < 0, 0))
+  if (__glibc_unlikely (adjust < 0))
     {
       if ((u.ieee.mantissa1 & 1) == 0)
        u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
@@ -228,14 +228,14 @@ __fma (double x, double y, double z)
   /* Reset rounding mode and test for inexact simultaneously.  */
   int j = libc_feupdateenv_test (&env, FE_INEXACT) != 0;
 
-  if (__builtin_expect (adjust == 0, 1))
+  if (__glibc_likely (adjust == 0))
     {
       if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
        u.ieee.mantissa1 |= j;
       /* Result is a1 + u.d.  */
       return a1 + u.d;
     }
-  else if (__builtin_expect (adjust > 0, 1))
+  else if (__glibc_likely (adjust > 0))
     {
       if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
        u.ieee.mantissa1 |= j;
index ea1dc6ca767f1ebab609576c85a6558bc91855e2..fd4dce5f2334b671e929e656bdf2e42c8707656f 100644 (file)
@@ -107,14 +107,14 @@ __log1p (double x)
   k = 1;
   if (hx < 0x3FDA827A)                          /* x < 0.41422  */
     {
-      if (__builtin_expect (ax >= 0x3ff00000, 0))     /* x <= -1.0 */
+      if (__glibc_unlikely (ax >= 0x3ff00000))           /* x <= -1.0 */
        {
          if (x == -1.0)
            return -two54 / (x - x);            /* log1p(-1)=+inf */
          else
            return (x - x) / (x - x);           /* log1p(x<-1)=NaN */
        }
-      if (__builtin_expect (ax < 0x3e200000, 0))     /* |x| < 2**-29 */
+      if (__glibc_unlikely (ax < 0x3e200000))           /* |x| < 2**-29 */
        {
          math_force_eval (two54 + x);          /* raise inexact */
          if (ax < 0x3c900000)                  /* |x| < 2**-54 */
@@ -127,7 +127,7 @@ __log1p (double x)
          k = 0; f = x; hu = 1;
        }                       /* -0.2929<x<0.41422 */
     }
-  else if (__builtin_expect (hx >= 0x7ff00000, 0))
+  else if (__glibc_unlikely (hx >= 0x7ff00000))
     return x + x;
   if (k != 0)
     {
index c065826dd25982e9d63a541c768eabcb49a08215..7a6c49abf51e020b092b53fbe65c8ab4e6fa0418 100644 (file)
@@ -30,7 +30,7 @@ __logb (double x)
     return -1.0 / fabs (x);
   if (ix >= 0x7ff00000)
     return x * x;
-  if (__builtin_expect ((rix = ix >> 20) == 0, 0))
+  if (__glibc_unlikely ((rix = ix >> 20) == 0))
     {
       /* POSIX specifies that denormal number is treated as
          though it were normalized.  */
index 1dce6381ae92554b140f905e4692f43a54aa9944..0a1e13008f496fbf081845163ecf90e22f2fc8e6 100644 (file)
@@ -54,7 +54,7 @@ __modf (double x, double *iptr)
            }
        }
     }
-  else if (__builtin_expect (j0 > 51, 0))        /* no fraction part */
+  else if (__glibc_unlikely (j0 > 51))              /* no fraction part */
     {
       *iptr = x * one;
       /* We must handle NaNs separately.  */
index 6402927d23cfbddaa4cabb2f1976b2962b5f839d..874b98e4cf70883badbe7facaea6dee4a162e391 100644 (file)
@@ -31,7 +31,7 @@ __scalbln (double x, long int n)
   int32_t k, hx, lx;
   EXTRACT_WORDS (hx, lx, x);
   k = (hx & 0x7ff00000) >> 20;                  /* extract exponent */
-  if (__builtin_expect (k == 0, 0))             /* 0 or subnormal x */
+  if (__glibc_unlikely (k == 0))                   /* 0 or subnormal x */
     {
       if ((lx | (hx & 0x7fffffff)) == 0)
        return x;                                  /* +-0 */
@@ -39,16 +39,16 @@ __scalbln (double x, long int n)
       GET_HIGH_WORD (hx, x);
       k = ((hx & 0x7ff00000) >> 20) - 54;
     }
-  if (__builtin_expect (k == 0x7ff, 0))
+  if (__glibc_unlikely (k == 0x7ff))
     return x + x;                                       /* NaN or Inf */
-  if (__builtin_expect (n < -50000, 0))
+  if (__glibc_unlikely (n < -50000))
     return tiny * __copysign (tiny, x);   /*underflow*/
-  if (__builtin_expect (n > 50000 || k + n > 0x7fe, 0))
+  if (__glibc_unlikely (n > 50000 || k + n > 0x7fe))
     return huge * __copysign (huge, x);   /* overflow  */
   /* Now k and n are bounded we know that k = k+n does not
      overflow.  */
   k = k + n;
-  if (__builtin_expect (k > 0, 1))              /* normal result */
+  if (__glibc_likely (k > 0))                    /* normal result */
     {
       SET_HIGH_WORD (x, (hx & 0x800fffff) | (k << 20)); return x;
     }
index 6e7d5ad2179c6b4a8c3de1a60ee32fe9b5f40bb7..0f58034df596f8c3f4d94a20a3390b7e1f7fd1d7 100644 (file)
@@ -31,7 +31,7 @@ __scalbn (double x, int n)
   int32_t k, hx, lx;
   EXTRACT_WORDS (hx, lx, x);
   k = (hx & 0x7ff00000) >> 20;                  /* extract exponent */
-  if (__builtin_expect (k == 0, 0))             /* 0 or subnormal x */
+  if (__glibc_unlikely (k == 0))                   /* 0 or subnormal x */
     {
       if ((lx | (hx & 0x7fffffff)) == 0)
        return x;                                  /* +-0 */
@@ -39,16 +39,16 @@ __scalbn (double x, int n)
       GET_HIGH_WORD (hx, x);
       k = ((hx & 0x7ff00000) >> 20) - 54;
     }
-  if (__builtin_expect (k == 0x7ff, 0))
+  if (__glibc_unlikely (k == 0x7ff))
     return x + x;                                       /* NaN or Inf */
-  if (__builtin_expect (n < -50000, 0))
+  if (__glibc_unlikely (n < -50000))
     return tiny * __copysign (tiny, x);   /*underflow*/
-  if (__builtin_expect (n > 50000 || k + n > 0x7fe, 0))
+  if (__glibc_unlikely (n > 50000 || k + n > 0x7fe))
     return huge * __copysign (huge, x);   /* overflow  */
   /* Now k and n are bounded we know that k = k+n does not
      overflow.  */
   k = k + n;
-  if (__builtin_expect (k > 0, 1))              /* normal result */
+  if (__glibc_likely (k > 0))                    /* normal result */
     {
       SET_HIGH_WORD (x, (hx & 0x800fffff) | (k << 20)); return x;
     }
index 26268f24981178564a5ecddd4f8c68d91940f3ed..ccccdaf106d0bf5dc90c32fa5c5f873e3893bf42 100644 (file)
@@ -39,7 +39,7 @@ __ieee754_acosh (double x)
 
   if (hx > INT64_C (0x4000000000000000))
     {
-      if (__builtin_expect (hx >= INT64_C (0x41b0000000000000), 0))
+      if (__glibc_unlikely (hx >= INT64_C (0x41b0000000000000)))
        {
          /* x > 2**28 */
          if (hx >= INT64_C (0x7ff0000000000000))
@@ -53,13 +53,13 @@ __ieee754_acosh (double x)
       double t = x * x;
       return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
     }
-  else if (__builtin_expect (hx > INT64_C (0x3ff0000000000000), 1))
+  else if (__glibc_likely (hx > INT64_C (0x3ff0000000000000)))
     {
       /* 1<x<2 */
       double t = x - one;
       return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
     }
-  else if (__builtin_expect (hx == INT64_C (0x3ff0000000000000), 1))
+  else if (__glibc_likely (hx == INT64_C (0x3ff0000000000000)))
     return 0.0;                                /* acosh(1) = 0 */
   else                                 /* x < 1 */
     return (x - x) / (x - x);
index dcb7b58a1b0c0579153aaceb3fd6e54c6c2b3aa1..4f5a81669ef1142e1f8deb6384664b6dff280200 100644 (file)
@@ -64,16 +64,16 @@ __ieee754_log10 (double x)
   k = 0;
   if (hx < INT64_C(0x0010000000000000))
     {                          /* x < 2**-1022  */
-      if (__builtin_expect ((hx & UINT64_C(0x7fffffffffffffff)) == 0, 0))
+      if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
        return -two54 / (x - x);        /* log(+-0)=-inf */
-      if (__builtin_expect (hx < 0, 0))
+      if (__glibc_unlikely (hx < 0))
        return (x - x) / (x - x);       /* log(-#) = NaN */
       k -= 54;
       x *= two54;              /* subnormal number, scale up x */
       EXTRACT_WORDS64 (hx, x);
     }
   /* scale up resulted in a NaN number  */
-  if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000), 0))
+  if (__glibc_unlikely (hx >= UINT64_C(0x7ff0000000000000)))
     return x + x;
   k += (hx >> 52) - 1023;
   i = ((uint64_t) k & UINT64_C(0x8000000000000000)) >> 63;
index 6dc7b7d217266a6a3826738482e9ef652b10ac14..5ccb78cf03c8f3be998c9f103780fe1282288c47 100644 (file)
@@ -80,15 +80,15 @@ __ieee754_log2 (double x)
   k = 0;
   if (hx < INT64_C(0x0010000000000000))
     {                          /* x < 2**-1022  */
-      if (__builtin_expect ((hx & UINT64_C(0x7fffffffffffffff)) == 0, 0))
+      if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
        return -two54 / (x - x);        /* log(+-0)=-inf */
-      if (__builtin_expect (hx < 0, 0))
+      if (__glibc_unlikely (hx < 0))
        return (x - x) / (x - x);       /* log(-#) = NaN */
       k -= 54;
       x *= two54;              /* subnormal number, scale up x */
       EXTRACT_WORDS64 (hx, x);
     }
-  if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000), 0))
+  if (__glibc_unlikely (hx >= UINT64_C(0x7ff0000000000000)))
     return x + x;
   k += (hx >> 52) - 1023;
   hx &= UINT64_C(0x000fffffffffffff);
index d03e33ee1f68ca6e1f82ce68dc90285663fffe9a..f2d980d9e0e7d6f5727affd614150845908ce995 100644 (file)
@@ -39,11 +39,11 @@ __frexp (double x, int *eptr)
   int32_t ex = 0x7ff & (ix >> 52);
   int e = 0;
 
-  if (__builtin_expect (ex != 0x7ff && x != 0.0, 1))
+  if (__glibc_likely (ex != 0x7ff && x != 0.0))
     {
       /* Not zero and finite.  */
       e = ex - 1022;
-      if (__builtin_expect (ex == 0, 0))
+      if (__glibc_unlikely (ex == 0))
        {
          /* Subnormal.  */
          x *= 0x1p54;
index e51c84959276c5762fbae1388d151db00ab54f0f..1970ce922ee1782e164176d05abfc3d8afac7267 100644 (file)
@@ -34,7 +34,7 @@ __logb (double x)
   ex = ix >> 52;
   if (ex == 0x7ff)
     return x * x;
-  if (__builtin_expect (ex == 0, 0))
+  if (__glibc_unlikely (ex == 0))
     {
       int m = __builtin_clzll (ix);
       ex -= m - 12;
index b22503f5c7d062b2f1838ebc8ec595a1a94bc03c..06b9242a86566e49f90115ccdd6993936d830740 100644 (file)
@@ -40,7 +40,7 @@ __remquo (double x, double y, int *quo)
   hx &= UINT64_C(0x7fffffffffffffff);
 
   /* Purge off exception values.  */
-  if (__builtin_expect (hy == 0, 0))
+  if (__glibc_unlikely (hy == 0))
     return (x * y) / (x * y);                  /* y = 0 */
   if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000) /* x not finite */
                        || hy > UINT64_C(0x7ff0000000000000), 0))/* y is NaN */
@@ -49,7 +49,7 @@ __remquo (double x, double y, int *quo)
   if (hy <= UINT64_C(0x7fbfffffffffffff))
     x = __ieee754_fmod (x, 8 * y);             /* now x < 8y */
 
-  if (__builtin_expect (hx == hy, 0))
+  if (__glibc_unlikely (hx == hy))
     {
       *quo = qs ? -1 : 1;
       return zero * x;
index 684858c065bd6d7c9ac9fb99803f78aa70289b7c..8b86b81b009a0dda14342a764bba03533a026f70 100644 (file)
@@ -32,7 +32,7 @@ __round (double x)
 
   EXTRACT_WORDS64 (i0, x);
   j0 = ((i0 >> 52) & 0x7ff) - 0x3ff;
-  if (__builtin_expect (j0 < 52, 1))
+  if (__glibc_likely (j0 < 52))
     {
       if (j0 < 0)
        {
index dbd3fe4be2d4d3f612f3dbdd00c7c73e4410f523..da4fa4dc0b5c0a86ddb05530340b555c7dd283e7 100644 (file)
@@ -48,7 +48,7 @@ __ieee754_atanhf (float x)
   float t;
   if (isless (xa, 0.5f))
     {
-      if (__builtin_expect (xa < 0x1.0p-28f, 0))
+      if (__glibc_unlikely (xa < 0x1.0p-28f))
        {
          math_force_eval (huge + x);
          return x;
@@ -57,7 +57,7 @@ __ieee754_atanhf (float x)
       t = xa + xa;
       t = 0.5f * __log1pf (t + t * xa / (1.0f - xa));
     }
-  else if (__builtin_expect (isless (xa, 1.0f), 1))
+  else if (__glibc_likely (isless (xa, 1.0f)))
     t = 0.5f * __log1pf ((xa + xa) / (1.0f - xa));
   else
     {
index e8da51a42cb142442b909df665f3a74a2f9988af..7b72587e9d53f66f9fadd10c63e4ed101e8e7461 100644 (file)
@@ -114,7 +114,7 @@ __ieee754_gammaf_r (float x, int *signgamp)
 
   GET_FLOAT_WORD (hx, x);
 
-  if (__builtin_expect ((hx & 0x7fffffff) == 0, 0))
+  if (__glibc_unlikely ((hx & 0x7fffffff) == 0))
     {
       /* Return value for x == 0 is Inf with divide by zero exception.  */
       *signgamp = 0;
@@ -127,13 +127,13 @@ __ieee754_gammaf_r (float x, int *signgamp)
       *signgamp = 0;
       return (x - x) / (x - x);
     }
-  if (__builtin_expect (hx == 0xff800000, 0))
+  if (__glibc_unlikely (hx == 0xff800000))
     {
       /* x == -Inf.  According to ISO this is NaN.  */
       *signgamp = 0;
       return x - x;
     }
-  if (__builtin_expect ((hx & 0x7f800000) == 0x7f800000, 0))
+  if (__glibc_unlikely ((hx & 0x7f800000) == 0x7f800000))
     {
       /* Positive infinity (return positive infinity) or NaN (return
         NaN).  */
index 011adbb2b730f134698736ec54bdadd9470c9fb0..ba0267ebcbffed0f4918bf0d33269a3bfce38ec0 100644 (file)
@@ -27,7 +27,7 @@ __logbf (float x)
     return (float) -1.0 / fabsf (x);
   if (ix >= 0x7f800000)
     return x * x;
-  if (__builtin_expect ((rix = ix >> 23) == 0, 0))
+  if (__glibc_unlikely ((rix = ix >> 23) == 0))
     {
       /* POSIX specifies that denormal number is treated as
          though it were normalized.  */
index 48b63ab51d2f37ea0716ef993f506ae5f6f0be14..1d5f27b7b61598ef2776ee34547ee29455e79e7e 100644 (file)
@@ -178,7 +178,7 @@ __fmal (long double x, long double y, long double z)
     }
 
   /* Ensure correct sign of exact 0 + 0.  */
-  if (__builtin_expect ((x == 0 || y == 0) && z == 0, 0))
+  if (__glibc_unlikely ((x == 0 || y == 0) && z == 0))
     return x * y + z;
 
   fenv_t env;
@@ -220,7 +220,7 @@ __fmal (long double x, long double y, long double z)
   /* Perform m2 + a2 addition with round to odd.  */
   u.d = a2 + m2;
 
-  if (__builtin_expect (adjust == 0, 1))
+  if (__glibc_likely (adjust == 0))
     {
       if ((u.ieee.mantissa3 & 1) == 0 && u.ieee.exponent != 0x7fff)
        u.ieee.mantissa3 |= fetestexcept (FE_INEXACT) != 0;
@@ -228,7 +228,7 @@ __fmal (long double x, long double y, long double z)
       /* Result is a1 + u.d.  */
       return a1 + u.d;
     }
-  else if (__builtin_expect (adjust > 0, 1))
+  else if (__glibc_likely (adjust > 0))
     {
       if ((u.ieee.mantissa3 & 1) == 0 && u.ieee.exponent != 0x7fff)
        u.ieee.mantissa3 |= fetestexcept (FE_INEXACT) != 0;
index a140fb322d7c6a61bdb372e5bb0e47d01b715443..205097d38f2154edb2379e9cc729e5f4e392ff4e 100644 (file)
@@ -48,7 +48,7 @@ __ieee754_fmodl (long double x, long double y)
                            (hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */
                            (hy>0x7ff0000000000000LL),0))       /* or y is NaN */
            return (x*y)/(x*y);
-       if (__builtin_expect (hx <= hy, 0))
+       if (__glibc_unlikely (hx <= hy))
          {
            /* If |x| < |y| return x.  */
            if (hx < hy)
@@ -83,7 +83,7 @@ __ieee754_fmodl (long double x, long double y)
        ldbl_extract_mantissa(&hx, &lx, &ix, x);
        ldbl_extract_mantissa(&hy, &ly, &iy, y);
 
-       if (__builtin_expect (ix == -IEEE754_DOUBLE_BIAS, 0))
+       if (__glibc_unlikely (ix == -IEEE754_DOUBLE_BIAS))
          {
            /* subnormal x, shift x to normal.  */
            while ((hx & (1LL << 48)) == 0)
@@ -94,7 +94,7 @@ __ieee754_fmodl (long double x, long double y)
              }
          }
 
-       if (__builtin_expect (iy == -IEEE754_DOUBLE_BIAS, 0))
+       if (__glibc_unlikely (iy == -IEEE754_DOUBLE_BIAS))
          {
            /* subnormal y, shift y to normal.  */
            while ((hy & (1LL << 48)) == 0)
index 1b6e27a9ff7d0585621a3d2a74c8f66b7db96200..051352f9f715e881e23c15d9920fd184d4562f5b 100644 (file)
@@ -215,14 +215,14 @@ ldbl_nearbyint (double a)
 {
   double two52 = 0x1p52;
 
-  if (__builtin_expect ((__builtin_fabs (a) < two52), 1))
+  if (__glibc_likely ((__builtin_fabs (a) < two52)))
     {
-      if (__builtin_expect ((a > 0.0), 1))
+      if (__glibc_likely ((a > 0.0)))
        {
          a += two52;
          a -= two52;
        }
-      else if (__builtin_expect ((a < 0.0), 1))
+      else if (__glibc_likely ((a < 0.0)))
        {
          a = two52 - a;
          a = -(a - two52);
index 345f3905d62979f4653b044cd206da740f4a2732..86996bff3d56f0ca8e98fa02a89c2ecadb8730e2 100644 (file)
@@ -45,7 +45,7 @@ __llrintl (long double x)
     {
       save_round = __fegetround ();
 
-      if (__builtin_expect ((xh == -(double) (-__LONG_LONG_MAX__ - 1)), 0))
+      if (__glibc_unlikely ((xh == -(double) (-__LONG_LONG_MAX__ - 1))))
        {
          /* When XH is 9223372036854775808.0, converting to long long will
             overflow, resulting in an invalid operation.  However, XL might
@@ -72,7 +72,7 @@ __llrintl (long double x)
       res = hi + lo;
 
       /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
-      if (__builtin_expect (((~(hi ^ lo) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
        goto overflow;
 
       xh -= lo;
@@ -114,7 +114,7 @@ __llrintl (long double x)
          break;
        }
 
-      if (__builtin_expect (((~(hi ^ (res - hi)) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
        goto overflow;
 
       return res;
index 4a6e2d5f839ccfb8f169e7a068a3bc858dbea0c6..dd84074cf7ae71f8fd199068c7c555042f7acf27 100644 (file)
@@ -41,7 +41,7 @@ __llroundl (long double x)
 #endif
     )
     {
-      if (__builtin_expect ((xh == -(double) (-__LONG_LONG_MAX__ - 1)), 0))
+      if (__glibc_unlikely ((xh == -(double) (-__LONG_LONG_MAX__ - 1))))
        {
          /* When XH is 9223372036854775808.0, converting to long long will
             overflow, resulting in an invalid operation.  However, XL might
@@ -68,7 +68,7 @@ __llroundl (long double x)
       res = hi + lo;
 
       /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
-      if (__builtin_expect (((~(hi ^ lo) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
        goto overflow;
 
       xh -= lo;
@@ -94,7 +94,7 @@ __llroundl (long double x)
            res -= 1;
        }
 
-      if (__builtin_expect (((~(hi ^ (res - hi)) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
        goto overflow;
 
       return res;
index da8d71bdec474cf206b56389454444c0f47cab1e..dbd3478e6330d46160a4aaa4a26a3b6d466a5fb4 100644 (file)
@@ -36,7 +36,7 @@ __logbl (long double x)
     return -1.0 / fabs (x);
   if (hx >= 0x7ff0000000000000LL)
     return x * x;
-  if (__builtin_expect ((rhx = hx >> 52) == 0, 0))
+  if (__glibc_unlikely ((rhx = hx >> 52) == 0))
     {
       /* POSIX specifies that denormal number is treated as
          though it were normalized.  */
index 56c3a81cd338671fe8a97db3c0b3b0e5004d070e..2b47c52a06071a1bfeb84e697dd0947197624ed8 100644 (file)
@@ -59,7 +59,7 @@ __lrintl (long double x)
        hi = llhi;
       xh -= hi;
 #else
-      if (__builtin_expect ((xh == -(double) (-__LONG_MAX__ - 1)), 0))
+      if (__glibc_unlikely ((xh == -(double) (-__LONG_MAX__ - 1))))
        {
          /* When XH is 9223372036854775808.0, converting to long long will
             overflow, resulting in an invalid operation.  However, XL might
@@ -87,7 +87,7 @@ __lrintl (long double x)
       res = hi + lo;
 
       /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
-      if (__builtin_expect (((~(hi ^ lo) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
        goto overflow;
 
       xh -= lo;
@@ -129,7 +129,7 @@ __lrintl (long double x)
          break;
        }
 
-      if (__builtin_expect (((~(hi ^ (res - hi)) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
        goto overflow;
 
       return res;
index 107778df3e6655bf3c6436644217b12657cd4184..27b72e2ad186e483ddc57df3d3e043c490060fb9 100644 (file)
@@ -55,7 +55,7 @@ __lroundl (long double x)
        hi = llhi;
       xh -= hi;
 #else
-      if (__builtin_expect ((xh == -(double) (-__LONG_MAX__ - 1)), 0))
+      if (__glibc_unlikely ((xh == -(double) (-__LONG_MAX__ - 1))))
        {
          /* When XH is 9223372036854775808.0, converting to long long will
             overflow, resulting in an invalid operation.  However, XL might
@@ -83,7 +83,7 @@ __lroundl (long double x)
       res = hi + lo;
 
       /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi).  */
-      if (__builtin_expect (((~(hi ^ lo) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
        goto overflow;
 
       xh -= lo;
@@ -109,7 +109,7 @@ __lroundl (long double x)
            res -= 1;
        }
 
-      if (__builtin_expect (((~(hi ^ (res - hi)) & (res ^ hi)) < 0), 0))
+      if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
        goto overflow;
 
       return res;
index 477c3a61d3a8dc109819322e5149791c82a6daab..2832f417c9b156f764ed56ac68834d18496cfdbe 100644 (file)
@@ -119,19 +119,19 @@ __ieee754_gammal_r (long double x, int *signgamp)
 
   GET_LDOUBLE_WORDS (es, hx, lx, x);
 
-  if (__builtin_expect (((es & 0x7fff) | hx | lx) == 0, 0))
+  if (__glibc_unlikely (((es & 0x7fff) | hx | lx) == 0))
     {
       /* Return value for x == 0 is Inf with divide by zero exception.  */
       *signgamp = 0;
       return 1.0 / x;
     }
-  if (__builtin_expect (es == 0xffffffff && ((hx & 0x7fffffff) | lx) == 0, 0))
+  if (__glibc_unlikely (es == 0xffffffff && ((hx & 0x7fffffff) | lx) == 0))
     {
       /* x == -Inf.  According to ISO this is NaN.  */
       *signgamp = 0;
       return x - x;
     }
-  if (__builtin_expect ((es & 0x7fff) == 0x7fff, 0))
+  if (__glibc_unlikely ((es & 0x7fff) == 0x7fff))
     {
       /* Positive infinity (return positive infinity) or NaN (return
         NaN).  */
index 3939259d8108075aa6046099477a7fc032fa6611..56f48f1ab92d448456423d1a2e872c3716528074 100644 (file)
@@ -112,7 +112,7 @@ __ieee754_j0l (long double x)
 
   GET_LDOUBLE_EXP (se, x);
   ix = se & 0x7fff;
-  if (__builtin_expect (ix >= 0x7fff, 0))
+  if (__glibc_unlikely (ix >= 0x7fff))
     return one / (x * x);
   x = fabsl (x);
   if (ix >= 0x4000)            /* |x| >= 2.0 */
@@ -132,7 +132,7 @@ __ieee754_j0l (long double x)
        * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
        * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
        */
-      if (__builtin_expect (ix > 0x4080, 0))   /* 2^129 */
+      if (__glibc_unlikely (ix > 0x4080))              /* 2^129 */
        z = (invsqrtpi * cc) / __ieee754_sqrtl (x);
       else
        {
@@ -142,7 +142,7 @@ __ieee754_j0l (long double x)
        }
       return z;
     }
-  if (__builtin_expect (ix < 0x3fef, 0)) /* |x| < 2**-16 */
+  if (__glibc_unlikely (ix < 0x3fef))       /* |x| < 2**-16 */
     {
       /* raise inexact if x != 0 */
       math_force_eval (huge + x);
@@ -199,11 +199,11 @@ __ieee754_y0l (long double x)
   GET_LDOUBLE_WORDS (se, i0, i1, x);
   ix = se & 0x7fff;
   /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0  */
-  if (__builtin_expect (se & 0x8000, 0))
+  if (__glibc_unlikely (se & 0x8000))
     return zero / (zero * x);
-  if (__builtin_expect (ix >= 0x7fff, 0))
+  if (__glibc_unlikely (ix >= 0x7fff))
     return one / (x + x * x);
-  if (__builtin_expect ((i0 | i1) == 0, 0))
+  if (__glibc_unlikely ((i0 | i1) == 0))
     return -HUGE_VALL + x;  /* -inf and overflow exception.  */
   if (ix >= 0x4000)
     {                          /* |x| >= 2.0 */
@@ -234,7 +234,7 @@ __ieee754_y0l (long double x)
          else
            ss = z / cc;
        }
-      if (__builtin_expect (ix > 0x4080, 0))   /* 1e39 */
+      if (__glibc_unlikely (ix > 0x4080))              /* 1e39 */
        z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
       else
        {
@@ -244,7 +244,7 @@ __ieee754_y0l (long double x)
        }
       return z;
     }
-  if (__builtin_expect (ix <= 0x3fde, 0)) /* x < 2^-33 */
+  if (__glibc_unlikely (ix <= 0x3fde))       /* x < 2^-33 */
     {
       z = -7.380429510868722527629822444004602747322E-2L
        + tpi * __ieee754_logl (x);
index 4c13018aea022e851a73d42837d4bf957f39b0a5..5c0a2e199271eb0cfe49771a043e791efddeaed9 100644 (file)
@@ -114,7 +114,7 @@ __ieee754_j1l (long double x)
 
   GET_LDOUBLE_EXP (se, x);
   ix = se & 0x7fff;
-  if (__builtin_expect (ix >= 0x7fff, 0))
+  if (__glibc_unlikely (ix >= 0x7fff))
     return one / x;
   y = fabsl (x);
   if (ix >= 0x4000)
@@ -134,7 +134,7 @@ __ieee754_j1l (long double x)
        * j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
        * y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
        */
-      if (__builtin_expect (ix > 0x4080, 0))
+      if (__glibc_unlikely (ix > 0x4080))
        z = (invsqrtpi * cc) / __ieee754_sqrtl (y);
       else
        {
@@ -147,7 +147,7 @@ __ieee754_j1l (long double x)
       else
        return z;
     }
-  if (__builtin_expect (ix < 0x3fde, 0)) /* |x| < 2^-33 */
+  if (__glibc_unlikely (ix < 0x3fde))       /* |x| < 2^-33 */
     {
       if (huge + x > one)
        return 0.5 * x;         /* inexact if x!=0 necessary */
@@ -192,11 +192,11 @@ __ieee754_y1l (long double x)
   GET_LDOUBLE_WORDS (se, i0, i1, x);
   ix = se & 0x7fff;
   /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
-  if (__builtin_expect (se & 0x8000, 0))
+  if (__glibc_unlikely (se & 0x8000))
     return zero / (zero * x);
-  if (__builtin_expect (ix >= 0x7fff, 0))
+  if (__glibc_unlikely (ix >= 0x7fff))
     return one / (x + x * x);
-  if (__builtin_expect ((i0 | i1) == 0, 0))
+  if (__glibc_unlikely ((i0 | i1) == 0))
     return -HUGE_VALL + x;  /* -inf and overflow exception.  */
   if (ix >= 0x4000)
     {                          /* |x| >= 2.0 */
@@ -222,7 +222,7 @@ __ieee754_y1l (long double x)
        *              sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
        * to compute the worse one.
        */
-      if (__builtin_expect (ix > 0x4080, 0))
+      if (__glibc_unlikely (ix > 0x4080))
        z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
       else
        {
@@ -232,7 +232,7 @@ __ieee754_y1l (long double x)
        }
       return z;
     }
-  if (__builtin_expect (ix <= 0x3fbe, 0))
+  if (__glibc_unlikely (ix <= 0x3fbe))
     {                          /* x < 2**-65 */
       return (-tpi / x);
     }
index fa8e27efecaaeba8afd299781c1d83c64027aa4a..11d097c271f978de2d3081a41c3abe57c154e91e 100644 (file)
@@ -81,7 +81,7 @@ __ieee754_jnl (int n, long double x)
   ix = se & 0x7fff;
 
   /* if J(n,NaN) is NaN */
-  if (__builtin_expect ((ix == 0x7fff) && ((i0 & 0x7fffffff) != 0), 0))
+  if (__glibc_unlikely ((ix == 0x7fff) && ((i0 & 0x7fffffff) != 0)))
     return x + x;
   if (n < 0)
     {
@@ -95,7 +95,7 @@ __ieee754_jnl (int n, long double x)
     return (__ieee754_j1l (x));
   sgn = (n & 1) & (se >> 15);  /* even n -- 0, odd n -- sign(x) */
   x = fabsl (x);
-  if (__builtin_expect ((ix | i0 | i1) == 0 || ix >= 0x7fff, 0))
+  if (__glibc_unlikely ((ix | i0 | i1) == 0 || ix >= 0x7fff))
     /* if x is 0 or inf */
     b = zero;
   else if ((long double) n <= x)
@@ -316,7 +316,7 @@ __ieee754_ynl (int n, long double x)
     return (__ieee754_y0l (x));
   if (n == 1)
     return (sign * __ieee754_y1l (x));
-  if (__builtin_expect (ix == 0x7fff, 0))
+  if (__glibc_unlikely (ix == 0x7fff))
     return zero;
   if (ix >= 0x412D)
     {                          /* x > 2**302 */
index fde28110400a5588594342a664cc960083c558c1..354be4eae98ef331ce27fd36adc4bf2bbe277025 100644 (file)
@@ -29,7 +29,7 @@
 double
 __fma (double x, double y, double z)
 {
-  if (__builtin_expect (isinf (z), 0))
+  if (__glibc_unlikely (isinf (z)))
     {
       /* If z is Inf, but x and y are finite, the result should be
         z rather than NaN.  */
@@ -39,7 +39,7 @@ __fma (double x, double y, double z)
     }
 
   /* Ensure correct sign of exact 0 + 0.  */
-  if (__builtin_expect ((x == 0 || y == 0) && z == 0, 0))
+  if (__glibc_unlikely ((x == 0 || y == 0) && z == 0))
     return x * y + z;
 
   fenv_t env;
index 05643213548cd89ff117e55cd89f17e9ca3e10d5..4983eda9c698cffebc918dd115b1e2c2da3479e8 100644 (file)
@@ -176,7 +176,7 @@ __fmal (long double x, long double y, long double z)
     }
 
   /* Ensure correct sign of exact 0 + 0.  */
-  if (__builtin_expect ((x == 0 || y == 0) && z == 0, 0))
+  if (__glibc_unlikely ((x == 0 || y == 0) && z == 0))
     return x * y + z;
 
   fenv_t env;
@@ -218,7 +218,7 @@ __fmal (long double x, long double y, long double z)
   /* Perform m2 + a2 addition with round to odd.  */
   u.d = a2 + m2;
 
-  if (__builtin_expect (adjust == 0, 1))
+  if (__glibc_likely (adjust == 0))
     {
       if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7fff)
        u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
@@ -226,7 +226,7 @@ __fmal (long double x, long double y, long double z)
       /* Result is a1 + u.d.  */
       return a1 + u.d;
     }
-  else if (__builtin_expect (adjust > 0, 1))
+  else if (__glibc_likely (adjust > 0))
     {
       if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7fff)
        u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
index 27f264bb16960794c3b70698823c9dad5dabe562..0bb1399e971459b6ca9088cc7ab5d832a8354438 100644 (file)
@@ -30,7 +30,7 @@ static long int nsec;         /* Clock frequency of the processor.  */
 static int
 hp_timing_getres (struct timespec *res)
 {
-  if (__builtin_expect (nsec == 0, 0))
+  if (__glibc_unlikely (nsec == 0))
     {
       hp_timing_t freq;
 
@@ -39,7 +39,7 @@ hp_timing_getres (struct timespec *res)
         code against multiple execution since all of them should
         lead to the same result.  */
       freq = __get_clockfreq ();
-      if (__builtin_expect (freq == 0, 0))
+      if (__glibc_unlikely (freq == 0))
        /* Something went wrong.  */
        return -1;
 
@@ -60,7 +60,7 @@ realtime_getres (struct timespec *res)
 {
   long int clk_tck = sysconf (_SC_CLK_TCK);
 
-  if (__builtin_expect (clk_tck != -1, 1))
+  if (__glibc_likely (clk_tck != -1))
     {
       /* This implementation assumes that the realtime clock has a
         resolution higher than 1 second.  This is the case for any
index d8c6ec0513d750acdb37608fcad8c93b085021aa..4071996dcd6378ff091992469e6b3b6119350598 100644 (file)
@@ -31,7 +31,7 @@ __fdopendir (int fd)
 
   if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
     return NULL;
-  if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
+  if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
     {
       __set_errno (ENOTDIR);
       return NULL;
@@ -39,9 +39,9 @@ __fdopendir (int fd)
 
   /* Make sure the descriptor allows for reading.  */
   int flags = __fcntl (fd, F_GETFL);
-  if (__builtin_expect (flags == -1, 0))
+  if (__glibc_unlikely (flags == -1))
     return NULL;
-  if (__builtin_expect ((flags & O_ACCMODE) == O_WRONLY, 0))
+  if (__glibc_unlikely ((flags & O_ACCMODE) == O_WRONLY))
     {
       __set_errno (EINVAL);
       return NULL;
index 8218237af23c4b59282a52a89fcd11bf559b990c..e1a399b3ca49b3382d0d734a0813d11caeac6471 100644 (file)
@@ -471,7 +471,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
            bool malloc_namebuf = false;
            char *namebuf = (char *) name;
 
-           if (__builtin_expect (scope_delim != NULL, 0))
+           if (__glibc_unlikely (scope_delim != NULL))
              {
                if (malloc_name)
                  *scope_delim = '\0';
@@ -2608,7 +2608,7 @@ getaddrinfo (const char *name, const char *service,
         the information.  */
       struct sort_result_combo src
        = { .results = results, .nresults = nresults };
-      if (__builtin_expect (gaiconf_reload_flag_ever_set, 0))
+      if (__glibc_unlikely (gaiconf_reload_flag_ever_set))
        {
          __libc_lock_define_initialized (static, lock);
 
index e366701bd4d0f728870f3621eca93e81ff5dd94f..2740b3ac29ffffb26b282d8ba40b109be4747534 100644 (file)
@@ -110,7 +110,7 @@ __opendirat (int dfd, const char *name)
         performed on, say, a tape device might have undesirable effects.  */
       if (__builtin_expect (__xstat64 (_STAT_VER, name, &statbuf), 0) < 0)
        return NULL;
-      if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
+      if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
        {
          __set_errno (ENOTDIR);
          return NULL;
@@ -139,7 +139,7 @@ __opendirat (int dfd, const char *name)
         the `stat' call.  */
       if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
        goto lose;
-      if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
+      if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
        {
          __set_errno (ENOTDIR);
        lose:
index 4a72c275b33475039d6fe28235b80f8c49c04b22..d8b19099fdc15a4952848700ff03f5c340feedad 100644 (file)
@@ -33,7 +33,7 @@ unsigned int
 __sleep (unsigned int seconds)
 {
   /* This is not necessary but some buggy programs depend on it.  */
-  if (__builtin_expect (seconds == 0, 0))
+  if (__glibc_unlikely (seconds == 0))
     {
 #ifdef CANCELLATION_P
       CANCELLATION_P (THREAD_SELF);
index 1f86549df3cd2a4c50abd7e37554edd9d739c5ce..d21c0ccf0097253d60b67ac6dc171c35c05ba94e 100644 (file)
 # include <hp-timing.h>
 # if HP_TIMING_AVAIL
 #  define RANDOM_BITS(Var) \
-  if (__builtin_expect (value == UINT64_C (0), 0))                           \
+  if (__glibc_unlikely (value == UINT64_C (0)))                                      \
     {                                                                        \
       /* If this is the first time this function is used initialize          \
         the variable we accumulate the value in to some somewhat             \
index 16b786b72f795cc3dcee8001c50b3a9a58c6cd7b..9d6f56a37cc3229b865461363a124d1a15fed003 100644 (file)
@@ -39,7 +39,7 @@ elf_irela (const Elf32_Rela *reloc)
 {
   unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_PPC_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_PPC_IRELATIVE))
     {
       Elf32_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf32_Addr value = elf_ifunc_invoke(reloc->r_addend);
index 4b77966e77cb3bb0a5cbd573604096a8319e7a66..7ef1e3b4a6abd3f76e896c5bffd55724c78985a9 100644 (file)
@@ -442,19 +442,19 @@ __process_machine_rela (struct link_map *map,
       break;
 
     case R_PPC_ADDR24:
-      if (__builtin_expect (finaladdr > 0x01fffffc && finaladdr < 0xfe000000, 0))
+      if (__glibc_unlikely (finaladdr > 0x01fffffc && finaladdr < 0xfe000000))
        _dl_reloc_overflow (map,  "R_PPC_ADDR24", reloc_addr, refsym);
       *reloc_addr = (*reloc_addr & 0xfc000003) | (finaladdr & 0x3fffffc);
       break;
 
     case R_PPC_ADDR16:
-      if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0))
+      if (__glibc_unlikely (finaladdr > 0x7fff && finaladdr < 0xffff8000))
        _dl_reloc_overflow (map,  "R_PPC_ADDR16", reloc_addr, refsym);
       *(Elf32_Half*) reloc_addr = finaladdr;
       break;
 
     case R_PPC_UADDR16:
-      if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0))
+      if (__glibc_unlikely (finaladdr > 0x7fff && finaladdr < 0xffff8000))
        _dl_reloc_overflow (map,  "R_PPC_UADDR16", reloc_addr, refsym);
       ((union unaligned *) reloc_addr)->u2 = finaladdr;
       break;
@@ -474,7 +474,7 @@ __process_machine_rela (struct link_map *map,
     case R_PPC_ADDR14:
     case R_PPC_ADDR14_BRTAKEN:
     case R_PPC_ADDR14_BRNTAKEN:
-      if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0))
+      if (__glibc_unlikely (finaladdr > 0x7fff && finaladdr < 0xffff8000))
        _dl_reloc_overflow (map,  "R_PPC_ADDR14", reloc_addr, refsym);
       *reloc_addr = (*reloc_addr & 0xffff0003) | (finaladdr & 0xfffc);
       if (rinfo != R_PPC_ADDR14)
@@ -578,7 +578,7 @@ __process_machine_rela (struct link_map *map,
 
     inline void do_reloc16 (const char *r_name, Elf32_Addr value)
       {
-       if (__builtin_expect (value > 0x7fff && value < 0xffff8000, 0))
+       if (__glibc_unlikely (value > 0x7fff && value < 0xffff8000))
          _dl_reloc_overflow (map, r_name, reloc_addr, refsym);
        *(Elf32_Half *) reloc_addr = value;
       }
index 96d08c5d36deaceae956586501c30d38e997df00..23b610fbf16e3457089a6267522aea95ba472e37 100644 (file)
@@ -177,7 +177,7 @@ elf_machine_runtime_setup (struct link_map *map,
       extern void _dl_runtime_resolve (void);
       extern void _dl_prof_resolve (void);
 
-      if (__builtin_expect (!profile, 1))
+      if (__glibc_likely (!profile))
        dlrr = _dl_runtime_resolve;
       else
        {
@@ -287,7 +287,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
       return;
     }
 
-  if (__builtin_expect (r_type == R_PPC_NONE, 0))
+  if (__glibc_unlikely (r_type == R_PPC_NONE))
     return;
 
   /* binutils on ppc32 includes st_value in r_addend for relocations
index 8f834ce63bba2372762cc78d214623b12f22fbdf..ae9e1b696ce61abebbbf1503da4fcea79f1050e4 100644 (file)
@@ -40,13 +40,13 @@ elf_irela (const Elf64_Rela *reloc)
 {
   unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_PPC64_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_PPC64_IRELATIVE))
     {
       Elf64_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf64_Addr value = elf_ifunc_invoke(reloc->r_addend);
       *reloc_addr = value;
     }
-  else if (__builtin_expect (r_type == R_PPC64_JMP_IREL, 1))
+  else if (__glibc_likely (r_type == R_PPC64_JMP_IREL))
     {
       Elf64_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf64_Addr value = elf_ifunc_invoke(reloc->r_addend);
index dd44df5fa6d64866a28ee25b6c47eec68fca90d3..bc99183570c05dd96dbfd395b481eef000c9c4f9 100644 (file)
@@ -655,7 +655,7 @@ elf_machine_rela (struct link_map *map,
       return;
     }
 
-  if (__builtin_expect (r_type == R_PPC64_NONE, 0))
+  if (__glibc_unlikely (r_type == R_PPC64_NONE))
     return;
 
   /* We need SYM_MAP even in the absence of TLS, for elf_machine_fixup_plt
@@ -680,13 +680,13 @@ elf_machine_rela (struct link_map *map,
       return;
 
     case R_PPC64_IRELATIVE:
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = resolve_ifunc (value, map, sym_map);
       *reloc_addr = value;
       return;
 
     case R_PPC64_JMP_IREL:
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = resolve_ifunc (value, map, sym_map);
       /* Fall thru */
     case R_PPC64_JMP_SLOT:
index 302f1a785bcbe53b2076949e1759cdc8f81d869d..2202572973e933aac2c892ab86e57ae2f12ec7ee 100644 (file)
@@ -57,7 +57,7 @@ __aio_notify_only (struct sigevent *sigev)
   int result = 0;
 
   /* Send the signal to notify about finished processing of the request.  */
-  if (__builtin_expect (sigev->sigev_notify == SIGEV_THREAD, 0))
+  if (__glibc_unlikely (sigev->sigev_notify == SIGEV_THREAD))
     {
       /* We have to start a thread.  */
       pthread_t tid;
index b8f8a5b22a156b6ef9312e8ee037f2fad3cd8e96..e7b43ba5ac01ea80a1b04028015a4400243e8a23 100644 (file)
@@ -110,7 +110,7 @@ aio_suspend (list, nent, timeout)
      int nent;
      const struct timespec *timeout;
 {
-  if (__builtin_expect (nent < 0, 0))
+  if (__glibc_unlikely (nent < 0))
     {
       __set_errno (EINVAL);
       return -1;
@@ -229,7 +229,7 @@ aio_suspend (list, nent, timeout)
 
 #ifndef DONT_NEED_AIO_MISC_COND
   /* Release the conditional variable.  */
-  if (__builtin_expect (pthread_cond_destroy (&cond) != 0, 0))
+  if (__glibc_unlikely (pthread_cond_destroy (&cond) != 0))
     /* This must never happen.  */
     abort ();
 #endif
index 82d5e4c4a147f633bbc364316123295f5d8ffe38..401ee1c0c2a7fb2488eeaa948c7a0c7cd01bedcb 100644 (file)
@@ -40,7 +40,7 @@ elf_irela (const ElfW(Rela) *reloc)
   ElfW(Addr) *const reloc_addr = (void *) reloc->r_offset;
   const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_390_IRELATIVE))
     {
       ElfW(Addr) value = elf_ifunc_invoke(reloc->r_addend);
       *reloc_addr = value;
index 928581ed49e9d054161d6319803ec7cb2a0e0f0a..4fd2745801cba762aeea0d29e1ab6d0bb3662718 100644 (file)
@@ -114,7 +114,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
         to intercept the calls to collect information.  In this case we
         don't store the address in the GOT so that all future calls also
         end in this function.  */
-      if (__builtin_expect (profile, 0))
+      if (__glibc_unlikely (profile))
        {
          got[2] = (Elf32_Addr) &_dl_runtime_profile;
 
@@ -277,7 +277,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_390_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_390_RELATIVE))
     {
 # if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       /* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -295,7 +295,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
     }
   else
 #endif
-  if (__builtin_expect (r_type == R_390_NONE, 0))
+  if (__glibc_unlikely (r_type == R_390_NONE))
     return;
   else
     {
@@ -316,7 +316,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
        {
        case R_390_IRELATIVE:
          value = map->l_addr + reloc->r_addend;
-         if (__builtin_expect (!skip_ifunc, 1))
+         if (__glibc_likely (!skip_ifunc))
            value = elf_ifunc_invoke (value);
          *reloc_addr = value;
          break;
@@ -448,7 +448,7 @@ elf_machine_lazy_rel (struct link_map *map,
   Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
   /* Check for unexpected PLT reloc type.  */
-  if (__builtin_expect (r_type == R_390_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_390_JMP_SLOT))
     {
       if (__builtin_expect (map->l_mach.plt, 0) == 0)
        *reloc_addr += l_addr;
@@ -457,10 +457,10 @@ elf_machine_lazy_rel (struct link_map *map,
          map->l_mach.plt
          + (((Elf32_Addr) reloc_addr) - map->l_mach.gotplt) * 8;
     }
-  else if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+  else if (__glibc_likely (r_type == R_390_IRELATIVE))
     {
       Elf32_Addr value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = elf_ifunc_invoke (value);
       *reloc_addr = value;
     }
index e919223c6a970200622c23522124a05715d865db..2f3716987ca1bff3906ff103ba78f99294ce9e29 100644 (file)
@@ -103,7 +103,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
         to intercept the calls to collect information.  In this case we
         don't store the address in the GOT so that all future calls also
         end in this function.  */
-      if (__builtin_expect (profile, 0))
+      if (__glibc_unlikely (profile))
        {
          got[2] = (Elf64_Addr) &_dl_runtime_profile;
 
@@ -255,7 +255,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
   const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
 
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_390_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_390_RELATIVE))
     {
 # if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       /* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -273,7 +273,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
     }
   else
 #endif
-  if (__builtin_expect (r_type == R_390_NONE, 0))
+  if (__glibc_unlikely (r_type == R_390_NONE))
     return;
   else
     {
@@ -294,7 +294,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
        {
        case R_390_IRELATIVE:
          value = map->l_addr + reloc->r_addend;
-         if (__builtin_expect (!skip_ifunc, 1))
+         if (__glibc_likely (!skip_ifunc))
            value = elf_ifunc_invoke (value);
          *reloc_addr = value;
          break;
@@ -432,7 +432,7 @@ elf_machine_lazy_rel (struct link_map *map,
   Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
   /* Check for unexpected PLT reloc type.  */
-  if (__builtin_expect (r_type == R_390_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_390_JMP_SLOT))
     {
       if (__builtin_expect (map->l_mach.plt, 0) == 0)
        *reloc_addr += l_addr;
@@ -441,10 +441,10 @@ elf_machine_lazy_rel (struct link_map *map,
          map->l_mach.plt
          + (((Elf64_Addr) reloc_addr) - map->l_mach.gotplt) * 4;
     }
-  else if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+  else if (__glibc_likely (r_type == R_390_IRELATIVE))
     {
       Elf64_Addr value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = elf_ifunc_invoke (value);
       *reloc_addr = value;
     }
index f7d9e0795795f5414ac1a6823f8fb8ccef73cfd1..11a098fa99b33a83ebb77c5fbeec96ae37dc5a72 100644 (file)
@@ -54,7 +54,7 @@
       if (dir == to_utf16)                                             \
        {                                                               \
           /* Emit the UTF-16 Byte Order Mark.  */                      \
-          if (__builtin_expect (outbuf + 2 > outend, 0))               \
+          if (__glibc_unlikely (outbuf + 2 > outend))                        \
            return __GCONV_FULL_OUTPUT;                                 \
                                                                        \
          put16u (outbuf, BOM_UTF16);                                   \
@@ -63,7 +63,7 @@
       else                                                             \
        {                                                               \
           /* Emit the UTF-32 Byte Order Mark.  */                      \
-         if (__builtin_expect (outbuf + 4 > outend, 0))                \
+         if (__glibc_unlikely (outbuf + 4 > outend))                         \
            return __GCONV_FULL_OUTPUT;                                 \
                                                                        \
          put32u (outbuf, BOM_UTF32);                                   \
@@ -236,13 +236,13 @@ gconv_end (struct __gconv_step *data)
       {                                                                        \
         /* An isolated low-surrogate was found.  This has to be         \
           considered ill-formed.  */                                   \
-        if (__builtin_expect (u1 >= 0xdc00, 0))                                \
+        if (__glibc_unlikely (u1 >= 0xdc00))                                 \
          {                                                             \
            STANDARD_FROM_LOOP_ERR_HANDLER (2);                         \
          }                                                             \
        /* It's a surrogate character.  At least the first word says    \
           it is.  */                                                   \
-       if (__builtin_expect (inptr + 4 > inend, 0))                    \
+       if (__glibc_unlikely (inptr + 4 > inend))                             \
          {                                                             \
            /* We don't have enough input for another complete input    \
               character.  */                                           \
@@ -306,7 +306,7 @@ gconv_end (struct __gconv_step *data)
        uint16_t out;                                                   \
                                                                        \
        /* Generate a surrogate character.  */                          \
-       if (__builtin_expect (outptr + 4 > outend, 0))                  \
+       if (__glibc_unlikely (outptr + 4 > outend))                           \
          {                                                             \
            /* Overflow in the output buffer.  */                       \
            result = __GCONV_FULL_OUTPUT;                               \
index 863677455c1d3f4b0459ca71b02bd9b5bb2da7b6..74754211c1286b3b91403a50dc8e6bf62577a636 100644 (file)
@@ -50,7 +50,7 @@
       && data->__invocation_counter == 0)                              \
     {                                                                  \
       /* Emit the UTF-16 Byte Order Mark.  */                          \
-      if (__builtin_expect (outbuf + 2 > outend, 0))                   \
+      if (__glibc_unlikely (outbuf + 2 > outend))                            \
        return __GCONV_FULL_OUTPUT;                                     \
                                                                        \
       put16u (outbuf, BOM_UTF16);                                      \
@@ -197,7 +197,7 @@ gconv_end (struct __gconv_step *data)
              if ((inptr[i] & 0xc0) != 0x80)                            \
                break;                                                  \
                                                                \
-           if (__builtin_expect (inptr + i == inend, 1))               \
+           if (__glibc_likely (inptr + i == inend))                          \
              {                                                         \
                result = __GCONV_INCOMPLETE_INPUT;                      \
                break;                                                  \
@@ -210,7 +210,7 @@ gconv_end (struct __gconv_step *data)
     /* Next input byte.  */                                            \
     uint16_t ch = *inptr;                                              \
                                                                        \
-    if (__builtin_expect (ch < 0x80, 1))                               \
+    if (__glibc_likely (ch < 0x80))                                          \
       {                                                                        \
        /* One byte sequence.  */                                       \
        ++inptr;                                                        \
@@ -228,13 +228,13 @@ gconv_end (struct __gconv_step *data)
            cnt = 2;                                                    \
            ch &= 0x1f;                                                 \
          }                                                             \
-        else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))            \
+        else if (__glibc_likely ((ch & 0xf0) == 0xe0))                       \
          {                                                             \
            /* We expect three bytes.  */                               \
            cnt = 3;                                                    \
            ch &= 0x0f;                                                 \
          }                                                             \
-       else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))             \
+       else if (__glibc_likely ((ch & 0xf8) == 0xf0))                        \
          {                                                             \
            /* We expect four bytes.  */                                \
            cnt = 4;                                                    \
@@ -255,7 +255,7 @@ gconv_end (struct __gconv_step *data)
            STANDARD_FROM_LOOP_ERR_HANDLER (i);                         \
          }                                                             \
                                                                        \
-       if (__builtin_expect (inptr + cnt > inend, 0))                  \
+       if (__glibc_unlikely (inptr + cnt > inend))                           \
          {                                                             \
            /* We don't have enough input.  But before we report        \
               that check that all the bytes are correct.  */           \
@@ -263,7 +263,7 @@ gconv_end (struct __gconv_step *data)
              if ((inptr[i] & 0xc0) != 0x80)                            \
                break;                                                  \
                                                                        \
-           if (__builtin_expect (inptr + i == inend, 1))               \
+           if (__glibc_likely (inptr + i == inend))                          \
              {                                                         \
                result = __GCONV_INCOMPLETE_INPUT;                      \
                break;                                                  \
@@ -278,7 +278,7 @@ gconv_end (struct __gconv_step *data)
               low) are needed.  */                                     \
            uint16_t zabcd, high, low;                                  \
                                                                        \
-           if (__builtin_expect (outptr + 4 > outend, 0))              \
+           if (__glibc_unlikely (outptr + 4 > outend))                       \
              {                                                         \
                /* Overflow in the output buffer.  */                   \
                result = __GCONV_FULL_OUTPUT;                           \
@@ -368,7 +368,7 @@ gconv_end (struct __gconv_step *data)
                                                                        \
     uint16_t c = get16 (inptr);                                                \
                                                                        \
-    if (__builtin_expect (c <= 0x007f, 1))                             \
+    if (__glibc_likely (c <= 0x007f))                                        \
       {                                                                        \
        /* Single byte UTF-8 char.  */                                  \
        *outptr = c & 0xff;                                             \
@@ -378,7 +378,7 @@ gconv_end (struct __gconv_step *data)
       {                                                                        \
         /* Two byte UTF-8 char.  */                                    \
                                                                        \
-       if (__builtin_expect (outptr + 2 > outend, 0))                  \
+       if (__glibc_unlikely (outptr + 2 > outend))                           \
          {                                                             \
            /* Overflow in the output buffer.  */                       \
            result = __GCONV_FULL_OUTPUT;                               \
@@ -397,7 +397,7 @@ gconv_end (struct __gconv_step *data)
       {                                                                        \
        /* Three byte UTF-8 char.  */                                   \
                                                                        \
-       if (__builtin_expect (outptr + 3 > outend, 0))                  \
+       if (__glibc_unlikely (outptr + 3 > outend))                           \
          {                                                             \
            /* Overflow in the output buffer.  */                       \
            result = __GCONV_FULL_OUTPUT;                               \
@@ -419,14 +419,14 @@ gconv_end (struct __gconv_step *data)
         /* Four byte UTF-8 char.  */                                   \
        uint16_t low, uvwxy;                                            \
                                                                        \
-       if (__builtin_expect (outptr + 4 > outend, 0))                  \
+       if (__glibc_unlikely (outptr + 4 > outend))                           \
          {                                                             \
            /* Overflow in the output buffer.  */                       \
            result = __GCONV_FULL_OUTPUT;                               \
            break;                                                      \
          }                                                             \
        inptr += 2;                                                     \
-       if (__builtin_expect (inptr + 2 > inend, 0))                    \
+       if (__glibc_unlikely (inptr + 2 > inend))                             \
          {                                                             \
            result = __GCONV_INCOMPLETE_INPUT;                          \
            break;                                                      \
index 51208370377891751d4a2065f5676028f984e77a..cb74f34075f17a84649daa6f179754c6fda5e3b1 100644 (file)
@@ -52,7 +52,7 @@
       && data->__invocation_counter == 0)                              \
     {                                                                  \
       /* Emit the Byte Order Mark.  */                                 \
-      if (__builtin_expect (outbuf + 4 > outend, 0))                   \
+      if (__glibc_unlikely (outbuf + 4 > outend))                            \
        return __GCONV_FULL_OUTPUT;                                     \
                                                                        \
       put32u (outbuf, BOM);                                            \
@@ -201,7 +201,7 @@ gconv_end (struct __gconv_step *data)
              if ((inptr[i] & 0xc0) != 0x80)                            \
                break;                                                  \
                                                                        \
-           if (__builtin_expect (inptr + i == inend, 1))               \
+           if (__glibc_likely (inptr + i == inend))                          \
              {                                                         \
                result = __GCONV_INCOMPLETE_INPUT;                      \
                break;                                                  \
@@ -214,7 +214,7 @@ gconv_end (struct __gconv_step *data)
     /* Next input byte.  */                                            \
     uint32_t ch = *inptr;                                              \
                                                                        \
-    if (__builtin_expect (ch < 0x80, 1))                               \
+    if (__glibc_likely (ch < 0x80))                                          \
       {                                                                        \
        /* One byte sequence.  */                                       \
        ++inptr;                                                        \
@@ -232,25 +232,25 @@ gconv_end (struct __gconv_step *data)
            cnt = 2;                                                    \
            ch &= 0x1f;                                                 \
          }                                                             \
-        else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))            \
+        else if (__glibc_likely ((ch & 0xf0) == 0xe0))                       \
          {                                                             \
            /* We expect three bytes.  */                               \
            cnt = 3;                                                    \
            ch &= 0x0f;                                                 \
          }                                                             \
-       else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))             \
+       else if (__glibc_likely ((ch & 0xf8) == 0xf0))                        \
          {                                                             \
            /* We expect four bytes.  */                                \
            cnt = 4;                                                    \
            ch &= 0x07;                                                 \
          }                                                             \
-       else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1))             \
+       else if (__glibc_likely ((ch & 0xfc) == 0xf8))                        \
          {                                                             \
            /* We expect five bytes.  */                                \
            cnt = 5;                                                    \
            ch &= 0x03;                                                 \
          }                                                             \
-       else if (__builtin_expect ((ch & 0xfe) == 0xfc, 1))             \
+       else if (__glibc_likely ((ch & 0xfe) == 0xfc))                        \
          {                                                             \
            /* We expect six bytes.  */                                 \
            cnt = 6;                                                    \
@@ -271,7 +271,7 @@ gconv_end (struct __gconv_step *data)
            STANDARD_FROM_LOOP_ERR_HANDLER (i);                         \
          }                                                             \
                                                                        \
-       if (__builtin_expect (inptr + cnt > inend, 0))                  \
+       if (__glibc_unlikely (inptr + cnt > inend))                           \
          {                                                             \
            /* We don't have enough input.  But before we report        \
               that check that all the bytes are correct.  */           \
@@ -279,7 +279,7 @@ gconv_end (struct __gconv_step *data)
              if ((inptr[i] & 0xc0) != 0x80)                            \
                break;                                                  \
                                                                        \
-           if (__builtin_expect (inptr + i == inend, 1))               \
+           if (__glibc_likely (inptr + i == inend))                          \
              {                                                         \
                result = __GCONV_INCOMPLETE_INPUT;                      \
                break;                                                  \
@@ -338,19 +338,19 @@ gconv_end (struct __gconv_step *data)
        cnt = 2;                                                              \
        ch &= 0x1f;                                                           \
       }                                                                              \
-    else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1))                              \
+    else if (__glibc_likely ((ch & 0xf0) == 0xe0))                           \
       {                                                                              \
        /* We expect three bytes.  */                                         \
        cnt = 3;                                                              \
        ch &= 0x0f;                                                           \
       }                                                                              \
-    else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1))                              \
+    else if (__glibc_likely ((ch & 0xf8) == 0xf0))                           \
       {                                                                              \
        /* We expect four bytes.  */                                          \
        cnt = 4;                                                              \
        ch &= 0x07;                                                           \
       }                                                                              \
-    else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1))                              \
+    else if (__glibc_likely ((ch & 0xfc) == 0xf8))                           \
       {                                                                              \
        /* We expect five bytes.  */                                          \
        cnt = 5;                                                              \
@@ -431,7 +431,7 @@ gconv_end (struct __gconv_step *data)
                                                                \
     uint32_t wc = *((const uint32_t *) inptr);                 \
                                                                \
-    if (__builtin_expect (wc <= 0x7f, 1))                      \
+    if (__glibc_likely (wc <= 0x7f))                                         \
       {                                                                \
         /* Single UTF-8 char.  */                              \
         *outptr = (uint8_t)wc;                                 \
@@ -440,7 +440,7 @@ gconv_end (struct __gconv_step *data)
     else if (wc <= 0x7ff)                                      \
       {                                                                \
         /* Two UTF-8 chars.  */                                        \
-        if (__builtin_expect (outptr + 2 > outend, 0))         \
+        if (__glibc_unlikely (outptr + 2 > outend))                          \
          {                                                     \
            /* Overflow in the output buffer.  */               \
            result = __GCONV_FULL_OUTPUT;                       \
@@ -458,7 +458,7 @@ gconv_end (struct __gconv_step *data)
     else if (wc <= 0xffff)                                     \
       {                                                                \
        /* Three UTF-8 chars.  */                               \
-       if (__builtin_expect (outptr + 3 > outend, 0))          \
+       if (__glibc_unlikely (outptr + 3 > outend))                           \
          {                                                     \
            /* Overflow in the output buffer.  */               \
            result = __GCONV_FULL_OUTPUT;                       \
@@ -478,7 +478,7 @@ gconv_end (struct __gconv_step *data)
       else if (wc <= 0x10ffff)                                 \
        {                                                       \
          /* Four UTF-8 chars.  */                              \
-         if (__builtin_expect (outptr + 4 > outend, 0))        \
+         if (__glibc_unlikely (outptr + 4 > outend))                         \
            {                                                   \
              /* Overflow in the output buffer.  */             \
              result = __GCONV_FULL_OUTPUT;                     \
index 5e5fd6cc798176d61004218e8db7410a3c0cec2f..4f3db89ed3dafa2642a4430304300f39d1d1c2ba 100644 (file)
@@ -291,7 +291,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
     } \
   }
 
-  if (__builtin_expect (r_type == R_SH_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_SH_RELATIVE))
     {
 #ifndef RTLD_BOOTSTRAP
       if (map != &GL(dl_rtld_map)) /* Already done in rtld itself.      */
@@ -310,7 +310,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
        }
     }
 #ifndef RTLD_BOOTSTRAP
-  else if (__builtin_expect (r_type == R_SH_NONE, 0))
+  else if (__glibc_unlikely (r_type == R_SH_NONE))
     return;
 #endif
   else
index 03441ec4a587f5465d1942689dcbff28862259e1..5b61e0a24eff3dc840316701a87d186264479968 100644 (file)
@@ -40,13 +40,13 @@ elf_irela (const Elf32_Rela *reloc)
 {
   unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_SPARC_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_SPARC_IRELATIVE))
     {
       Elf32_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf32_Addr value = elf_ifunc_invoke(reloc->r_addend);
       *reloc_addr = value;
     }
-  else if (__builtin_expect (r_type == R_SPARC_JMP_IREL, 1))
+  else if (__glibc_likely (r_type == R_SPARC_JMP_IREL))
     {
       Elf32_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf32_Addr value = elf_ifunc_invoke(reloc->r_addend);
index 91b125dd7a49d30eeb5e36eb5dc10f54a1c0d062..e7d31b40b67ff3ca416be5805cc469bb11cc8eb7 100644 (file)
@@ -350,17 +350,17 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
   weak_extern (_dl_rtld_map);
 #endif
 
-  if (__builtin_expect (r_type == R_SPARC_NONE, 0))
+  if (__glibc_unlikely (r_type == R_SPARC_NONE))
     return;
 
-  if (__builtin_expect (r_type == R_SPARC_SIZE32, 0))
+  if (__glibc_unlikely (r_type == R_SPARC_SIZE32))
     {
       *reloc_addr = sym->st_size + reloc->r_addend;
       return;
     }
 
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_SPARC_RELATIVE))
     {
 # if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       if (map != &_dl_rtld_map) /* Already done in rtld itself. */
@@ -549,12 +549,12 @@ elf_machine_lazy_rel (struct link_map *map,
   Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_SPARC_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_SPARC_JMP_SLOT))
     ;
   else if (r_type == R_SPARC_JMP_IREL)
     {
       Elf32_Addr value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
       sparc_fixup_plt (reloc, reloc_addr, value, 1, 1);
     }
index 85b36cd06670e94bcdbcc692ec58e51bd7929fbc..9aae20a40d5edfa8daf84fd86269ac6ef654c2be 100644 (file)
@@ -40,13 +40,13 @@ elf_irela (const Elf64_Rela *reloc)
 {
   unsigned int r_type = (reloc->r_info & 0xff);
 
-  if (__builtin_expect (r_type == R_SPARC_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_SPARC_IRELATIVE))
     {
       Elf64_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf64_Addr value = elf_ifunc_invoke(reloc->r_addend);
       *reloc_addr = value;
     }
-  else if (__builtin_expect (r_type == R_SPARC_JMP_IREL, 1))
+  else if (__glibc_likely (r_type == R_SPARC_JMP_IREL))
     {
       Elf64_Addr *const reloc_addr = (void *) reloc->r_offset;
       Elf64_Addr value = elf_ifunc_invoke(reloc->r_addend);
index b285402257ce9013294098e6023920c1985955be..ef4ad4ce9e8367d918098483ce1c2ab91a0904a8 100644 (file)
@@ -377,17 +377,17 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
   weak_extern (_dl_rtld_map);
 #endif
 
-  if (__builtin_expect (r_type == R_SPARC_NONE, 0))
+  if (__glibc_unlikely (r_type == R_SPARC_NONE))
     return;
 
-  if (__builtin_expect (r_type == R_SPARC_SIZE64, 0))
+  if (__glibc_unlikely (r_type == R_SPARC_SIZE64))
     {
       *reloc_addr = sym->st_size + reloc->r_addend;
       return;
     }
 
 #if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_SPARC_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_SPARC_RELATIVE))
     {
 # if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       if (map != &_dl_rtld_map) /* Already done in rtld itself. */
@@ -652,13 +652,13 @@ elf_machine_lazy_rel (struct link_map *map,
   Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
   const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_SPARC_JMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_SPARC_JMP_SLOT))
     ;
   else if (r_type == R_SPARC_JMP_IREL
           || r_type == R_SPARC_IRELATIVE)
     {
       Elf64_Addr value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
       if (r_type == R_SPARC_JMP_IREL)
        {
index be1927b3036369d3b444059447304ffacf273016..82bc18601dca41f823ad87a007407a2e04c6bbdd 100644 (file)
@@ -115,7 +115,7 @@ sparc64_fixup_plt (struct link_map *map, const Elf64_Rela *reloc,
       /* ??? Some tricks can be stolen from the sparc64 egcs backend
             constant formation code I wrote.  -DaveM  */
 
-      if (__builtin_expect (high32 & 0x3ff, 0))
+      if (__glibc_unlikely (high32 & 0x3ff))
        {
          /* sethi      %hh(value), %g1
             sethi      %lm(value), %g5
index 4a1e5b61c672ebb35e50c4104d08572eb16d6f5e..d4ca6974444ac38837d82005bc7940e7b574917e 100644 (file)
@@ -41,14 +41,14 @@ hp_timing_gettime (clockid_t clock_id, struct timespec *tp)
 {
   hp_timing_t tsc;
 
-  if (__builtin_expect (freq == 0, 0))
+  if (__glibc_unlikely (freq == 0))
     {
       /* This can only happen if we haven't initialized the `freq'
         variable yet.  Do this now. We don't have to protect this
         code against multiple execution since all of them should
         lead to the same result.  */
       freq = __get_clockfreq ();
-      if (__builtin_expect (freq == 0, 0))
+      if (__glibc_unlikely (freq == 0))
        /* Something went wrong.  */
        return -1;
     }
index f3c67ef8c9dd1fbb8bbdd81b75a264c1f5587938..7ce6dfc1f2020491e4154b11d4f34ca844ce557c 100644 (file)
@@ -43,14 +43,14 @@ hp_timing_settime (clockid_t clock_id, const struct timespec *tp)
   /* First thing is to get the current time.  */
   HP_TIMING_NOW (tsc);
 
-  if (__builtin_expect (freq == 0, 0))
+  if (__glibc_unlikely (freq == 0))
     {
       /* This can only happen if we haven't initialized the `freq'
         variable yet.  Do this now. We don't have to protect this
         code against multiple execution since all of them should lead
         to the same result.  */
       freq = __get_clockfreq ();
-      if (__builtin_expect (freq == 0, 0))
+      if (__glibc_unlikely (freq == 0))
        /* Something went wrong.  */
        return -1;
     }
index 602dfb623ae91b7566209b4ebf88971b1f29cad5..c4f067f036c5ae2d4d63bd3f6fdc51180311fec8 100644 (file)
@@ -108,7 +108,7 @@ grantpt (int fd)
   char *buf = _buf;
   struct stat64 st;
 
-  if (__builtin_expect (pts_name (fd, &buf, sizeof (_buf), &st), 0))
+  if (__glibc_unlikely (pts_name (fd, &buf, sizeof (_buf), &st)))
     {
       int save_errno = errno;
 
@@ -136,7 +136,7 @@ grantpt (int fd)
     }
 
   static int tty_gid = -1;
-  if (__builtin_expect (tty_gid == -1, 0))
+  if (__glibc_unlikely (tty_gid == -1))
     {
       char *grtmpbuf;
       struct group grbuf;
index 0e2113434ab7e36e8f3fe0ff71c71678310a6d9b..019e96b6778a4056d623aa29715a8bb7188379a7 100644 (file)
@@ -52,7 +52,7 @@ static int have_accept4;
 int
 accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
 {
-  if (__builtin_expect (have_accept4 >= 0, 1))
+  if (__glibc_likely (have_accept4 >= 0))
     {
       int ret = __internal_accept4 (fd, addr, addr_len, flags);
       /* The kernel returns -EINVAL for unknown socket operations.
index 45d46806450c38ff8e37d35fc1aa1be364a4c2da..be49911eeb8e9024a512b11179da8e86a6987750 100644 (file)
@@ -83,7 +83,7 @@ ADJTIME (const struct TIMEVAL *itv, struct TIMEVAL *otv)
 #if defined ADJ_OFFSET_SS_READ && !defined __ASSUME_ADJ_OFFSET_SS_READ
  again:
 #endif
-  if (__builtin_expect (ADJTIMEX (&tntx) < 0, 0))
+  if (__glibc_unlikely (ADJTIMEX (&tntx) < 0))
     {
 #if defined ADJ_OFFSET_SS_READ && !defined __ASSUME_ADJ_OFFSET_SS_READ
       if (itv && errno == EINVAL && tntx.modes == ADJ_OFFSET_SS_READ)
index dd333b4a94d4c94346fb5bf0e5bcdec0140000d6..5c8e75affc5a65d9febdb8ca470dd5eaa12dd8ae 100644 (file)
@@ -331,7 +331,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
     {
       int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
 
-      if (__builtin_expect (fd >= 0, 1))
+      if (__glibc_likely (fd >= 0))
        {
          struct sockaddr_nl nladdr;
          memset (&nladdr, '\0', sizeof (nladdr));
index 6608e6adb3075ba5230d927253afedb07b5c483b..af1343822fbb0bd9ef0a5a1685d1d96f8111adb9 100644 (file)
@@ -33,7 +33,7 @@
        if the library is not compiled to run on all kernels.  */             \
                                                                              \
     int version = _dl_discover_osversion ();                                 \
-    if (__builtin_expect (version >= 0, 1))                                  \
+    if (__glibc_likely (version >= 0))                                       \
       {                                                                              \
        if (__builtin_expect (GLRO(dl_osversion) == 0, 1)                     \
            || GLRO(dl_osversion) > version)                                  \
@@ -58,7 +58,7 @@ _dl_setup_stack_chk_guard (void *dl_random)
   } ret;
 
 #ifndef __ASSUME_AT_RANDOM
-  if (__builtin_expect (dl_random == NULL, 0))
+  if (__glibc_unlikely (dl_random == NULL))
     {
       const size_t filllen = sizeof (ret.bytes) - 1;
       ret.num = 0;
index 06abac278dc23017c9273a1f34e3ac0c0aa0687c..c00f431a45b86f5c10e910861395a6b351eae57a 100644 (file)
@@ -71,7 +71,7 @@ faccessat (fd, file, mode, flag)
       if (fd != AT_FDCWD && file[0] != '/')
        {
          size_t filelen = strlen (file);
-         if (__builtin_expect (filelen == 0, 0))
+         if (__glibc_unlikely (filelen == 0))
            {
              __set_errno (ENOENT);
              return -1;
@@ -102,7 +102,7 @@ faccessat (fd, file, mode, flag)
 # endif
        result = INTERNAL_SYSCALL (access, err, 2, file, mode);
 
-      if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+      if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
        {
          __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
          result = -1;
index 803988d88c6b7dbe701312c163871c19795a2714..4d3e43e371860bfd7203f0801dc6128edf421369 100644 (file)
@@ -70,7 +70,7 @@ fchmodat (fd, file, mode, flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -100,7 +100,7 @@ fchmodat (fd, file, mode, flag)
 # endif
     result = INTERNAL_SYSCALL (chmod, err, 2, file, mode);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       result = -1;
index b0329cd2c26c00cb018749caee280905314e0613..196b8005c3a39a174564d662df1ce08689d5894f 100644 (file)
@@ -65,7 +65,7 @@ fchownat (fd, file, owner, group, flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -93,7 +93,7 @@ fchownat (fd, file, owner, group, flag)
   else
     result = INTERNAL_SYSCALL (chown, err, 3, file, owner, group);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       result = -1;
index ce7290e0f3fc20992be0a692c2827d20d8250d67..89ea20b121971674662167f85bc15d7175216ade 100644 (file)
@@ -75,7 +75,7 @@ futimesat (fd, file, tvp)
   else if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -100,7 +100,7 @@ futimesat (fd, file, tvp)
 
 # ifdef __NR_utimes
   result = INTERNAL_SYSCALL (utimes, err, 2, file, tvp);
-  if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+  if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result, err)))
     return result;
 
 #  ifndef __ASSUME_UTIMES
@@ -126,7 +126,7 @@ futimesat (fd, file, tvp)
     times = NULL;
 
   result = INTERNAL_SYSCALL (utime, err, 2, file, times);
-  if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+  if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result, err)))
     return result;
 
  fail:
index 9acbf36a9bb990d9c96668a95694c0e1e7546a6f..1ec0922350fda32f6aaa48c51767ecef81792199 100644 (file)
@@ -84,7 +84,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -114,7 +114,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
        result = INTERNAL_SYSCALL (stat, err, 2, file,
                                   (struct kernel_stat *) st);
 
-      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+      if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result, err)))
        return result;
     }
 #ifdef STAT_IS_KERNEL_STAT
@@ -129,7 +129,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   else
     result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
 
-  if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+  if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result, err)))
     return __xstat_conv (vers, &kst, st);
 #endif
 
index b6195c877aa5a2c5afc315d94146d882131127e2..24bd51bf466dfad3b0277503fad6f5d677c7c254 100644 (file)
@@ -33,7 +33,7 @@
 int
 __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
 {
-  if (__builtin_expect (vers != _STAT_VER_LINUX, 0))
+  if (__glibc_unlikely (vers != _STAT_VER_LINUX))
     {
       __set_errno (EINVAL);
       return -1;
@@ -76,7 +76,7 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -101,7 +101,7 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
     result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
   else
     result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
-  if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+  if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
 # if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
       if (st->__st_ino != (__ino_t) st->st_ino)
index 00fc6f3b7669a24620585f81c940f309c75c8083..3a4299ee29326d5a216106c88583b5d28692fc72 100644 (file)
@@ -40,7 +40,7 @@ fallocate (int fd, int mode, __off_t offset, __off_t len)
 
       LIBC_CANCEL_RESET (oldtype);
     }
-  if (__builtin_expect (err, 0))
+  if (__glibc_unlikely (err))
     {
       __set_errno (err);
       err = -1;
index 14c304877dcb03ff0456fac1610d1a3073948e19..d69021b63315c6ed1a0b51c37057dc47e4e114c2 100644 (file)
@@ -40,7 +40,7 @@ fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 
       LIBC_CANCEL_RESET (oldtype);
     }
-  if (__builtin_expect (err, 0))
+  if (__glibc_unlikely (err))
     {
       __set_errno (err);
       err = -1;
index 7726bb6f72dab077164c654f929f929d8d0bc072..5c2359c8b5cd018908fa1ed2346c6cc75d491b33 100644 (file)
@@ -61,7 +61,7 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -89,7 +89,7 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
   else
     result = INTERNAL_SYSCALL (chown32, err, 3, file, owner, group);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       return -1;
index 4180947dcae5e8fc6b1cd8ec215038871ad77ad3..8fdbbb81f55331942b4654e806d51d4d3a4928b7 100644 (file)
@@ -66,7 +66,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 #endif
 
 #ifndef __ASSUME_ATFCTS
-  if (__builtin_expect (flag & ~AT_SYMLINK_NOFOLLOW, 0))
+  if (__glibc_unlikely (flag & ~AT_SYMLINK_NOFOLLOW))
     {
       __set_errno (EINVAL);
       return -1;
@@ -77,7 +77,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -113,11 +113,11 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
     result = INTERNAL_SYSCALL (lstat64, err, 2, file, &st64);
   else
     result = INTERNAL_SYSCALL (stat64, err, 2, file, &st64);
-  if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+  if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result, err)))
     return __xstat32_conv (vers, &st64, st);
 
  out:
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       result = -1;
index 9555c26580874d80f02d546cbb602ead2ffd4767..024d4d010878235ef3be17d223ac3e88a386ce6f 100644 (file)
@@ -40,7 +40,7 @@ __get_clockfreq (void)
     return result;
 
   fd = __open ("/proc/cpuinfo", O_RDONLY);
-  if (__builtin_expect (fd != -1, 1))
+  if (__glibc_likely (fd != -1))
     {
       /* XXX AFAIK the /proc filesystem can generate "files" only up
          to a size of 4096 bytes.  */
@@ -52,7 +52,7 @@ __get_clockfreq (void)
        {
          char *mhz = memmem (buf, n, "cpu MHz", 7);
 
-         if (__builtin_expect (mhz != NULL, 1))
+         if (__glibc_likely (mhz != NULL))
            {
              char *endp = buf + n;
              int seen_decpoint = 0;
index bcadf8ddfba848b7f333aa7e8a2580dba2a6c045..f532898e5b181c58cec78581e5e5711be1b6e7fe 100644 (file)
@@ -36,7 +36,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
 # ifndef __ASSUME_FALLOCATE
-  if (__builtin_expect (__have_fallocate >= 0, 1))
+  if (__glibc_likely (__have_fallocate >= 0))
 # endif
     {
       int res = __call_fallocate (fd, 0, offset, len);
@@ -44,7 +44,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
        return 0;
 
 # ifndef __ASSUME_FALLOCATE
-      if (__builtin_expect (res == ENOSYS, 0))
+      if (__glibc_unlikely (res == ENOSYS))
        __have_fallocate = -1;
       else
 # endif
index 4fa61e8110efda87cce800299057d344188a3364..1aa1fcf316d9673a1f8ef919dff72a199c5256a5 100644 (file)
@@ -38,7 +38,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
 # ifndef __ASSUME_FALLOCATE
-  if (__builtin_expect (__have_fallocate >= 0, 1))
+  if (__glibc_likely (__have_fallocate >= 0))
 # endif
     {
       int res = __call_fallocate (fd, 0, offset, len);
@@ -47,7 +47,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
        return 0;
 
 # ifndef __ASSUME_FALLOCATE
-      if (__builtin_expect (res == ENOSYS, 0))
+      if (__glibc_unlikely (res == ENOSYS))
        __have_fallocate = -1;
       else
 # endif
index 90abe32a2bc237652c6ae53836e3d90bcbe99ca3..2782eeb04e2817fb18a0314e3ebab208c197f619 100644 (file)
@@ -85,7 +85,7 @@ __old_scandir64 (dir, namelist, select, cmp)
          /* Ignore errors from select or readdir */
          __set_errno (0);
 
-         if (__builtin_expect (c.cnt == vsize, 0))
+         if (__glibc_unlikely (c.cnt == vsize))
            {
              struct __old_dirent64 **new;
              if (vsize == 0)
index 01888e9ce418ee008ffd235005ec41b4c1186e1f..54f87c9f7143ac0be3eac6254cba0d6d1d2f60bb 100644 (file)
@@ -310,7 +310,7 @@ asm (".L__X'%ebx = 1\n\t"
 #define INLINE_SYSCALL(name, nr, args...) \
   ({                                                                         \
     unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);            \
-    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))        \
+    if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))           \
       {                                                                              \
        __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
        resultvar = 0xffffffff;                                               \
index 7b8867100f4363d1f04058e14206ce048c24f889..d83e8f8e841754b4b54e82b59e5d465016506127 100644 (file)
@@ -175,7 +175,7 @@ __netlink_request (struct netlink_handle *h, int type)
       if (nladdr.nl_pid != 0)
        continue;
 
-      if (__builtin_expect (msg.msg_flags & MSG_TRUNC, 0))
+      if (__glibc_unlikely (msg.msg_flags & MSG_TRUNC))
        goto out_fail;
 
       size_t count = 0;
@@ -459,7 +459,7 @@ getifaddrs_internal (struct ifaddrs **ifap)
                 kernel.  */
              ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
                                       map_newlink_data, newlink);
-             if (__builtin_expect (ifa_index == -1, 0))
+             if (__glibc_unlikely (ifa_index == -1))
                {
                try_again:
                  result = -EAGAIN;
@@ -552,7 +552,7 @@ getifaddrs_internal (struct ifaddrs **ifap)
              ifa_index = newlink + newaddr_idx;
              int idx = map_newlink (ifam->ifa_index - 1, ifas,
                                     map_newlink_data, newlink);
-             if (__builtin_expect (idx == -1, 0))
+             if (__glibc_unlikely (idx == -1))
                goto try_again;
              ifas[ifa_index].ifa.ifa_flags = ifas[idx].ifa.ifa_flags;
              if (ifa_index > 0)
@@ -737,7 +737,7 @@ getifaddrs_internal (struct ifaddrs **ifap)
                {
                  int idx = map_newlink (ifam->ifa_index - 1, ifas,
                                         map_newlink_data, newlink);
-                 if (__builtin_expect (idx == -1, 0))
+                 if (__glibc_unlikely (idx == -1))
                    goto try_again;
                  ifas[ifa_index].ifa.ifa_name = ifas[idx].ifa.ifa_name;
                }
index ad09be64b3bcf0828fb5cd2bdbcab00d7b7d6800..29cefb81926c09f3c35c85c131e263e0d9eb4b9d 100644 (file)
@@ -65,7 +65,7 @@ linkat (fromfd, from, tofd, to, flags)
   if (fromfd != AT_FDCWD && from[0] != '/')
     {
       size_t filelen = strlen (from);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -108,7 +108,7 @@ linkat (fromfd, from, tofd, to, flags)
 
   result = INTERNAL_SYSCALL (link, err, 2, from,  to);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno_2 (INTERNAL_SYSCALL_ERRNO (result, err), tofd, bufto,
                          fromfd, buffrom);
index 72d69c58f3863bf776ad95423dea013cd24b7692..77099f353301a8fa90bfff6d495bc7e4c96b70a8 100644 (file)
@@ -56,7 +56,7 @@ mkdirat (fd, file, mode)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -80,7 +80,7 @@ mkdirat (fd, file, mode)
   INTERNAL_SYSCALL_DECL (err);
   res = INTERNAL_SYSCALL (mkdir, err, 2, file, mode);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (res, err), fd, buf);
       res = -1;
index e16e4184fd29c24d8f2370075829b6f79f724549..c5f12d8a7bad3c359bf5a399e52f26fa3131e05a 100644 (file)
@@ -36,7 +36,7 @@ mq_unlink (const char *name)
 
   /* While unlink can return either EPERM or EACCES, mq_unlink should
      return just EACCES.  */
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (ret, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (ret, err)))
     {
       ret = INTERNAL_SYSCALL_ERRNO (ret, err);
       if (ret == EPERM)
index 9bb8acec1fa6cc41aff6ebadbb8ce4ebaece5588..2cf233b8de6f7ddad82d74c5830c007360b80582 100644 (file)
@@ -108,7 +108,7 @@ OPENAT_NOT_CANCEL (fd, file, oflag, mode)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -132,7 +132,7 @@ OPENAT_NOT_CANCEL (fd, file, oflag, mode)
 
   res = INTERNAL_SYSCALL (open, err, 3, file, oflag, mode);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (res, err), fd, buf);
       res = -1;
index 477f9f85745a839ec1f4c4c876c28dc8bb2643f9..cb75ffc1fa24b3d4cc6dfd60370790f384e4273f 100644 (file)
@@ -34,7 +34,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
 # ifndef __ASSUME_FALLOCATE
-  if (__builtin_expect (__have_fallocate >= 0, 1))
+  if (__glibc_likely (__have_fallocate >= 0))
 # endif
     {
       INTERNAL_SYSCALL_DECL (err);
@@ -46,7 +46,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
        return 0;
 
 # ifndef __ASSUME_FALLOCATE
-      if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0))
+      if (__glibc_unlikely (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS))
        __have_fallocate = -1;
       else
 # endif
index 73983aed5b99c286b32c9588d070394600a489f2..4f5881b96ce2b860e0e1f09947e976a17847b581 100644 (file)
@@ -36,7 +36,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
 # ifndef __ASSUME_FALLOCATE
-  if (__builtin_expect (__have_fallocate >= 0, 1))
+  if (__glibc_likely (__have_fallocate >= 0))
 # endif
     {
       INTERNAL_SYSCALL_DECL (err);
@@ -50,7 +50,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
        return 0;
 
 # ifndef __ASSUME_FALLOCATE
-      if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0))
+      if (__glibc_unlikely (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS))
        __have_fallocate = -1;
       else
 # endif
index 61e0a4dc56754c8eb55b1c69b6ccd7bdc37821f5..4e3767a6a04f84bd510d826dc65b37033053d5c3 100644 (file)
@@ -65,7 +65,7 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -93,7 +93,7 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
   else
     result = INTERNAL_SYSCALL (chown, err, 3, file, owner, group);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       return -1;
index 0a6aa81fb02040f79275210d6b03bf06e6b55a9a..8b37943863eb748d6f5de2b006c3b158fd0a1da7 100644 (file)
@@ -49,7 +49,7 @@ __get_clockfreq (void)
     {
       int fd = __open ("/proc/cpuinfo", O_RDONLY);
 
-      if (__builtin_expect (fd != -1, 1))
+      if (__glibc_likely (fd != -1))
        {
          /* The timebase will be in the 1st 1024 bytes for systems with up
             to 8 processors.  If the first read returns less then 1024
@@ -87,7 +87,7 @@ __get_clockfreq (void)
            {
              char *mhz = memmem (buf, n, "timebase", 7);
 
-             if (__builtin_expect (mhz != NULL, 1))
+             if (__glibc_likely (mhz != NULL))
                {
                  char *endp = buf + n;
 
index 8fbbd414ac1b0dad6fed2320f2f69fb1a0a1e0c2..7d096d3c36470ad8fb0f4f3667077b310b358396 100644 (file)
@@ -58,7 +58,7 @@ readlinkat (fd, path, buf, len)
   if (fd != AT_FDCWD && path[0] != '/')
     {
       size_t pathlen = strlen (path);
-      if (__builtin_expect (pathlen == 0, 0))
+      if (__glibc_unlikely (pathlen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -83,7 +83,7 @@ readlinkat (fd, path, buf, len)
 
   result = INTERNAL_SYSCALL (readlink, err, 3, path, buf, len);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, pathbuf);
       result = -1;
index bcb9a6cf5c3d7a8932135af80ba386e57cf25ade..04ff42ee72716a8a7bff15c23b1503cdae6fd252 100644 (file)
@@ -53,7 +53,7 @@ int
 recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
          const struct timespec *tmo)
 {
-  if (__builtin_expect (have_recvmmsg >= 0, 1))
+  if (__glibc_likely (have_recvmmsg >= 0))
     {
       int ret = __internal_recvmmsg (fd, vmessages, vlen, flags, tmo);
       /* The kernel returns -EINVAL for unknown socket operations.
index 8addae2d57753af15dd7df9f07c0295509f24fd2..dbc4c75c01d67227d8256d9dd368b7bf14b03816 100644 (file)
@@ -134,7 +134,7 @@ renameat (oldfd, old, newfd, new)
   if (oldfd != AT_FDCWD && old[0] != '/')
     {
       size_t filelen = strlen (old);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -159,7 +159,7 @@ renameat (oldfd, old, newfd, new)
   if (newfd != AT_FDCWD && new[0] != '/')
     {
       size_t filelen = strlen (new);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -183,7 +183,7 @@ renameat (oldfd, old, newfd, new)
 
   result = INTERNAL_SYSCALL (rename, err, 2, old,  new);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno_2 (INTERNAL_SYSCALL_ERRNO (result, err), newfd, bufnew,
                          oldfd, bufold);
index fa7c8c50e5cf3c286ade55cb08a66679cb8c499b..1c6191b261ae3444f244966ba9c34287495c51ad 100644 (file)
 #define INLINE_SYSCALL(name, nr, args...)                                    \
   ({                                                                         \
     unsigned int _ret = INTERNAL_SYSCALL (name, , nr, args);                 \
-    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_ret, ), 0))             \
+    if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (_ret, )))                \
      {                                                                       \
        __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));                        \
        _ret = 0xffffffff;                                                    \
index 020cd9ad4514b892d7cd17f75e81db16d1d82bf5..91fc2755852789e486695b84e6da36924f507052 100644 (file)
 #define INLINE_SYSCALL(name, nr, args...)                                    \
   ({                                                                         \
     long _ret = INTERNAL_SYSCALL (name, , nr, args);                         \
-    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_ret, ), 0))             \
+    if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (_ret, )))                \
      {                                                                       \
        __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));                        \
        _ret = -1;                                                            \
index 77345338efd94367b0c5a2f478d22e9abf0f4e3c..1f8ebba9fca72b0ff973e2e904006f5253d7b900 100644 (file)
@@ -32,7 +32,7 @@ static size_t __kernel_cpumask_size;
 int
 __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
 {
-  if (__builtin_expect (__kernel_cpumask_size == 0, 0))
+  if (__glibc_unlikely (__kernel_cpumask_size == 0))
     {
       INTERNAL_SYSCALL_DECL (err);
       int res;
index 598ff40d7561850e524c5e6fd1a4fd892fb7ebd6..f8494be044d56e725fd64ed5e67f1e8821eb86bb 100644 (file)
@@ -52,7 +52,7 @@ static int have_sendmmsg;
 int
 __sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
 {
-  if (__builtin_expect (have_sendmmsg >= 0, 1))
+  if (__glibc_likely (have_sendmmsg >= 0))
     {
       int ret = __internal_sendmmsg (fd, vmessages, vlen, flags);
       /* The kernel returns -EINVAL for unknown socket operations.
index fef8fd531accd4f473e87306c9ed8da5ee1bacb9..cec6fdbd0c046377d11ce7a0ce1bffc99cc7c691 100644 (file)
@@ -75,10 +75,10 @@ where_is_shmfs (void)
   /* OK, do it the hard way.  Look through the /proc/mounts file and if
      this does not exist through /etc/fstab to find the mount point.  */
   fp = __setmntent ("/proc/mounts", "r");
-  if (__builtin_expect (fp == NULL, 0))
+  if (__glibc_unlikely (fp == NULL))
     {
       fp = __setmntent (_PATH_MNTTAB, "r");
-      if (__builtin_expect (fp == NULL, 0))
+      if (__glibc_unlikely (fp == NULL))
        /* There is nothing we can do.  Blind guesses are not helpful.  */
        return;
     }
@@ -208,7 +208,7 @@ shm_open (const char *name, int oflag, mode_t mode)
        }
 #endif
     }
-  else if (__builtin_expect (errno == EISDIR, 0))
+  else if (__glibc_unlikely (errno == EISDIR))
     /* It might be better to fold this error with EINVAL since
        directory names are just another example for unsuitable shared
        object names and the standard does not mention EISDIR.  */
index 46b731e0a7a4c05d571010f7c3179ada591cae05..3b352c68bcc1aea4d913d0186177660d5f91a738 100644 (file)
@@ -47,7 +47,7 @@ __sleep (unsigned int seconds)
   unsigned int result;
 
   /* This is not necessary but some buggy programs depend on this.  */
-  if (__builtin_expect (seconds == 0, 0))
+  if (__glibc_unlikely (seconds == 0))
     {
 #ifdef CANCELLATION_P
       CANCELLATION_P (THREAD_SELF);
index ae9bb359ad81ead25b49dd7970aba5b2c56fa1b0..0c5ed3f5f99197334ff2abfd4ab8a64cdf63c3df 100644 (file)
@@ -56,7 +56,7 @@ symlinkat (from, tofd, to)
   if (tofd != AT_FDCWD && to[0] != '/')
     {
       size_t tolen = strlen (to);
-      if (__builtin_expect (tolen == 0, 0))
+      if (__glibc_unlikely (tolen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -81,7 +81,7 @@ symlinkat (from, tofd, to)
 
   result = INTERNAL_SYSCALL (symlink, err, 2, from, to);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), tofd, buf);
       result = -1;
index a739100e3724e52273b052a61aef5e51daf4a9ed..d759f7a417998649a6183ba6989edf7b68106bb9 100644 (file)
@@ -39,7 +39,7 @@ __tcgetattr (fd, termios_p)
 
   retval = INLINE_SYSCALL (ioctl, 3, fd, TCGETS, &k_termios);
 
-  if (__builtin_expect (retval == 0, 1))
+  if (__glibc_likely (retval == 0))
     {
       termios_p->c_iflag = k_termios.c_iflag;
       termios_p->c_oflag = k_termios.c_oflag;
index 8d808ce373d3ae7647f70c33a73e532533d58958..d257d25977fcfbc1d3ce0199b58e0080fc991a4a 100644 (file)
@@ -127,7 +127,7 @@ ttyname (int fd)
 
   /* isatty check, tcgetattr is used because it sets the correct
      errno (EBADF resp. ENOTTY) on error.  */
-  if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+  if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return NULL;
 
   if (__fxstat64 (_STAT_VER, fd, &st) < 0)
@@ -148,7 +148,7 @@ ttyname (int fd)
     }
 
   ssize_t len = __readlink (procname, ttyname_buf, buflen);
-  if (__builtin_expect (len != -1, 1))
+  if (__glibc_likely (len != -1))
     {
       if ((size_t) len >= buflen)
        return NULL;
index a03d012f8d2ebdf550902958788a2d5f7068e47f..6ce85db33b6ae5045d747d33165046f5001e44fd 100644 (file)
@@ -118,7 +118,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   /* isatty check, tcgetattr is used because it sets the correct
      errno (EBADF resp. ENOTTY) on error.  */
   struct termios term;
-  if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+  if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return errno;
 
   if (__fxstat64 (_STAT_VER, fd, &st) < 0)
@@ -128,13 +128,13 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
 
   ssize_t ret = __readlink (procname, buf, buflen - 1);
-  if (__builtin_expect (ret == -1 && errno == ENAMETOOLONG, 0))
+  if (__glibc_unlikely (ret == -1 && errno == ENAMETOOLONG))
     {
       __set_errno (ERANGE);
       return ERANGE;
     }
 
-  if (__builtin_expect (ret != -1, 1))
+  if (__glibc_likely (ret != -1))
     {
 #define UNREACHABLE_LEN strlen ("(unreachable)")
       if (ret > UNREACHABLE_LEN
index 0925d858004dd785c49f5c55f8d8cdcc3d55c459..6366c867e116ebdc63c294d90eb665dbd31c47b5 100644 (file)
@@ -63,7 +63,7 @@ unlinkat (fd, file, flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -91,7 +91,7 @@ unlinkat (fd, file, flag)
   else
     result = INTERNAL_SYSCALL (unlink, err, 1, file);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       result = -1;
index 29f0e540d1eb343152f0a5e10e5c723da5f7db25..5aec8af39c87b813381510b52ac578eb654d458c 100644 (file)
@@ -70,7 +70,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
@@ -98,7 +98,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   else
     res = INTERNAL_SYSCALL (stat, err, 2, file, st);
 
-  if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (res, err), 0))
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err)))
     {
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (res, err), fd, buf);
       res = -1;
index 8f3b521ed761bc615970763a633d1afef81cbe15..84e42a1f0ade274de8a46ba5833a6fab463b6f81 100644 (file)
@@ -34,7 +34,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
 # ifndef __ASSUME_FALLOCATE
-  if (__builtin_expect (__have_fallocate >= 0, 1))
+  if (__glibc_likely (__have_fallocate >= 0))
 # endif
     {
       INTERNAL_SYSCALL_DECL (err);
@@ -50,7 +50,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
        return 0;
 
 # ifndef __ASSUME_FALLOCATE
-      if (__builtin_expect (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS, 0))
+      if (__glibc_unlikely (INTERNAL_SYSCALL_ERRNO (res, err) == ENOSYS))
        __have_fallocate = -1;
       else
 # endif
index 4a9a9d90bc6a3b74fb349326aa669fcc9fba919c..f52690feeb5879cd216923e759af67f8269c4910 100644 (file)
 # define INLINE_SYSCALL(name, nr, args...) \
   ({                                                                         \
     unsigned long int resultvar = INTERNAL_SYSCALL (name, , nr, args);       \
-    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))        \
+    if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))           \
       {                                                                              \
        __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
        resultvar = (unsigned long int) -1;                                   \
 # define INLINE_SYSCALL_TYPES(name, nr, args...) \
   ({                                                                         \
     unsigned long int resultvar = INTERNAL_SYSCALL_TYPES (name, , nr, args);  \
-    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))        \
+    if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (resultvar, )))           \
       {                                                                              \
        __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
        resultvar = (unsigned long int) -1;                                   \
index 62e47e1eed43f94b857458ecd412d81972926bbb..9e3643f71bb4ebbc5ed892464717044e2196f28a 100644 (file)
@@ -70,7 +70,7 @@ __xmknodat (int vers, int fd, const char *file, mode_t mode, dev_t *dev)
   if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
-      if (__builtin_expect (filelen == 0, 0))
+      if (__glibc_unlikely (filelen == 0))
        {
          __set_errno (ENOENT);
          return -1;
index 1249fe823f75e5f7b5763747f94c2c725ebff0a7..f0f2f4b4e821d063fa13f27da3d87735595664fa 100644 (file)
@@ -39,7 +39,7 @@ elf_irela (const ElfW(Rela) *reloc)
   ElfW(Addr) *const reloc_addr = (void *) reloc->r_offset;
   const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
 
-  if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 1))
+  if (__glibc_likely (r_type == R_X86_64_IRELATIVE))
     {
       ElfW(Addr) value = elf_ifunc_invoke(reloc->r_addend);
       *reloc_addr = value;
index 504c95f32071557c1a295883b93e64296e78127f..8df04a96ca2dc749953ade54da179272b09f95c8 100644 (file)
@@ -92,7 +92,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
         to intercept the calls to collect information.  In this case we
         don't store the address in the GOT so that all future calls also
         end in this function.  */
-      if (__builtin_expect (profile, 0))
+      if (__glibc_unlikely (profile))
        {
          *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_profile;
 
@@ -241,7 +241,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
   const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
 
 # if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
-  if (__builtin_expect (r_type == R_X86_64_RELATIVE, 0))
+  if (__glibc_unlikely (r_type == R_X86_64_RELATIVE))
     {
 #  if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       /* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -262,11 +262,11 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 # if !defined RTLD_BOOTSTRAP
   /* l_addr + r_addend may be > 0xffffffff and R_X86_64_RELATIVE64
      relocation updates the whole 64-bit entry.  */
-  if (__builtin_expect (r_type == R_X86_64_RELATIVE64, 0))
+  if (__glibc_unlikely (r_type == R_X86_64_RELATIVE64))
     *(Elf64_Addr *) reloc_addr = (Elf64_Addr) map->l_addr + reloc->r_addend;
   else
 # endif
-  if (__builtin_expect (r_type == R_X86_64_NONE, 0))
+  if (__glibc_unlikely (r_type == R_X86_64_NONE))
     return;
   else
     {
@@ -419,7 +419,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
          *(unsigned int *) reloc_addr = value;
 
          const char *fmt;
-         if (__builtin_expect (value > UINT_MAX, 0))
+         if (__glibc_unlikely (value > UINT_MAX))
            {
              const char *strtab;
 
@@ -438,7 +438,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
        case R_X86_64_PC32:
          value += reloc->r_addend - (ElfW(Addr)) reloc_addr;
          *(unsigned int *) reloc_addr = value;
-         if (__builtin_expect (value != (int) value, 0))
+         if (__glibc_unlikely (value != (int) value))
            {
              fmt = "\
 %s: Symbol `%s' causes overflow in R_X86_64_PC32 relocation\n";
@@ -484,7 +484,7 @@ elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
 #if !defined RTLD_BOOTSTRAP
   /* l_addr + r_addend may be > 0xffffffff and R_X86_64_RELATIVE64
      relocation updates the whole 64-bit entry.  */
-  if (__builtin_expect (ELFW(R_TYPE) (reloc->r_info) == R_X86_64_RELATIVE64, 0))
+  if (__glibc_unlikely (ELFW(R_TYPE) (reloc->r_info) == R_X86_64_RELATIVE64))
     *(Elf64_Addr *) reloc_addr = (Elf64_Addr) l_addr + reloc->r_addend;
   else
 #endif
@@ -504,7 +504,7 @@ elf_machine_lazy_rel (struct link_map *map,
   const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
 
   /* Check for unexpected PLT reloc type.  */
-  if (__builtin_expect (r_type == R_X86_64_JUMP_SLOT, 1))
+  if (__glibc_likely (r_type == R_X86_64_JUMP_SLOT))
     {
       if (__builtin_expect (map->l_mach.plt, 0) == 0)
        *reloc_addr += l_addr;
@@ -513,7 +513,7 @@ elf_machine_lazy_rel (struct link_map *map,
          map->l_mach.plt
          + (((ElfW(Addr)) reloc_addr) - map->l_mach.gotplt) * 2;
     }
-  else if (__builtin_expect (r_type == R_X86_64_TLSDESC, 1))
+  else if (__glibc_likely (r_type == R_X86_64_TLSDESC))
     {
       struct tlsdesc volatile * __attribute__((__unused__)) td =
        (struct tlsdesc volatile *)reloc_addr;
@@ -522,10 +522,10 @@ elf_machine_lazy_rel (struct link_map *map,
       td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
                          + map->l_addr);
     }
-  else if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 0))
+  else if (__glibc_unlikely (r_type == R_X86_64_IRELATIVE))
     {
       ElfW(Addr) value = map->l_addr + reloc->r_addend;
-      if (__builtin_expect (!skip_ifunc, 1))
+      if (__glibc_likely (!skip_ifunc))
        value = ((ElfW(Addr) (*) (void)) value) ();
       *reloc_addr = value;
     }
index dfbafbff09ef7455015cb1441e56cc434df3cdd5..073cf84461db62daaae96b38aa59d6d981447961 100644 (file)
@@ -46,7 +46,7 @@ asctime_internal (const struct tm *tp, char *buf, size_t buflen)
      this would mean the output needs more space.  This would not be a
      problem if the 'asctime_r' interface would be defined sanely and
      a buffer size would be passed.  */
-  if (__builtin_expect (tp->tm_year > INT_MAX - 1900, 0))
+  if (__glibc_unlikely (tp->tm_year > INT_MAX - 1900))
     {
     eoverflow:
       __set_errno (EOVERFLOW);
index deef58ef3409340b9787767dfe923c158b11ae7a..52f0994815882345d9674481f37678bf28fc0f2d 100644 (file)
@@ -232,7 +232,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
                        > (SIZE_MAX - total_size) / sizeof (struct ttinfo), 0))
     goto lose;
   total_size += num_types * sizeof (struct ttinfo);
-  if (__builtin_expect (chars > SIZE_MAX - total_size, 0))
+  if (__glibc_unlikely (chars > SIZE_MAX - total_size))
     goto lose;
   total_size += chars;
   if (__builtin_expect (__alignof__ (struct leap) - 1
@@ -261,16 +261,16 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
                            || tzspec_len < num_leaps * 12, 0))
        goto lose;
       tzspec_len -= num_leaps * 12;
-      if (__builtin_expect (tzspec_len < num_isstd, 0))
+      if (__glibc_unlikely (tzspec_len < num_isstd))
        goto lose;
       tzspec_len -= num_isstd;
-      if (__builtin_expect (tzspec_len == 0 || tzspec_len - 1 < num_isgmt, 0))
+      if (__glibc_unlikely (tzspec_len == 0 || tzspec_len - 1 < num_isgmt))
        goto lose;
       tzspec_len -= num_isgmt + 1;
-      if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0))
+      if (__glibc_unlikely (SIZE_MAX - total_size < tzspec_len))
        goto lose;
     }
-  if (__builtin_expect (SIZE_MAX - total_size - tzspec_len < extra, 0))
+  if (__glibc_unlikely (SIZE_MAX - total_size - tzspec_len < extra))
     goto lose;
 
   /* Allocate enough memory including the extra block requested by the
@@ -310,7 +310,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
   /* Check for bogus indices in the data file, so we can hereafter
      safely use type_idxs[T] as indices into `types' and never crash.  */
   for (i = 0; i < num_transitions; ++i)
-    if (__builtin_expect (type_idxs[i] >= num_types, 0))
+    if (__glibc_unlikely (type_idxs[i] >= num_types))
       goto lose;
 
   if ((BYTE_ORDER != BIG_ENDIAN && (sizeof (time_t) == 4 || trans_width == 4))
@@ -341,18 +341,18 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
                            0))
        goto lose;
       c = getc_unlocked (f);
-      if (__builtin_expect ((unsigned int) c > 1u, 0))
+      if (__glibc_unlikely ((unsigned int) c > 1u))
        goto lose;
       types[i].isdst = c;
       c = getc_unlocked (f);
-      if (__builtin_expect ((size_t) c > chars, 0))
+      if (__glibc_unlikely ((size_t) c > chars))
        /* Bogus index in data file.  */
        goto lose;
       types[i].idx = c;
       types[i].offset = (long int) decode (x);
     }
 
-  if (__builtin_expect (fread_unlocked (zone_names, 1, chars, f) != chars, 0))
+  if (__glibc_unlikely (fread_unlocked (zone_names, 1, chars, f) != chars))
     goto lose;
 
   for (i = 0; i < num_leaps; ++i)
@@ -366,7 +366,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
       else
        leaps[i].transition = (time_t) decode64 (x);
 
-      if (__builtin_expect (fread_unlocked (x, 1, 4, f) != 4, 0))
+      if (__glibc_unlikely (fread_unlocked (x, 1, 4, f) != 4))
        goto lose;
       leaps[i].change = (long int) decode (x);
     }
@@ -374,7 +374,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
   for (i = 0; i < num_isstd; ++i)
     {
       int c = getc_unlocked (f);
-      if (__builtin_expect (c == EOF, 0))
+      if (__glibc_unlikely (c == EOF))
        goto lose;
       types[i].isstd = c != 0;
     }
@@ -384,7 +384,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
   for (i = 0; i < num_isgmt; ++i)
     {
       int c = getc_unlocked (f);
-      if (__builtin_expect (c == EOF, 0))
+      if (__glibc_unlikely (c == EOF))
        goto lose;
       types[i].isgmt = c != 0;
     }
@@ -627,7 +627,7 @@ __tzfile_compute (time_t timer, int use_localtime,
       __tzname[0] = NULL;
       __tzname[1] = NULL;
 
-      if (__builtin_expect (num_transitions == 0 || timer < transitions[0], 0))
+      if (__glibc_unlikely (num_transitions == 0 || timer < transitions[0]))
        {
          /* TIMER is before any transition (or there are no transitions).
             Choose the first non-DST type
@@ -657,9 +657,9 @@ __tzfile_compute (time_t timer, int use_localtime,
                  ++j;
            }
        }
-      else if (__builtin_expect (timer >= transitions[num_transitions - 1], 0))
+      else if (__glibc_unlikely (timer >= transitions[num_transitions - 1]))
        {
-         if (__builtin_expect (tzspec == NULL, 0))
+         if (__glibc_unlikely (tzspec == NULL))
            {
            use_last:
              i = num_transitions;
@@ -671,7 +671,7 @@ __tzfile_compute (time_t timer, int use_localtime,
 
          /* Convert to broken down structure.  If this fails do not
             use the string.  */
-         if (__builtin_expect (! __offtime (&timer, 0, tp), 0))
+         if (__glibc_unlikely (! __offtime (&timer, 0, tp)))
            goto use_last;
 
          /* Use the rules from the TZ string to compute the change.  */
@@ -680,7 +680,7 @@ __tzfile_compute (time_t timer, int use_localtime,
          /* If tzspec comes from posixrules loaded by __tzfile_default,
             override the STD and DST zone names with the ones user
             requested in TZ envvar.  */
-         if (__builtin_expect (zone_names == (char *) &leaps[num_leaps], 0))
+         if (__glibc_unlikely (zone_names == (char *) &leaps[num_leaps]))
            {
              assert (num_types == 2);
              __tzname[0] = __tzstring (zone_names);
@@ -762,7 +762,7 @@ __tzfile_compute (time_t timer, int use_localtime,
              ++j;
            }
 
-         if (__builtin_expect (__tzname[0] == NULL, 0))
+         if (__glibc_unlikely (__tzname[0] == NULL))
            __tzname[0] = __tzname[1];
 
          i = type_idxs[i - 1];
index bfcd943436e416b83662e32e0c77c70cd10076ef..77bfde9fb1f3595a0ad4536a3fa03684474bf148 100644 (file)
@@ -184,16 +184,16 @@ __tzset_parse_tz (tz)
     {
       /* Check for the quoted version.  */
       char *wp = tzbuf;
-      if (__builtin_expect (*tz++ != '<', 0))
+      if (__glibc_unlikely (*tz++ != '<'))
        goto out;
 
       while (isalnum (*tz) || *tz == '+' || *tz == '-')
        *wp++ = *tz++;
-      if (__builtin_expect (*tz++ != '>' || wp - tzbuf < 3, 0))
+      if (__glibc_unlikely (*tz++ != '>' || wp - tzbuf < 3))
        goto out;
       *wp = '\0';
     }
-  else if (__builtin_expect (consumed < 3, 0))
+  else if (__glibc_unlikely (consumed < 3))
     goto out;
   else
     tz += consumed;
@@ -232,19 +232,19 @@ __tzset_parse_tz (tz)
          /* Check for the quoted version.  */
          char *wp = tzbuf;
          const char *rp = tz;
-         if (__builtin_expect (*rp++ != '<', 0))
+         if (__glibc_unlikely (*rp++ != '<'))
            /* Punt on name, set up the offsets.  */
            goto done_names;
 
          while (isalnum (*rp) || *rp == '+' || *rp == '-')
            *wp++ = *rp++;
-         if (__builtin_expect (*rp++ != '>' || wp - tzbuf < 3, 0))
+         if (__glibc_unlikely (*rp++ != '>' || wp - tzbuf < 3))
            /* Punt on name, set up the offsets.  */
            goto done_names;
          *wp = '\0';
          tz = rp;
        }
-      else if (__builtin_expect (consumed < 3, 0))
+      else if (__glibc_unlikely (consumed < 3))
        /* Punt on name, set up the offsets.  */
        goto done_names;
       else
index 9fa31bc568b60d96dd46bb5d77c0e13d5e1d7c1c..643aaf585cad7a6c2127b9ed7e096d978d972de3 100644 (file)
@@ -88,7 +88,7 @@ mbrtoc16 (char16_t *pc16, const char *s, size_t n, mbstate_t *ps)
   /* Do a normal conversion.  */
   inbuf = (const unsigned char *) s;
   endbuf = inbuf + n;
-  if (__builtin_expect (endbuf < inbuf, 0))
+  if (__glibc_unlikely (endbuf < inbuf))
     {
       endbuf = (const unsigned char *) ~(uintptr_t) 0;
       if (endbuf == inbuf)
index 6eeaa55be609e8fc60a0fb464e7e76c659890d28..c57217add5ad4ee54965e7ba2d3f04c05e0ad93f 100644 (file)
@@ -70,7 +70,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
   /* Do a normal conversion.  */
   inbuf = (const unsigned char *) s;
   endbuf = inbuf + n;
-  if (__builtin_expect (endbuf < inbuf, 0))
+  if (__glibc_unlikely (endbuf < inbuf))
     {
       endbuf = (const unsigned char *) ~(uintptr_t) 0;
       if (endbuf == inbuf)
index 8267faf9c4194aa5d004b7bc8d4c7ae70fdd85af..84733b35fea508ccdc02d6fee2a447798b0d2bfe 100644 (file)
@@ -156,7 +156,7 @@ __wcsmbs_load_conv (struct __locale_data *new_category)
 
   /* We should repeat the test since while we waited some other thread
      might have run this function.  */
-  if (__builtin_expect (new_category->private.ctype == NULL, 1))
+  if (__glibc_likely (new_category->private.ctype == NULL))
     {
       /* We must find the real functions.  */
       const char *charset_name;
index a70942863188264afe2803cbb0dc496b7578b4ae..7636da7b65abafff41876efb8a276e33f70e3f00 100644 (file)
@@ -68,9 +68,9 @@ extern const struct __locale_data _nl_C_LC_CTYPE attribute_hidden;
 static inline const struct gconv_fcts *
 get_gconv_fcts (struct __locale_data *data)
 {
-  if (__builtin_expect (data->private.ctype == NULL, 0))
+  if (__glibc_unlikely (data->private.ctype == NULL))
     {
-      if (__builtin_expect (data == &_nl_C_LC_CTYPE, 0))
+      if (__glibc_unlikely (data == &_nl_C_LC_CTYPE))
        return &__wcsmbs_gconv_fcts_c;
       __wcsmbs_load_conv (data);
     }