about summary refs log tree commit diff
path: root/posix/fnmatch.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 /posix/fnmatch.c
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'posix/fnmatch.c')
-rw-r--r--posix/fnmatch.c16
1 files changed, 8 insertions, 8 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);