aboutsummaryrefslogtreecommitdiff
path: root/iconv
diff options
context:
space:
mode:
Diffstat (limited to 'iconv')
-rw-r--r--iconv/iconv.c6
-rw-r--r--iconv/iconv_close.c4
-rw-r--r--iconv/iconv_open.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/iconv/iconv.c b/iconv/iconv.c
index c1b9616..c7ff73c 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);
diff --git a/iconv/iconv_close.c b/iconv/iconv_close.c
index 6f81aa2..c999e44 100644
--- a/iconv/iconv_close.c
+++ b/iconv/iconv_close.c
@@ -1,5 +1,5 @@
/* Release any resource associated with given conversion descriptor.
- 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.
@@ -27,7 +27,7 @@
int
iconv_close (iconv_t cd)
{
- if (cd == (iconv_t *) -1L)
+ if (__builtin_expect (cd == (iconv_t *) -1L, 0))
{
__set_errno (EBADF);
return -1;
diff --git a/iconv/iconv_open.c b/iconv/iconv_open.c
index 96b910e..7f06947 100644
--- a/iconv/iconv_open.c
+++ b/iconv/iconv_open.c
@@ -1,5 +1,5 @@
/* Get descriptor for character set conversion.
- 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.
@@ -87,7 +87,7 @@ iconv_open (const char *tocode, const char *fromcode)
res = __gconv_open (tocode, fromcode, &cd, 0);
- if (res != __GCONV_OK)
+ if (__builtin_expect (res, __GCONV_OK) != __GCONV_OK)
{
/* We must set the error number according to the specs. */
if (res == __GCONV_NOCONV || res == __GCONV_NODB)