Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 104d782601a4ac648be4646d0a28a42077995db6 https://github.com/Perl/perl5/commit/104d782601a4ac648be4646d0a28a42077995db6 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024)
Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Recompute variable in 2nd part of function This is in preparation for the next commit splitting the function in two, and the current 2nd part will not need or have this variable passed in as an argument. Commit: 8e6366e3a669dbec0ba3ae1b0402b1b7a8cc005c https://github.com/Perl/perl5/commit/8e6366e3a669dbec0ba3ae1b0402b1b7a8cc005c Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Split a function in two Prior to this commit, the function was #ifdef'd so that one or the other part would compile. But future commits will cause them both to need to be compiled in some circumstances, with the first part potentially calling the second part. Note that the 2nd part doesn't need the parameter 'cat_index' that the first part does. Commit: fdc7323930f3eab4e6028f99a057a202f956c788 https://github.com/Perl/perl5/commit/fdc7323930f3eab4e6028f99a057a202f956c788 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Refactor two nested switch() statements This slightly refactors these so that many case labels are no longer repeated. It does this by making the nested one the default: of the outer one, and the outer's previous default: becomes the inner's default (which formerly was useless, so panicked). Commit: 6ab10ea5bd0f52bf1302e1b6d2017cfb5cf574ae https://github.com/Perl/perl5/commit/6ab10ea5bd0f52bf1302e1b6d2017cfb5cf574ae Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Move GCC DIAG IGNORE The previous commit changed two nested switch() statements. The inner one turned off implicit switch() case statement fallthrough warnings. This commit applies that to the entire outer switch(). Commit: 5ef81bf05e89742bbfb96c03f362effe0b84656c https://github.com/Perl/perl5/commit/5ef81bf05e89742bbfb96c03f362effe0b84656c Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Tighten circumstances some code is generated This code need not be compiled except under the circumstances defined in this commit. Commit: 9207ab4fad418cd6bb8eb22358bcb7679ae3d2b9 https://github.com/Perl/perl5/commit/9207ab4fad418cd6bb8eb22358bcb7679ae3d2b9 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Always compile save__to_buffer() The next commit will want to use it in more Configurations, and a future commit in all Configurations. Commit: 3e9613c754ffb0bd2cd99e771bae33a335c73613 https://github.com/Perl/perl5/commit/3e9613c754ffb0bd2cd99e771bae33a335c73613 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Compile S_emulate_langinfo() under more Configurations This is in preparation for some code to be consolidated into just this one function. Commit: 8f0e71899b82a2311a84f419bf5daf76d92966f6 https://github.com/Perl/perl5/commit/8f0e71899b82a2311a84f419bf5daf76d92966f6 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Effectively white-space, comments only The previous few commits have added/removed code blocks and #if directives. Adjust white space accordingly This also adds explanatary comments Commit: aeec574d1effa562786a0ad5d4416f225be2206e https://github.com/Perl/perl5/commit/aeec574d1effa562786a0ad5d4416f225be2206e Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Handle some ignored categories in langinfo emulation It is possible to Configure perl to not allow any or all of the locale categories on the platform to be changed away from the C locale, generally due to libc limitations. OpenBSD, for example, keeps every category but one in C; so perl shouldn't even try to change any of those. On platforms without the libc nl_langinfo() function, perl emulates it. Prior to this commit, the emulation did not properly handle the case of categories needing to stay in C. This did not lead to bugs, because external to this file, any such calls were intercepted by Perl_langinfo8(), and internally, we just didn't call it under those circumstances. But this leads to some awkwardness, and it is more maintainable to have the handling in one place; which is this low-level emulation. This commit causes the emulation to handle LC_CTYPE, LC_NUMERIC, and LC_MONETARY needing to stay in the C locale. Future commits will add the other categories, and remove the redundant checks in Perl_langinfo8(). Commit: c88ef0ec719c465b529c489e6b57a6140a5481e0 https://github.com/Perl/perl5/commit/c88ef0ec719c465b529c489e6b57a6140a5481e0 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Move check for unknown langinfo items This moves this check into the lowest level function, so that no duplication is needed. Commit: 95206f97a3a137ca74409890c45ac91b2a23b3c4 https://github.com/Perl/perl5/commit/95206f97a3a137ca74409890c45ac91b2a23b3c4 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of some langinfo items Without nl_langinfo(), some Configurations handled nl_langinfo() items associated with the LC_CTYPE, LC_MONETARY, and LC_NUMERIC categories in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). This commit removes the only use of a macro, which is hence also removed. Commit: fc8d63bed35791bc44282e26a295e1ee4aea4e9f https://github.com/Perl/perl5/commit/fc8d63bed35791bc44282e26a295e1ee4aea4e9f Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Move handling of LC_MESSAGES langinfo items This commit moves the handling of langinfo items associated with the LC_MESSAGES category to emulate_langinfo() when nl_langinfo() is not available on the platform away from Perl_langinfo8(). This is a step in the process of handling all such items in emulate_langinfo(). Commit: 87e4323015cf062d71db16fcb7320608f485f18e https://github.com/Perl/perl5/commit/87e4323015cf062d71db16fcb7320608f485f18e Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of ABDAY langinfo items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: 4d713891b781956f8097203e2ef160f47fa3516b https://github.com/Perl/perl5/commit/4d713891b781956f8097203e2ef160f47fa3516b Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of DAY langinfo items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: 78628c0a431000b31340700ebae55d4919177816 https://github.com/Perl/perl5/commit/78628c0a431000b31340700ebae55d4919177816 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of ABMON langinfo items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: b9ab616765f78d56d6d283bedcdcd0fa092e8543 https://github.com/Perl/perl5/commit/b9ab616765f78d56d6d283bedcdcd0fa092e8543 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of MON langinfo items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: 10675e66483756f713cee044c0c5e244d9299b58 https://github.com/Perl/perl5/commit/10675e66483756f713cee044c0c5e244d9299b58 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of AM/PM langinfo items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: 9c901d0eacba10ae02d6ff7d8827a40a6d0becfc https://github.com/Perl/perl5/commit/9c901d0eacba10ae02d6ff7d8827a40a6d0becfc Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Move handling of ERA langinfo item This commit moves the handling of the ERA langinfo item to emulate_langinfo() away from Perl_langinfo8(). Commit: a2fd2eabf932c04c9e6025e7c019d564b1231249 https://github.com/Perl/perl5/commit/a2fd2eabf932c04c9e6025e7c019d564b1231249 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of ALT_DIGITS langinfo item Without nl_langinfo(), some Configurations handled this nl_langinfo() item associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: fa4a6b8415800de9dc18cb528b9e7a7953f3f893 https://github.com/Perl/perl5/commit/fa4a6b8415800de9dc18cb528b9e7a7953f3f893 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of ERA format langinfo items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: 2c742ddb3ec81e6d23aadbeb627c4fe55e6db958 https://github.com/Perl/perl5/commit/2c742ddb3ec81e6d23aadbeb627c4fe55e6db958 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Remove redundant handling of the AM_PM format This format is identical whether or not LC_TIME is usable on this platform or not. Previously, it was actually handled in two functions, emulate_langinfo() when LC_TIME is usable, and Perl_langinfo8() when not. Previous commits have enabled the format handling in emulate_langinfo() to be returned instead of having separate cases, depending on LC_TIME's availability. That means the handling of this format in Perl_langinfo8() is redundant and this commit removes it. Commit: 6e96a984e32e1045db25a1144fcfc98939eea72a https://github.com/Perl/perl5/commit/6e96a984e32e1045db25a1144fcfc98939eea72a Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Consolidate handling of remaining TIME items Without nl_langinfo(), some Configurations handled these nl_langinfo() items associated with the LC_TIME category in Perl_langinfo8(), and some Configurations in emulate_langinfo(). This commit consolidates all the handling to emulate_langinfo(). Commit: 746e366879fe28091a86cf4b005d5e3ee56c066a https://github.com/Perl/perl5/commit/746e366879fe28091a86cf4b005d5e3ee56c066a Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: No strftime() implies empty formats When returning an nl_langinfo() format when we are emulating nl_langinfo() when there is no strftime() on the system, return an empty format. A non-empty return is useless. Commit: 66893ddbe8117f44c630c17775c6500776f15e03 https://github.com/Perl/perl5/commit/66893ddbe8117f44c630c17775c6500776f15e03 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: langinfo: Better handle unknown input item On systems with <langinfo.h>, the 'item' parameter here must be a member of an enum. If it isn't something we recognize, it's a real problem. On other systems any int can be passed, and it could just be that the caller got a wrong value. For these, we don't know if it is a perl error or a user error, so just set EINVAL and return failure Commit: 8bdac057fcf8f581deb91d94521f00348e0d16c7 https://github.com/Perl/perl5/commit/8bdac057fcf8f581deb91d94521f00348e0d16c7 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Extract code into a separate function This new function does not have to be compiled in all Configurations, and placing it separately removes some #ifdefs, and allows its absence to be more transparent from its callers. Commit: 45829eedfe3cd8ce6caf72df6c7170aedd763825 https://github.com/Perl/perl5/commit/45829eedfe3cd8ce6caf72df6c7170aedd763825 Author: Karl Williamson <k...@cpan.org> Date: 2024-01-08 (Mon, 08 Jan 2024) Changed paths: M locale.c Log Message: ----------- locale.c: Can now call my_langinfo_i() in all circumstances Prior to this commit, the caller had to know if the category in question was being ignored in this Configuration. Now, that is transparent. Compare: https://github.com/Perl/perl5/compare/983c7e774c64...45829eedfe3c