summaryrefslogtreecommitdiff
path: root/iconv/iconv.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-21 16:15:11 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-21 16:15:11 +0000
commita711dd4ba8f2c71a260a3f7539c0e86175f97a21 (patch)
tree1bf9e3eb9a49f3b9cdcd0dee9515339486170f74 /iconv/iconv.c
parent761df3a7aa6eb65aa66c78e6c1da627e453de458 (diff)
downloadglibc-a711dd4ba8f2c71a260a3f7539c0e86175f97a21.tar.gz
Update.
2000-04-21 Ulrich Drepper <drepper@redhat.com> * iconv/iconv.c (iconv): Add __builtin_expect where useful. * iconv/iconv_close.c (iconv_close): Likewise. * iconv/iconv_open.c (iconv_open): Likewise. * grp/putgrent.c (putgrent): Unlock steam if fprintf failed. Add __builtin_expect where useful. * grp/initgroups.c (initgroups): Test for result of memory allocation and punt if it fails. * dirent/scandir.c (scandir): Add __builtin_expect where useful. * grp/fgetgrent.c (fgetfrent): Likewise. * grp/fgetgrent_r.c (__fgetgrent_r): Likewise.
Diffstat (limited to 'iconv/iconv.c')
-rw-r--r--iconv/iconv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/iconv/iconv.c b/iconv/iconv.c
index c1b96164e5..c7ff73c428 100644
--- a/iconv/iconv.c
+++ b/iconv/iconv.c
@@ -1,6 +1,6 @@
/* Convert characters in input buffer using conversion descriptor to
output buffer.
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -37,7 +37,7 @@ iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf,
size_t converted;
int result;
- if (inbuf == NULL || *inbuf == NULL)
+ if (__gconv_builtin (inbuf == NULL || *inbuf == NULL), 0)
{
if (outbuf == NULL || *outbuf == NULL)
result = __gconv (gcd, NULL, NULL, NULL, NULL, &converted);
@@ -61,7 +61,7 @@ iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf,
if (outstart != NULL)
*outbytesleft -= *outbuf - outstart;
- switch (result)
+ switch (__builtin_expect (result, __GCONV_OK))
{
case __GCONV_ILLEGAL_DESCRIPTOR:
__set_errno (EBADF);