From 015d33c5075b9c0a4df8f28e844e4f7ace91c647 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 27 Feb 2011 00:28:59 -0500 Subject: 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. --- src/multibyte/mbsrtowcs.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/multibyte/mbsrtowcs.c') 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; -- cgit v1.2.1