diff options
Diffstat (limited to 'posix')
-rw-r--r-- | posix/fnmatch.c | 16 | ||||
-rw-r--r-- | posix/getopt.c | 2 | ||||
-rw-r--r-- | posix/glob.c | 42 | ||||
-rw-r--r-- | posix/wordexp.c | 2 |
4 files changed, 31 insertions, 31 deletions
diff --git a/posix/fnmatch.c b/posix/fnmatch.c index f748d3df46..4f14a8b839 100644 --- a/posix/fnmatch.c +++ b/posix/fnmatch.c @@ -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); diff --git a/posix/getopt.c b/posix/getopt.c index 2d481f1c7f..a859acb67a 100644 --- a/posix/getopt.c +++ b/posix/getopt.c @@ -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); diff --git a/posix/glob.c b/posix/glob.c index f1431088a2..aa4bb92f82 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -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); diff --git a/posix/wordexp.c b/posix/wordexp.c index 366ec18aeb..b6b65dd993 100644 --- a/posix/wordexp.c +++ b/posix/wordexp.c @@ -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]); |