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/nis_subr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'nis/nis_subr.c') diff --git a/nis/nis_subr.c b/nis/nis_subr.c index 4a4580a1e6..8f6f1d71f3 100644 --- a/nis/nis_subr.c +++ b/nis/nis_subr.c @@ -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; } -- cgit v1.2.3