about summary refs log tree commit diff
path: root/src/ctype
Commit message (Collapse)AuthorAgeFilesLines
* fix types for wctype_t and wctrans_tRich Felker2013-03-041-4/+4
| | | | | | | | | | | | | | | | | | | | wctype_t was incorrectly "int" rather than "long" on x86_64. not only is this an ABI incompatibility; it's also a major design flaw if we ever wanted wctype_t to be implemented as a pointer, which would be necessary if locales support custom character classes, since int is too small to store a converted pointer. this commit fixes wctype_t to be unsigned long on all archs, matching the LSB ABI; this change does not matter for C code, but for C++ it affects mangling. the same issue applied to wctrans_t. glibc/LSB defines this type as const __int32_t *, but since no such definition is visible, I've just expanded the definition, int, everywhere. it would be nice if these types (which don't vary by arch) could be in wctype.h, but the OB XSI requirement in POSIX that wchar.h expose some types and functions from wctype.h precludes doing so. glibc works around this with some hideous hacks, but trying to duplicate that would go against the intent of musl's headers.
* make some arrays constrofl0r2013-02-023-4/+4
| | | | this way they'll go into .rodata, decreasing memory pressure.
* fix argument type error on wcwidth functionRich Felker2012-08-021-2/+2
| | | | | | | since the correct declaration was not visible, and since the representation of the types wchar_t and wint_t always match, a compiler would have to go out of its way to make this bug manifest, but better to fix it anyway.
* fix broken wcwidth tablesRich Felker2012-06-201-7/+8
| | | | | | unicode char data has both "W" and "F" wide types and the old table only included the "W" ones. this omitted U+3000 (ideographic space) and all the wide-ascii, etc.
* fix ctype abi junk (pointer should point to 0 slot, not -128 slot)Rich Felker2012-06-053-3/+3
|
* add LSB abi junk for ctype functionsRich Felker2012-06-023-0/+104
| | | | | | | | this should be the last major fix needed to support running glibc-linked conforming POSIX programs with musl in place of glibc, as long as musl provides the features they need and they don't use pthread cancellation (which is implemented as c++ exceptions in glibc, and fundamentally incompatible with musl).
* new wcwidth implementation (fast table-based)Rich Felker2012-04-243-179/+125
| | | | | | | | | | | | | | | i tried to go with improving the old binary-search-based algorithm, but between growth in the number of ranges, bad performance, and lack of confidence in the binary search code's stability under changes in the table, i decided it was worth the extra 1.8k to have something clean and maintainable. also note that, like the alpha and punct tables, there's definitely room to optimize the nonspacing/wide tables by overlapping subtables. this is not a high priority, but i've begun looking into how to do it, and i suspect the table sizes can be roughly halved. if that turns out to be true, the new, fast, table-based implementation will be roughly the same size as if i had just extended the old binary search one.
* sync case mappings with unicode 6.1Rich Felker2012-04-232-8/+30
| | | | | | | also special-case ß (U+00DF) as lowercase even though it does not have a mapping to uppercase. unicode added an uppercase version of this character but does not map it, presumably because the uppercase version is not actually used except for some obscure purpose...
* optimize iswprintRich Felker2012-04-231-3/+12
|
* fix spurious punct class for some surrogate codepoints (invalid)Rich Felker2012-04-231-59/+56
| | | | this happened due to their entries in UnicodeData.txt
* destubify iswalpha and update iswpunct to unicode 6.1Rich Felker2012-04-235-135/+252
| | | | | | | | | | | | | | | alpha is defined as unicode property "Alphabetic" plus category Nd minus ASCII digits minus 2 special-cased Thai punctuation marks supposedly misclassified by Unicode as letters. punct is defined as all of unicode except control, alphanumeric, and space characters. the tables were generated by a simple tool based on the code posted previously to the mailing list. in the future, this and other code used for maintaining locale/iconv/i18n data will be published either in the main source repository or in a separate locale data generation repository.
* document iswspace and remove wrongly-included zwsp characterRich Felker2012-02-091-1/+5
|
* fix typo in iswspace space list tableRich Felker2012-02-091-1/+1
|
* more header fixes, minor warning fixRich Felker2011-02-141-0/+1
|
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-1234-0/+854