about summary refs log tree commit diff
path: root/iconv/loop.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-06 06:49:00 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-06 06:49:00 +0000
commit5ea1a82defd37feaa6be1faf44854364c901cdaf (patch)
tree9fad50dfb181485bb4ca62c9d96e0d31376dce07 /iconv/loop.c
parent365afefc6b7054d9ca7585f6f17bdd1fe03b8cfd (diff)
downloadglibc-5ea1a82defd37feaa6be1faf44854364c901cdaf.tar.gz
glibc-5ea1a82defd37feaa6be1faf44854364c901cdaf.tar.xz
glibc-5ea1a82defd37feaa6be1faf44854364c901cdaf.zip
Update.
	* iconvdata/big5hkscs.c: Add __builtin_expect in many places.
	* iconvdata/big5.c: Likewise.
	* iconvdata/ansi_x3.110.c: Likewise.
	* iconvdata/8bit-generic.c: Likewise.
	* iconvdata/8bit-gap.c: Likewise.
	* iconv/loop.c: Likewise.
	* iconv/gconv_db.c: Likewise.
	* iconv/gconv_dl.c: Likewise.
	* iconv/gconv_simple.c: Likewise.
	* iconv/skeleton.c: Likewise.
Diffstat (limited to 'iconv/loop.c')
-rw-r--r--iconv/loop.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/iconv/loop.c b/iconv/loop.c
index 9e8e32e8cc..857c93de1e 100644
--- a/iconv/loop.c
+++ b/iconv/loop.c
@@ -232,14 +232,17 @@ FCTNAME (LOOPFCT) (const unsigned char **inptrp, const unsigned char *inend,
 	  /* `if' cases for MIN_NEEDED_OUTPUT ==/!= 1 is made to help the
 	     compiler generating better code.  It will optimized away
 	     since MIN_NEEDED_OUTPUT is always a constant.  */
-	  if ((MIN_NEEDED_OUTPUT != 1 && outptr + MIN_NEEDED_OUTPUT > outend)
-	      || (MIN_NEEDED_OUTPUT == 1 && outptr >= outend))
+	  if ((MIN_NEEDED_OUTPUT != 1
+	       && __builtin_expect (outptr + MIN_NEEDED_OUTPUT > outend, 0))
+	      || (MIN_NEEDED_OUTPUT == 1
+		  && __builtin_expect (outptr >= outend, 0)))
 	    {
 	      /* Overflow in the output buffer.  */
 	      result = __GCONV_FULL_OUTPUT;
 	      break;
 	    }
-	  if (MIN_NEEDED_INPUT > 1 && inptr + MIN_NEEDED_INPUT > inend)
+	  if (MIN_NEEDED_INPUT > 1
+	      && __builtin_expect (inptr + MIN_NEEDED_INPUT > inend, 0))
 	    {
 	      /* We don't have enough input for another complete input
 		 character.  */
@@ -356,7 +359,7 @@ SINGLE(LOOPFCT) (const unsigned char **inptrp, const unsigned char *inend,
      bytes from the state and at least one more, or the character is still
      incomplete, or we have some other error (like illegal input character,
      no space in output buffer).  */
-  if (inptr != bytebuf)
+  if (__builtin_expect (inptr != bytebuf, 1))
     {
       /* We found a new character.  */
       assert (inptr - bytebuf > (state->__count & 7));