In perl.git, the branch smoke-me/khw-locale has been created

<https://perl5.git.perl.org/perl.git/commitdiff/04345234f89ee10b8f0b2c8319ad83c96d419c3d?hp=0000000000000000000000000000000000000000>

        at  04345234f89ee10b8f0b2c8319ad83c96d419c3d (commit)

- Log -----------------------------------------------------------------
commit 04345234f89ee10b8f0b2c8319ad83c96d419c3d
Author: Karl Williamson <[email protected]>
Date:   Mon Sep 11 11:05:56 2017 -0600

    locale.c: Add #define's
    
    The previous commit added arrays of locale categories.  This commit
    creates compile-time mappings from the category number to the index it
    has in the array.  It also changes to use the #define for the index of
    LC_ALL in places it is expected to be defined.  This causes bugs in this
    logic to be found at compile time on systems that don't have LC_ALL.

commit a03460059ce7d4cfa53a5ad6792c9add56a4fdfd
Author: Karl Williamson <[email protected]>
Date:   Tue Jul 25 14:23:33 2017 -0600

    locale.c: Remove many #if conditionals
    
    locale.c is full of compiler conditionals because platforms vary widely
    (or have in the past) in what categories they use.  This commit adds two
    parallel arrays that can map a category to/from its name, and are
    defined with each element conditionally compiled in based on the
    platform.  Putting the conditional compilations there enables us to
    replace many of the other conditionals by loops through the arrays.
    Thus uniform behavior is guaranteed for each locale category without
    having to remember to keep things in sync, and the code is much more
    compact.
    
    This code is executed only once, on process initialization, so the
    slight performance hit is inconsequential.

commit 36d93817f180bcee7014673d0d58194b552d09a8
Author: Karl Williamson <[email protected]>
Date:   Sun Jul 23 22:08:50 2017 -0600

    Perl_locale(): Refactor for clarity
    
    This code is full of 'if's interrupted by #ifdefs, which makes it hard
    to read.  Changing it to a switch() makes it much easier to understand.

commit 89474416fa50676046a5b90ff7edb3c9588a0cba
Author: Karl Williamson <[email protected]>
Date:   Sun Jul 23 21:53:28 2017 -0600

    locale.c:sync_locale(): Add debugging info

commit b7c7cee74de4efcd341f22a2a4b30a8899aecc11
Author: Karl Williamson <[email protected]>
Date:   Sun Jul 23 21:39:46 2017 -0600

    locale.c:sync_locale(): Rmv useless call
    
    This was changing to use the locale's radix, but this is unnecessary for
    the later things in this function, and those change things to use dot,
    so this call is useless.

commit 0931fb9b60d4029966820a91558cfe8673a5cc7f
Author: Karl Williamson <[email protected]>
Date:   Thu Sep 14 13:32:58 2017 -0600

    locale.c: Use new nl_langinfo equivalent
    
    This converts the final plain nl_langinfo() function call in locale.c to
    use the new equivalent that is more thread safe, and you don't have to
    free the returned memory.  There was an unlikely leak before this, if
    the return was somehow "".

commit bd6102bdfccd60b9eeb58a699056be10477799c4
Author: Karl Williamson <[email protected]>
Date:   Wed Sep 13 21:17:28 2017 -0600

    locale.c: Rmv erroneous complement operator
    
    The extra '!' that snuck in there caused this code to not work properly.
    Fortunately, it doesn't get used except as a last resort, and that
    apparently hasn't happened so as to have gotten reported from the field.
    A test can't be added because it would only occur on a system that had
    bad locales.

commit 24c49cff1eddba0cc3cd718fc97e7e5d1e5c6ae6
Author: Karl Williamson <[email protected]>
Date:   Thu Sep 14 12:44:40 2017 -0600

    locale.c: Refactor locale macros
    
    This standardizes things to make things easier to understand and prepare
    for future commits

commit 8259f9bbf218cf6d506c392ccbeff1ef3cf85f8c
Author: Karl Williamson <[email protected]>
Date:   Thu Jul 20 19:16:55 2017 -0600

    locale.c: Convert setlocale() calls to macros
    
    This will be useful in future commits

commit 1e878b40653255b4340a498e98fbb199793dd46b
Author: Karl Williamson <[email protected]>
Date:   Wed Jul 19 11:34:08 2017 -0600

    locale.c: Change static fcn name
    
    The new name more closely reflects what it does

commit 0c2bdfb66e146646dd0ec22f268651592e0a56e8
Author: Karl Williamson <[email protected]>
Date:   Thu Jul 20 16:20:01 2017 -0600

    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

commit cd9e363b504b8943a951348a1bf2c5be2d26c517
Author: Karl Williamson <[email protected]>
Date:   Mon Sep 11 19:12:56 2017 -0600

    locale.c: Create extended internal Perl_langinfo()
    
    This extended version allows it to be called so that it uses the current
    locale for the LC_NUMERIC, instead of toggling to the underlying one.
    (This can be useful when in the middle of things.)
    
    This ability won't be used until the next commit

commit ac0747bf2b2dadcaa2067ff7a21ccb8fb3e64003
Author: Karl Williamson <[email protected]>
Date:   Thu Jul 20 16:24:42 2017 -0600

    locale.c: Rmv redundant fcn call
    
    This function is called as part of the call made in the line before.  No
    need to do it twice.

commit eb07003bf4dff9a2dd73c23810c6c3dc4485b91f
Author: Karl Williamson <[email protected]>
Date:   Sat Jul 15 18:19:48 2017 -0600

    locale.c: White-space, comment, rearrange some #else
    
    This file is full of conditional compilation, due to the fact that
    locale support has been highly variable in the OSes Perl has operated
    on.  This commit properly indents nested compiler directives, and makes
    sure there is a blank line between the directives and real code.  I find
    that much easier to read.  It also re-orders some
    
        #ifdef some_feature
            Many lines of code handling feature
        #else
            1 to 3 lines of trivial code to avoid compilation warnings
        #endif
    
    to
    
        #ifndef some_feature
            1 to 3 lines of trivial code to avoid compilation warnings
        #else
            Many lines of code handling feature
        #endif
    
    Otherwise the trivial code may be hundreds of lines from the original
    '#if', which makes it hard to grok.
    
    This commit also clarifies and fixes typos in comments, and removes some
    obsolete comments.

-----------------------------------------------------------------------

-- 
Perl5 Master Repository

Reply via email to