This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Refactor static fcn to save work
authorKarl Williamson <khw@cpan.org>
Thu, 20 Jul 2017 22:20:01 +0000 (16:20 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 9 Nov 2017 02:50:29 +0000 (19:50 -0700)
commit86799d2d7311249b2270db1ccb7d283999810d4f
treec0de7c6cc423422762a7aa1199d2116a9636b181
parentf61748ac869b88af2e2557f16421f2d4a8fd09f5
locale.c: Refactor static fcn to save work

This adds a parameter to the function that sets the radix character for
floating point numbers.  We know that the radix by default is a dot, so
no need to calculate it in that case.

This code was previously using localeconv() to find the locale's decimal
point.  The just added my_nl_langinfo() fcn does the same with an easier
API, and is more thread safe, and automatically switches to use
localeconv() when n nl_langinfo() isn't available, so revise the
conditional compilation directives that previously were necessary, and
collapse directives that were unnecessarily nested.

And adjust indentation
embed.fnc
embed.h
locale.c
proto.h