about summary refs log tree commit diff
path: root/iconv/gconv_simple.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-16 07:21:24 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-16 07:21:24 +0000
commit41f112ad228d4cd587712b747472a3a9f7e20e5a (patch)
tree6aa35ba2205129873989df4aef484c8b2504205e /iconv/gconv_simple.c
parentea31b613feba1c5f34ff2cf9f2c0bab3be4f8d2a (diff)
downloadglibc-41f112ad228d4cd587712b747472a3a9f7e20e5a.tar.gz
glibc-41f112ad228d4cd587712b747472a3a9f7e20e5a.tar.xz
glibc-41f112ad228d4cd587712b747472a3a9f7e20e5a.zip
Update.
	* iconv/loop.c: Use CLEAR_STATE if defined to clear __state element.
Diffstat (limited to 'iconv/gconv_simple.c')
-rw-r--r--iconv/gconv_simple.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 124c8e7727..69489d892b 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -1081,7 +1081,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
     ch <<= r * 6;							      \
 									      \
     /* Store the number of bytes expected for the entire sequence.  */	      \
-    ch = ch << 3 | cnt;							      \
+    state->__count |= cnt << 8;						      \
 									      \
     /* Store the value.  */						      \
     state->__value.__wch = ch;						      \
@@ -1091,10 +1091,9 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
   {									      \
     static const unsigned char inmask[5] = { 0xc0, 0xe0, 0xf0, 0xf8, 0xfc };  \
     wint_t wch = state->__value.__wch;					      \
-    size_t ntotal = wch & 7;						      \
-    wch >>= 3;								      \
+    size_t ntotal = state->__count >> 8;				      \
 									      \
-    inlen = state->__count;						      \
+    inlen = state->__count & 255;					      \
 									      \
     bytebuf[0] = inmask[ntotal - 2];					      \
 									      \
@@ -1109,6 +1108,10 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
     bytebuf[0] |= wch;							      \
   }
 
+#define CLEAR_STATE \
+  state->__count = 0
+
+
 #include <iconv/loop.c>
 #include <iconv/skeleton.c>