about summary refs log tree commit diff
path: root/nis/nss_nis/nis-grp.c
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-02-10 14:45:42 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-02-10 15:07:12 +0100
commita1ffb40e32741f992c743e7b16c061fefa3747ac (patch)
tree246a29a87b26cfd5d07b17070f85eb3785018de9 /nis/nss_nis/nis-grp.c
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'nis/nss_nis/nis-grp.c')
-rw-r--r--nis/nss_nis/nis-grp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/nis/nss_nis/nis-grp.c b/nis/nss_nis/nis-grp.c
index 53368073a7..20211de0de 100644
--- a/nis/nss_nis/nis-grp.c
+++ b/nis/nss_nis/nis-grp.c
@@ -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;