summaryrefslogtreecommitdiff
path: root/src/multibyte/mbsrtowcs.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-27 00:28:59 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-27 00:28:59 -0500
commit015d33c5075b9c0a4df8f28e844e4f7ace91c647 (patch)
tree6afdfbd8af5c6c7a550f8cf4a070e965b6806897 /src/multibyte/mbsrtowcs.c
parent2a195dd31ceb2a483ea547444aac080bee132ad2 (diff)
downloadmusl-015d33c5075b9c0a4df8f28e844e4f7ace91c647.tar.gz
musl-015d33c5075b9c0a4df8f28e844e4f7ace91c647.tar.bz2
musl-015d33c5075b9c0a4df8f28e844e4f7ace91c647.tar.xz
musl-015d33c5075b9c0a4df8f28e844e4f7ace91c647.zip
cleanup utf-8 multibyte code, use visibility if possible
this code was written independently of musl, with support for a the backwards, nonstandard "31-bit unicode" some libraries/apps might want. unfortunately the extra code (inside #ifdef) makes the source harder to read and makes code that should be simple look complex, so i'm removing it. anyone who wants to use the old code can find it in the history or from elsewhere. also, change the visibility of the __fsmu8 state machine table to hidden, if supported. this should improve performance slightly in shared-library builds.
Diffstat (limited to 'src/multibyte/mbsrtowcs.c')
-rw-r--r--src/multibyte/mbsrtowcs.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/multibyte/mbsrtowcs.c b/src/multibyte/mbsrtowcs.c
index 64399cf2..ebf0d6c9 100644
--- a/src/multibyte/mbsrtowcs.c
+++ b/src/multibyte/mbsrtowcs.c
@@ -42,12 +42,6 @@ size_t mbsrtowcs(wchar_t *ws, const char **src, size_t wn, mbstate_t *st)
resume0:
if (OOB(c,*s)) goto ilseq2; s++;
c <<= 6; if (!(c&(1U<<31))) break;
-#ifdef I_FAILED_TO_RTFM_RFC3629
- if (*s++-0x80u >= 0x40) goto ilseq2;
- c <<= 6; if (!(c&(1U<<31))) break;
- if (*s++-0x80u >= 0x40) goto ilseq2;
- c <<= 6; if (!(c&(1U<<31))) break;
-#endif
if (*s++-0x80u >= 0x40) goto ilseq2;
c <<= 6; if (!(c&(1U<<31))) break;
if (*s++-0x80u >= 0x40) goto ilseq2;
@@ -89,16 +83,6 @@ resume:
c = (c<<6) | *s++-0x80;
if (!(c&(1U<<31))) break;
-#ifdef I_FAILED_TO_RTFM_RFC3629
- if (*s-0x80u >= 0x40) goto ilseq;
- c = (c<<6) | *s++-0x80;
- if (!(c&(1U<<31))) break;
-
- if (*s-0x80u >= 0x40) goto ilseq;
- c = (c<<6) | *s++-0x80;
- if (!(c&(1U<<31))) break;
-#endif
-
if (*s-0x80u >= 0x40) goto ilseq;
c = (c<<6) | *s++-0x80;
if (!(c&(1U<<31))) break;