Commit Graph

9 Commits

Author SHA1 Message Date
Sebastian Huber 0e5f252bc7 ctype: Avoid GCC note in towctrans_l.c
The previous version genenerated the following GCC note:

towctrans_l.c:44:1: note: offset of packed bit-field 'diff' has changed in GCC 4.4
 caseconv_table [] = {
 ^~~~~~~~~~~~~~

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-07-30 10:47:57 +02:00
Sebastian Huber d8d18c3e80 ctype: Fix integer type for caseconv_entry::delta
The commit 46ba1675c4 accidently changed a
bit-field from signed to unsigned.  The caseconv_entry::delta must be a
signed integer, see also "newlib/libc/ctype/caseconv.t".

Unfortunately, a standard GCC/Newlib build is done without
-Wsign-conversion.  Using this warning option would have helped to avoid
this bug:

caseconv.t:2:22: warning: unsigned conversion from 'int' to 'unsigned int:17' changes value from '-32' to '131040' [-Wsign-conversion]
   {0x0061, 25, TOUP, -32},

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-07-30 10:47:57 +02:00
Sebastian Huber 46ba1675c4 ctype: Fix bitfield types on 16-bit targets
This prevents errors like this:

newlib/libc/ctype/categories.c:6:3: error: width of 'first' exceeds its type
   unsigned int first: 24;
   ^

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-07-20 14:25:03 +02:00
Thomas Wolff fc59da00c8 comments to document struct caseconv_entry
explain design of compact (packed) struct caseconv_entry,
in case it needs to be modified for future Unicode versions
2018-03-26 12:01:50 +02:00
Thomas Wolff b49ce5af1b newlib: fix indentation in toulower
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-26 10:00:16 +02:00
Corinna Vinschen e186dc8661 towctrans_l: Always return a value from helper functions
touupper and toulower didn't return a value in all cases.  Worse,
this only broke Cygwin when building without optimization for debug
purposes.

Why GCC neglects to notice this is a mystery.

While at it, fix formatting.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-03-13 22:09:30 +01:00
Thomas Wolff 41f72ab4d7 use generated character data
The tow* functions use an included case conversion table which can be
generated from Unicode data.
The isw* functions use a character categories table (provided by
categories.c) which can be generated from Unicode data.
Delegation between current-locale and specific-locale-dependent functions
was reverted towards the generic locale-dependent functions (*_l.c);
this is however only relevant on systems with non-Unicode wide character
locales, thus not on Cygwin.
2018-03-12 11:39:42 +01:00
Corinna Vinschen baf0c9fcb5 Fold documentation of is*_l funcs into documentation of non-l is* funcs
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 14:21:52 +02:00
Corinna Vinschen 8493c16316 Implement all per-locale ctype functions
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 10:56:57 +02:00