Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: e0b58928ee1dcb501c3f40932f6a855a7e152ccd
      
https://github.com/Perl/perl5/commit/e0b58928ee1dcb501c3f40932f6a855a7e152ccd
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c
    M perl.h

  Log Message:
  -----------
  Move some locale.c #defines to perl.h

This is in preparation for them to be used in macros from outside
locale.c


  Commit: 4fd76d49315684898364ca6c6de3d730748e85d4
      
https://github.com/Perl/perl5/commit/4fd76d49315684898364ca6c6de3d730748e85d4
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c
    M perl.h

  Log Message:
  -----------
  Mark newly moved symbols as private

The previous commit made certain symbols that previously were local to
locale.c now available everywhere.  Add a trailing underscore to their
names to mark them as private.


  Commit: 8751a11f7fafc4d656fe8f44ebc8b5233e437153
      
https://github.com/Perl/perl5/commit/8751a11f7fafc4d656fe8f44ebc8b5233e437153
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c
    M makedef.pl
    M perl.h

  Log Message:
  -----------
  Add USE_LOCALE_THREADS #define

This is in preparation for supporting configurations where there threads
are available, but the locale handling code should ignore that fact.

This stems from the unusual locale handling of z/OS, where any attempt
is ignored to change locales after the first thread is created.


  Commit: 4b06b4d0b63d9008bcd89b739dadb572b15513b8
      
https://github.com/Perl/perl5/commit/4b06b4d0b63d9008bcd89b739dadb572b15513b8
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M ext/POSIX/POSIX.xs
    M intrpvar.h
    M locale.c
    M makedef.pl
    M perl.c
    M perl.h
    M sv.c

  Log Message:
  -----------
  Regularize HAS_POSIX_2008_LOCALE, USE_POSIX_2008_LOCALE

A platform shouldn't be required to use the Posix 2008 locale handling
functions if they are present.  Perhaps they are buggy.  So, a separate
define for using them was introduced, USE_POSIX_2008_LOCALE.  But until
this commit there were cases that were looking at the underlying
availability of the functions, not if the Configuration called for their
use.


  Commit: fb24522c5325180fac6726bdcad9a73f0c3ab50a
      
https://github.com/Perl/perl5/commit/fb24522c5325180fac6726bdcad9a73f0c3ab50a
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Change macro name

Adopt the git convention of 'porcelain' meaning without special
handling.  This makes it clear that porcelain_setlocale() is the base
level.


  Commit: d19f9f011c8c612145ebe21254cbba1b2d95ead6
      
https://github.com/Perl/perl5/commit/d19f9f011c8c612145ebe21254cbba1b2d95ead6
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Cast return of setlocale() to const

If they had it to do over again, the libc makers would have made the
return of this function 'const char *'.  We can cast it that way
internally to catch erroneous uses at compile time.


  Commit: 7e1cacefbdbeaeb1d6ea1a9f1b8ffc2a0e080062
      
https://github.com/Perl/perl5/commit/7e1cacefbdbeaeb1d6ea1a9f1b8ffc2a0e080062
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  locale.c: Create S_get_category_index()

libc locale categories, like LC_NUMERIC, are opaque integers.  This
makes it inconvenient to have table-driven code.  Instead, we have
tables that are indexed by small positive integers, which are a
compile-time mapping from the libc values.

This commit creates a run-time function to also do that mapping.  It
will first be used in the next commit.

The function does a loop through the available categories, looking for a
match.  It could be replaced by some sort of quick hash lookup, but the
largest arrays in the field have a max of 12 elements, with almost all
searches finding their quarry in the first 6.  It doesn't seem
worthwhile to me to replace a linear search of 6 elements by something
more complicated.  The design intent is this search will be used only at
the edges of the locale-handling code; once found the index is used in
future bits of the current operation.


  Commit: d188fe6d7ad41562666403fe77e959af6513771d
      
https://github.com/Perl/perl5/commit/d188fe6d7ad41562666403fe77e959af6513771d
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  locale.c: Use get_category_index()

This creates the first uses of the function added in the previous commit.

It changes the name of a function that now takes an index to have the
suffix _i to indicate its calling parameter is a category index rather
than a category.  This will become a common paradigm in this file in
later commits.

Two macros are also created to call that function; they have suffixes _c
(to indicate the parameter is a category known at compile time, and _r
(to indicate it needs to be computed at runtime).  This is in keeping
with the already existing paradigm in this file.


  Commit: 4bcc858ca05cc7aef10d8389dff31047c763a267
      
https://github.com/Perl/perl5/commit/4bcc858ca05cc7aef10d8389dff31047c763a267
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  locale.c: Change S_emulate_setlocale name and sig

It turns out this function is called only from places where we have the
category index already computed; so change the signature to use the
index and remove the re-calculation.

It renames it to emulate_setlocale_i() to indicate that the category
parameter is an index.

This also means, that it's very unlikely that it will be called with an
out-of-bounds value.  Remove the debugging statement for that case (but
retain the error return value).


  Commit: fef64ad9e49d729ca1f4e9223a94ab8a7d2cafc6
      
https://github.com/Perl/perl5/commit/fef64ad9e49d729ca1f4e9223a94ab8a7d2cafc6
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c
    M pod/perldelta.pod
    M pod/perldiag.pod

  Log Message:
  -----------
  locale.c: Simplify S_category_name

We can use the new function S_get_category_index() to simplify this.
Also, when I wrote it I didn't know about Perl_form(), and had
reimplemented a portion of it here; which is yanked as well.


  Commit: 01c966a37506885331c401e77e2e8450ec83da7f
      
https://github.com/Perl/perl5/commit/01c966a37506885331c401e77e2e8450ec83da7f
  Author: Karl Williamson <[email protected]>
  Date:   2022-06-16 (Thu, 16 Jun 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Move unreachable code so is reachable

It turns out this code, setting errno, is unreachable.  Move it to the
place where it would do some good, removing an extraneous, unreachable
return;


Compare: https://github.com/Perl/perl5/compare/b8b94c781ed4...01c966a37506

Reply via email to