about summary refs log tree commit diff
path: root/src/multibyte
Commit message (Collapse)AuthorAgeFilesLines
* cleanup wcstombsRich Felker2013-04-041-12/+1
| | | | | remove redundant headers and comments; this file is completely trivial now. also, avoid temp var.
* cleanup mbstowcs wrapperRich Felker2013-04-041-10/+0
| | | | | remove unneeded headers. this file is utterly trivial now and there's no sense in having a comment to state that it's in the public domain.
* minor optimization to mbstowcsRich Felker2013-04-041-2/+1
| | | | | | there is no need to zero-fill an mbstate_t object in the caller; mbsrtowcs will automatically treat a null pointer as the initial state.
* fix incorrect range checks in wcsrtombsRich Felker2013-04-041-3/+3
| | | | | | negative values of wchar_t need to be treated in the non-ASCII case so that they can properly generate EILSEQ rather than getting truncated to 8bit values and stored in the output.
* overhaul mbsrtowcsRich Felker2013-04-041-69/+64
| | | | | | | | | | | | | | | | | these changes fix at least two bugs: - misaligned access to the input as uint32_t for vectorized ASCII test - incorrect src pointer after stopping on EILSEQ in addition, the text of the standard makes it unclear whether the mbstate_t object is to be modified when the destination pointer is null; previously it was cleared either way; now, it's only cleared when the destination is non-null. this change may need revisiting, but it should not affect most applications, since calling mbsrtowcs with non-zero state can only happen when the head of the string was already processed with mbrtowc. finally, these changes shave about 20% size off the function and seem to improve performance by 1-5%.
* use restrict everywhere it's required by c99 and/or posix 2008Rich Felker2012-09-0610-11/+12
| | | | | | | | to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
* fix failure of mbsinit(0) (not UB; required to return nonzero)Rich Felker2012-05-261-1/+1
| | | | issue reported by Richard Pennington; slightly simpler fix applied
* fix longstanding exit logic bugs in mbsnrtowcs and wcsnrtombsRich Felker2012-05-022-4/+9
| | | | | | | | these are POSIX 2008 (previously GNU extension) functions that are rarely used. apparently they had never been tested before, since the end-of-string logic was completely missing. mbsnrtowcs is used by modern versions of bash for its glob implementation, and and this bug was causing tab completion to hang in an infinite loop.
* new attempt at working around the gcc 3 visibility bugRich Felker2012-02-241-0/+4
| | | | | since gcc is failing to generate the necessary ".hidden" directive in the output asm, generate it explicitly with an __asm__ statement...
* remove useless attribute visibility from definitionsRich Felker2012-02-241-1/+1
| | | | | | this was a failed attempt at working around the gcc 3 visibility bug affecting x86_64. subsequent patch will address it with an ugly but working hack.
* cleanup and work around visibility bug in gcc 3 that affects x86_64Rich Felker2012-02-232-6/+4
| | | | | | | | | | | | | | in gcc 3, the visibility attribute must be placed on both the declaration and on the definition. if it's omitted from the definition, the compiler fails to emit the ".hidden" directive in the assembly, and the linker will either generate textrels (if supported, such as on i386) or refuse to link (on targets where certain types of textrels are forbidden or impossible without further assumptions about memory layout, such as on x86_64). this patch also unifies the decision about when to use visibility into libc.h and makes the visibility in the utf-8 state machine tables based on libc.h rather than a duplicate test.
* fix all implicit conversion between signed/unsigned pointersRich Felker2011-03-251-1/+1
| | | | | | | sadly the C language does not specify any such implicit conversion, so this is not a matter of just fixing warnings (as gcc treats it) but actual errors. i would like to revisit a number of these changes and possibly revise the types used to reduce the number of casts required.
* cleanup utf-8 multibyte code, use visibility if possibleRich Felker2011-02-273-84/+5
| | | | | | | | | | | | | 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.
* remove sample utf-8 code that's not part of the standard libraryRich Felker2011-02-211-47/+0
|
* cleanup multibyte stuff to remove ugly casts, sanitize the ptr align castsRich Felker2011-02-133-27/+27
|
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-1218-0/+694