1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Use glibc_likely instead __builtin_expect.

This commit is contained in:
Ondřej Bílka
2014-02-10 14:45:42 +01:00
parent 1448f32447
commit a1ffb40e32
466 changed files with 2224 additions and 1655 deletions

View 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);