aboutsummaryrefslogtreecommitdiff
path: root/debug
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 /debug
parentFix previous commit. (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.bz2
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'debug')
-rw-r--r--debug/confstr_chk.c2
-rw-r--r--debug/fread_chk.c2
-rw-r--r--debug/fread_u_chk.c2
-rw-r--r--debug/getgroups_chk.c4
-rw-r--r--debug/mbsnrtowcs_chk.c2
-rw-r--r--debug/mbsrtowcs_chk.c2
-rw-r--r--debug/mbstowcs_chk.c2
-rw-r--r--debug/memcpy_chk.c2
-rw-r--r--debug/memmove_chk.c2
-rw-r--r--debug/mempcpy_chk.c2
-rw-r--r--debug/memset_chk.c2
-rw-r--r--debug/stpcpy_chk.c2
-rw-r--r--debug/strcat_chk.c4
-rw-r--r--debug/strcpy_chk.c2
-rw-r--r--debug/strncat_chk.c14
-rw-r--r--debug/vsnprintf_chk.c2
-rw-r--r--debug/vswprintf_chk.c4
-rw-r--r--debug/wcpcpy_chk.c2
-rw-r--r--debug/wcpncpy_chk.c2
-rw-r--r--debug/wcscat_chk.c4
-rw-r--r--debug/wcscpy_chk.c4
-rw-r--r--debug/wcsncat_chk.c14
-rw-r--r--debug/wcsncpy_chk.c2
-rw-r--r--debug/wcsnrtombs_chk.c2
-rw-r--r--debug/wcsrtombs_chk.c2
-rw-r--r--debug/wcstombs_chk.c2
-rw-r--r--debug/wmemcpy_chk.c2
-rw-r--r--debug/wmemmove_chk.c2
-rw-r--r--debug/wmempcpy_chk.c2
-rw-r--r--debug/wmemset_chk.c2
30 files changed, 47 insertions, 47 deletions
diff --git a/debug/confstr_chk.c b/debug/confstr_chk.c
index 4253540c57..5807380faf 100644
--- a/debug/confstr_chk.c
+++ b/debug/confstr_chk.c
@@ -22,7 +22,7 @@
size_t
__confstr_chk (int name, char *buf, size_t len, size_t buflen)
{
- if (__builtin_expect (buflen < len, 0))
+ if (__glibc_unlikely (buflen < len))
__chk_fail ();
return confstr (name, buf, len);
diff --git a/debug/fread_chk.c b/debug/fread_chk.c
index 0f77a18029..44e96e868b 100644
--- a/debug/fread_chk.c
+++ b/debug/fread_chk.c
@@ -39,7 +39,7 @@ __fread_chk (void *__restrict ptr, size_t ptrlen,
__chk_fail ();
}
- if (__builtin_expect (bytes_requested > ptrlen, 0))
+ if (__glibc_unlikely (bytes_requested > ptrlen))
__chk_fail ();
CHECK_FILE (stream, 0);
diff --git a/debug/fread_u_chk.c b/debug/fread_u_chk.c
index 6d4d9693ea..f8a5bdbf2a 100644
--- a/debug/fread_u_chk.c
+++ b/debug/fread_u_chk.c
@@ -39,7 +39,7 @@ __fread_unlocked_chk (void *__restrict ptr, size_t ptrlen,
__chk_fail ();
}
- if (__builtin_expect (bytes_requested > ptrlen, 0))
+ if (__glibc_unlikely (bytes_requested > ptrlen))
__chk_fail ();
CHECK_FILE (stream, 0);
diff --git a/debug/getgroups_chk.c b/debug/getgroups_chk.c
index ec5728e43e..e426102096 100644
--- a/debug/getgroups_chk.c
+++ b/debug/getgroups_chk.c
@@ -22,13 +22,13 @@
int
__getgroups_chk (int size, __gid_t list[], size_t listlen)
{
- if (__builtin_expect (size < 0, 0))
+ if (__glibc_unlikely (size < 0))
{
__set_errno (EINVAL);
return -1;
}
- if (__builtin_expect (size * sizeof (__gid_t) > listlen, 0))
+ if (__glibc_unlikely (size * sizeof (__gid_t) > listlen))
__chk_fail ();
return __getgroups (size, list);
diff --git a/debug/mbsnrtowcs_chk.c b/debug/mbsnrtowcs_chk.c
index 4445f98fe8..aeb1c276a5 100644
--- a/debug/mbsnrtowcs_chk.c
+++ b/debug/mbsnrtowcs_chk.c
@@ -23,7 +23,7 @@ size_t
__mbsnrtowcs_chk (wchar_t *dst, const char **src, size_t nmc, size_t len,
mbstate_t *ps, size_t dstlen)
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return __mbsnrtowcs (dst, src, nmc, len, ps);
diff --git a/debug/mbsrtowcs_chk.c b/debug/mbsrtowcs_chk.c
index 32ff7b2443..a5459b94cf 100644
--- a/debug/mbsrtowcs_chk.c
+++ b/debug/mbsrtowcs_chk.c
@@ -23,7 +23,7 @@ size_t
__mbsrtowcs_chk (wchar_t *dst, const char **src, size_t len,
mbstate_t *ps, size_t dstlen)
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return __mbsrtowcs (dst, src, len, ps);
diff --git a/debug/mbstowcs_chk.c b/debug/mbstowcs_chk.c
index 4359e194f2..d624a79c56 100644
--- a/debug/mbstowcs_chk.c
+++ b/debug/mbstowcs_chk.c
@@ -23,7 +23,7 @@
size_t
__mbstowcs_chk (wchar_t *dst, const char *src, size_t len, size_t dstlen)
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
mbstate_t state;
diff --git a/debug/memcpy_chk.c b/debug/memcpy_chk.c
index ab5adab6be..9bf5d9f6c0 100644
--- a/debug/memcpy_chk.c
+++ b/debug/memcpy_chk.c
@@ -29,7 +29,7 @@ __memcpy_chk (dstpp, srcpp, len, dstlen)
size_t len;
size_t dstlen;
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return memcpy (dstpp, srcpp, len);
diff --git a/debug/memmove_chk.c b/debug/memmove_chk.c
index aa0287384b..f8c4454462 100644
--- a/debug/memmove_chk.c
+++ b/debug/memmove_chk.c
@@ -33,7 +33,7 @@ MEMMOVE_CHK (dest, src, len, destlen)
size_t len;
size_t destlen;
{
- if (__builtin_expect (destlen < len, 0))
+ if (__glibc_unlikely (destlen < len))
__chk_fail ();
return memmove (dest, src, len);
diff --git a/debug/mempcpy_chk.c b/debug/mempcpy_chk.c
index 87db7e1e10..105356f978 100644
--- a/debug/mempcpy_chk.c
+++ b/debug/mempcpy_chk.c
@@ -30,7 +30,7 @@ __mempcpy_chk (dstpp, srcpp, len, dstlen)
size_t len;
size_t dstlen;
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return __mempcpy (dstpp, srcpp, len);
diff --git a/debug/memset_chk.c b/debug/memset_chk.c
index b48f740fb5..28e7faed5e 100644
--- a/debug/memset_chk.c
+++ b/debug/memset_chk.c
@@ -25,7 +25,7 @@ __memset_chk (dstpp, c, len, dstlen)
size_t len;
size_t dstlen;
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return memset (dstpp, c, len);
diff --git a/debug/stpcpy_chk.c b/debug/stpcpy_chk.c
index d7228ec91b..4516137937 100644
--- a/debug/stpcpy_chk.c
+++ b/debug/stpcpy_chk.c
@@ -34,7 +34,7 @@ __stpcpy_chk (dest, src, destlen)
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
*d++ = *s;
}
diff --git a/debug/strcat_chk.c b/debug/strcat_chk.c
index e4e91d30d7..653efb47be 100644
--- a/debug/strcat_chk.c
+++ b/debug/strcat_chk.c
@@ -33,7 +33,7 @@ __strcat_chk (dest, src, destlen)
/* Find the end of the string. */
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *s1++;
}
@@ -46,7 +46,7 @@ __strcat_chk (dest, src, destlen)
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
diff --git a/debug/strcpy_chk.c b/debug/strcpy_chk.c
index 92549ae71a..5df98a0a4a 100644
--- a/debug/strcpy_chk.c
+++ b/debug/strcpy_chk.c
@@ -56,7 +56,7 @@ __strcpy_chk (dest, src, destlen)
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *s;
*(s++ + off) = c;
diff --git a/debug/strncat_chk.c b/debug/strncat_chk.c
index 955fc830c2..ff8b33f367 100644
--- a/debug/strncat_chk.c
+++ b/debug/strncat_chk.c
@@ -33,7 +33,7 @@ __strncat_chk (s1, s2, n, s1len)
/* Find the end of S1. */
do
{
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
c = *s1++;
}
@@ -49,25 +49,25 @@ __strncat_chk (s1, s2, n, s1len)
size_t n4 = n >> 2;
do
{
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
if (c == '\0')
return s;
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
if (c == '\0')
return s;
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
if (c == '\0')
return s;
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
@@ -79,7 +79,7 @@ __strncat_chk (s1, s2, n, s1len)
while (n > 0)
{
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
@@ -90,7 +90,7 @@ __strncat_chk (s1, s2, n, s1len)
if (c != '\0')
{
- if (__builtin_expect (s1len-- == 0, 0))
+ if (__glibc_unlikely (s1len-- == 0))
__chk_fail ();
*++s1 = '\0';
}
diff --git a/debug/vsnprintf_chk.c b/debug/vsnprintf_chk.c
index f28d98ed47..25631ef1a3 100644
--- a/debug/vsnprintf_chk.c
+++ b/debug/vsnprintf_chk.c
@@ -33,7 +33,7 @@ ___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
Though, maxlen is supposed to be the size of buffer pointed
to by s, so a conforming program can't pass such maxlen
to *snprintf. */
- if (__builtin_expect (slen < maxlen, 0))
+ if (__glibc_unlikely (slen < maxlen))
__chk_fail ();
_IO_strnfile sf;
diff --git a/debug/vswprintf_chk.c b/debug/vswprintf_chk.c
index c8e6e4455b..d5262dce18 100644
--- a/debug/vswprintf_chk.c
+++ b/debug/vswprintf_chk.c
@@ -32,7 +32,7 @@ __vswprintf_chk (wchar_t *s, size_t maxlen, int flags, size_t slen,
Though, maxlen is supposed to be the size of buffer pointed
to by s, so a conforming program can't pass such maxlen
to *snprintf. */
- if (__builtin_expect (slen < maxlen, 0))
+ if (__glibc_unlikely (slen < maxlen))
__chk_fail ();
_IO_wstrnfile sf;
@@ -44,7 +44,7 @@ __vswprintf_chk (wchar_t *s, size_t maxlen, int flags, size_t slen,
/* We need to handle the special case where MAXLEN is 0. Use the
overflow buffer right from the start. */
- if (__builtin_expect (maxlen == 0, 0))
+ if (__glibc_unlikely (maxlen == 0))
/* Since we have to write at least the terminating L'\0' a buffer
length of zero always makes the function fail. */
return -1;
diff --git a/debug/wcpcpy_chk.c b/debug/wcpcpy_chk.c
index 3972680e2e..aaf573cf55 100644
--- a/debug/wcpcpy_chk.c
+++ b/debug/wcpcpy_chk.c
@@ -33,7 +33,7 @@ __wcpcpy_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = wcp[off];
*++wcp = c;
diff --git a/debug/wcpncpy_chk.c b/debug/wcpncpy_chk.c
index b552a2ece8..e03bee6ebd 100644
--- a/debug/wcpncpy_chk.c
+++ b/debug/wcpncpy_chk.c
@@ -23,7 +23,7 @@
wchar_t *
__wcpncpy_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
{
- if (__builtin_expect (destlen < n, 0))
+ if (__glibc_unlikely (destlen < n))
__chk_fail ();
/* This function is not often enough used to justify not using a
diff --git a/debug/wcscat_chk.c b/debug/wcscat_chk.c
index 2ee577ce16..1ad8c746bd 100644
--- a/debug/wcscat_chk.c
+++ b/debug/wcscat_chk.c
@@ -30,7 +30,7 @@ __wcscat_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
/* Find the end of the string. */
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *s1++;
}
@@ -43,7 +43,7 @@ __wcscat_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *s2++;
*++s1 = c;
diff --git a/debug/wcscpy_chk.c b/debug/wcscpy_chk.c
index c64a9f67d2..3164e401cb 100644
--- a/debug/wcscpy_chk.c
+++ b/debug/wcscpy_chk.c
@@ -35,7 +35,7 @@ __wcscpy_chk (wchar_t *dest, const wchar_t *src, size_t n)
do
{
- if (__builtin_expect (n-- == 0, 0))
+ if (__glibc_unlikely (n-- == 0))
__chk_fail ();
c = *wcp++;
wcp[off] = c;
@@ -48,7 +48,7 @@ __wcscpy_chk (wchar_t *dest, const wchar_t *src, size_t n)
do
{
- if (__builtin_expect (n-- == 0, 0))
+ if (__glibc_unlikely (n-- == 0))
__chk_fail ();
c = *src++;
*wcp++ = c;
diff --git a/debug/wcsncat_chk.c b/debug/wcsncat_chk.c
index 0de4e11d63..ec990248fb 100644
--- a/debug/wcsncat_chk.c
+++ b/debug/wcsncat_chk.c
@@ -29,7 +29,7 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
/* Find the end of DEST. */
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *dest++;
}
@@ -45,25 +45,25 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
size_t n4 = n >> 2;
do
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *src++;
*++dest = c;
if (c == L'\0')
return s;
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *src++;
*++dest = c;
@@ -75,7 +75,7 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
while (n > 0)
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
c = *src++;
*++dest = c;
@@ -86,7 +86,7 @@ __wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
if (c != L'\0')
{
- if (__builtin_expect (destlen-- == 0, 0))
+ if (__glibc_unlikely (destlen-- == 0))
__chk_fail ();
*++dest = L'\0';
}
diff --git a/debug/wcsncpy_chk.c b/debug/wcsncpy_chk.c
index abecabf0da..3eac236a4f 100644
--- a/debug/wcsncpy_chk.c
+++ b/debug/wcsncpy_chk.c
@@ -23,7 +23,7 @@
wchar_t *
__wcsncpy_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
{
- if (__builtin_expect (destlen < n, 0))
+ if (__glibc_unlikely (destlen < n))
__chk_fail ();
/* This function is not often enough used to justify not using a
diff --git a/debug/wcsnrtombs_chk.c b/debug/wcsnrtombs_chk.c
index 122cd4b7f8..f8bde89da6 100644
--- a/debug/wcsnrtombs_chk.c
+++ b/debug/wcsnrtombs_chk.c
@@ -23,7 +23,7 @@ size_t
__wcsnrtombs_chk (char *dst, const wchar_t **src, size_t nwc, size_t len,
mbstate_t *ps, size_t dstlen)
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return __wcsnrtombs (dst, src, nwc, len, ps);
diff --git a/debug/wcsrtombs_chk.c b/debug/wcsrtombs_chk.c
index 48ae91df41..9d8ea5d8c2 100644
--- a/debug/wcsrtombs_chk.c
+++ b/debug/wcsrtombs_chk.c
@@ -23,7 +23,7 @@ size_t
__wcsrtombs_chk (char *dst, const wchar_t **src, size_t len,
mbstate_t *ps, size_t dstlen)
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
return __wcsrtombs (dst, src, len, ps);
diff --git a/debug/wcstombs_chk.c b/debug/wcstombs_chk.c
index f704cdc3ef..cb7ed9a5ff 100644
--- a/debug/wcstombs_chk.c
+++ b/debug/wcstombs_chk.c
@@ -23,7 +23,7 @@
size_t
__wcstombs_chk (char *dst, const wchar_t *src, size_t len, size_t dstlen)
{
- if (__builtin_expect (dstlen < len, 0))
+ if (__glibc_unlikely (dstlen < len))
__chk_fail ();
mbstate_t state;
diff --git a/debug/wmemcpy_chk.c b/debug/wmemcpy_chk.c
index daeb44e037..40c7d0b02a 100644
--- a/debug/wmemcpy_chk.c
+++ b/debug/wmemcpy_chk.c
@@ -23,7 +23,7 @@
wchar_t *
__wmemcpy_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
{
- if (__builtin_expect (ns1 < n, 0))
+ if (__glibc_unlikely (ns1 < n))
__chk_fail ();
return (wchar_t *) memcpy ((char *) s1, (char *) s2, n * sizeof (wchar_t));
}
diff --git a/debug/wmemmove_chk.c b/debug/wmemmove_chk.c
index 59462cda3b..c82b4d0d23 100644
--- a/debug/wmemmove_chk.c
+++ b/debug/wmemmove_chk.c
@@ -23,7 +23,7 @@
wchar_t *
__wmemmove_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
{
- if (__builtin_expect (ns1 < n, 0))
+ if (__glibc_unlikely (ns1 < n))
__chk_fail ();
return (wchar_t *) memmove ((char *) s1, (char *) s2, n * sizeof (wchar_t));
}
diff --git a/debug/wmempcpy_chk.c b/debug/wmempcpy_chk.c
index 10be83c68c..cb62ab9478 100644
--- a/debug/wmempcpy_chk.c
+++ b/debug/wmempcpy_chk.c
@@ -23,7 +23,7 @@
wchar_t *
__wmempcpy_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
{
- if (__builtin_expect (ns1 < n, 0))
+ if (__glibc_unlikely (ns1 < n))
__chk_fail ();
return (wchar_t *) __mempcpy ((char *) s1, (char *) s2,
n * sizeof (wchar_t));
diff --git a/debug/wmemset_chk.c b/debug/wmemset_chk.c
index 4caabbe420..025b3c14d2 100644
--- a/debug/wmemset_chk.c
+++ b/debug/wmemset_chk.c
@@ -22,7 +22,7 @@
wchar_t *
__wmemset_chk (wchar_t *s, wchar_t c, size_t n, size_t dstlen)
{
- if (__builtin_expect (dstlen < n, 0))
+ if (__glibc_unlikely (dstlen < n))
__chk_fail ();
return wmemset (s, c, n);