From a1ffb40e32741f992c743e7b16c061fefa3747ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20B=C3=ADlka?= Date: Mon, 10 Feb 2014 14:45:42 +0100 Subject: Use glibc_likely instead __builtin_expect. --- nis/nss_compat/compat-grp.c | 12 ++++++------ nis/nss_compat/compat-initgroups.c | 6 +++--- nis/nss_compat/compat-pwd.c | 12 ++++++------ nis/nss_compat/compat-spwd.c | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'nis/nss_compat') diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c index 2d57461..78e14d6 100644 --- a/nis/nss_compat/compat-grp.c +++ b/nis/nss_compat/compat-grp.c @@ -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; diff --git a/nis/nss_compat/compat-initgroups.c b/nis/nss_compat/compat-initgroups.c index fa15238..c5ba606 100644 --- a/nis/nss_compat/compat-initgroups.c +++ b/nis/nss_compat/compat-initgroups.c @@ -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; diff --git a/nis/nss_compat/compat-pwd.c b/nis/nss_compat/compat-pwd.c index 021fb18..127673c 100644 --- a/nis/nss_compat/compat-pwd.c +++ b/nis/nss_compat/compat-pwd.c @@ -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; diff --git a/nis/nss_compat/compat-spwd.c b/nis/nss_compat/compat-spwd.c index 1c2ec3d..4890ce6 100644 --- a/nis/nss_compat/compat-spwd.c +++ b/nis/nss_compat/compat-spwd.c @@ -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; -- cgit v1.1