On Mon, Jul 13, 2015 at 06:47:44AM -0400, vtamara wrote:
> I saw fine your patches, just I wonder why you didn't introduce isalnum_l,
> toupper_l and tolower_l and call them from isalnum, toupper and tolower, in
> this way I guess possible to get rid completely of _tolower_tab and
> _toupper_tab.

The _l variants will be introduced by another patch. I follow a simple
principe for patches: keep them as simples as possible.

This method augments the number of patches, but it should simplify the
reviewing (because my patches are proposed for review as any others
patches, and if no other openbsd developer tell ok, they won't be
commited). A drawback is the global view as a whole isn't too easy.

The current patch just resolv one problem: _toupper_tab_ is a global
variable, and it wouldn't be possible to copte with it in a world in
per-thread locale state. So I change it to a function to grab the
current locale state: it just resolv this problem, no more.

After that, for implementing toupper_l(), I will need to change the
prototype of _toupper_tab_(void) to _toupper_tab_(locale_t), and I will
rewrite toupper() to call toupper_l(). But it is another problem.

Eventually I could have directly integrate _toupper_tab_(locale_t)
function, but when I wrote this patch, I wasn't sure it will be the good
way.

About getting rid _toupper_tab (or _tolower_tab), I am not sure it will
be possible. Yes, if toupper() call toupper_l() there is no _toupper_tab
need here. But toupper_l() implementation will need
_toupper_tab(locale_t).

Regards.
-- 
Sebastien Marie

Reply via email to