This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Update iswalpha, iswprint, iswpunct (was Re: Update wctype functions to Unicode 5.2?)


On Feb 16 19:03, Corinna Vinschen wrote:
> Below is the patch which revamps iswalpha, iswprint and iswpunct for
> Unicode 5.2.
> 
> What I did was mostly manual work, but I made sure to test it as well as
> to document how to retrieve the data for the tables and the big switch
> statements in comments in the code.
> 
> The easiest part of the patch is in iswpunct.c.  Instead of maintaining
> the big table in utf8punct.h, the entire code is now reduced to
> 
>   return (!iswalnum (c) && iswgraph (c));
> 
> This is the definition of the iswpunct character class.  As long as the
> iswprint and iswalpha character tables are correct, the iswpunct
> function is by definition also correct.  So, no need to keep the tables
> around.

Btw., if you have mixed feelings about this change to iswpunct, I can
also provide a patch which implements it in the old terms of a the
big switch and the tables in utf8punct.h.  It just takes another day.
However, I think it is more elegant to define it as above, because it's
one less point of failure and it saves space.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]