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
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.bz2
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 4253540..5807380 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 0f77a18..44e96e8 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 6d4d969..f8a5bdb 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 ec5728e..e426102 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 4445f98..aeb1c27 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 32ff7b2..a5459b9 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 4359e19..d624a79 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 ab5adab..9bf5d9f 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 aa02873..f8c4454 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 87db7e1..105356f 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 b48f740..28e7fae 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 d7228ec..4516137 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 e4e91d3..653efb4 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 92549ae..5df98a0 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 955fc83..ff8b33f 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 f28d98e..25631ef 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 c8e6e44..d5262dc 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 3972680..aaf573c 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 b552a2e..e03bee6 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 2ee577c..1ad8c74 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 c64a9f6..3164e40 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 0de4e11..ec99024 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 abecabf..3eac236 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 122cd4b..f8bde89 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 48ae91d..9d8ea5d 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 f704cdc..cb7ed9a 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 daeb44e..40c7d0b 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 59462cd..c82b4d0 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 10be83c..cb62ab9 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 4caabbe..025b3c1 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);