develooper Front page | perl.perl5.changes | Postings from September 2021

[Perl/perl5] 49ffa9: cygwin.c: Use mnemonic instead of repeatingexpr

From:
Karl Williamson via perl5-changes
Date:
September 13, 2021 22:34
Subject:
[Perl/perl5] 49ffa9: cygwin.c: Use mnemonic instead of repeatingexpr
Message ID:
Perl/perl5/push/refs/heads/smoke-me/khw-cygwin/000000-6e5349@github.com
  Branch: refs/heads/smoke-me/khw-cygwin
  Home:   https://github.com/Perl/perl5
  Commit: 49ffa940912ae067380175bb0b8e8499e5a5ad25
      https://github.com/Perl/perl5/commit/49ffa940912ae067380175bb0b8e8499e5a5ad25
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Use mnemonic instead of repeating expr

This expression is repeated in several places; best to name it for
clarity and ease of change.


  Commit: 708b5fb4acba3d7e704ca0518d857c7e3955e90a
      https://github.com/Perl/perl5/commit/708b5fb4acba3d7e704ca0518d857c7e3955e90a
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Remove misleading comments

cygwin works on UTF-16, not UCS-2, nr UTF-8


  Commit: 1140097ab44e181bcc5db61f91a612cc8c89a3a1
      https://github.com/Perl/perl5/commit/1140097ab44e181bcc5db61f91a612cc8c89a3a1
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Remove memory leaks

These mallocs weren't getting freed.


  Commit: cdf778d3fd25b5102dea16b9591254f0ced3ec7a
      https://github.com/Perl/perl5/commit/cdf778d3fd25b5102dea16b9591254f0ced3ec7a
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Change wide_to_utf8() to call utf16_to_utf8()

The latter function is in the core, and doesn't require the locale to be
changed, unlike before.


  Commit: 019751c1eeade61018ac8c5a72cb9deec9343b26
      https://github.com/Perl/perl5/commit/019751c1eeade61018ac8c5a72cb9deec9343b26
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Call wide_to_utf8()

There are two places that do the same thing as wide_to_utf8(), in
different ways.  Use the single, common function


  Commit: e7603854883da862c05c99d046170ddd15973d72
      https://github.com/Perl/perl5/commit/e7603854883da862c05c99d046170ddd15973d72
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Narrow scope of setlocale

The previous commit caused the locale not to have to be changed and
locked for as much as before.  Narrow the change to the scope needed.


  Commit: 6dcb4310bc4f3f5bdd8100151e66d925278af5e9
      https://github.com/Perl/perl5/commit/6dcb4310bc4f3f5bdd8100151e66d925278af5e9
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Change variable names

This makes the name consistent in the two parallel functions, in
preparation for folding the two into one.


  Commit: 7ae9b017ceabc50e3e5bec4b75b21fc58b676c6f
      https://github.com/Perl/perl5/commit/7ae9b017ceabc50e3e5bec4b75b21fc58b676c6f
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Refactor some expressions

These cause the long flag name to only be mentioned once.


  Commit: d464bcb72a4af7e1a8b909cefd307f985d4c7442
      https://github.com/Perl/perl5/commit/d464bcb72a4af7e1a8b909cefd307f985d4c7442
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Use SvPVx in both places

One function uses this form; the parallel function doesn't.  No having
delved into the details, the 'x' form is safer, so should be used in the
same situation in both functions.


  Commit: b4277f87c360dd00499a7ff3b6031610e81b8b1f
      https://github.com/Perl/perl5/commit/b4277f87c360dd00499a7ff3b6031610e81b8b1f
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Add warning

This warning is emitted when converting from posix to windows, but not
the other way around.  They should be symmetric


  Commit: 6ecdea3ad917c44702a269761b84902cd166ae71
      https://github.com/Perl/perl5/commit/6ecdea3ad917c44702a269761b84902cd166ae71
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Fold two nearly identical functions into one

These functions are to convert from a windows path to posix, and vice
versa.  Except for the direction, the process is identical.  But the two
functions that go in a single direction have diverged slightly over
time.

The previous few commits were integrating the changes in one version
into the opposite one.

The two versions are now sufficiently alike that only direction-oriented
details differ, so the functions can be combined.

A new common function is created, and the other two functions merely
wrap it, calling it with a parameter to indicate the direction.


  Commit: 902f68c2c8b308d63c84da7d6db0678ff0989eca
      https://github.com/Perl/perl5/commit/902f68c2c8b308d63c84da7d6db0678ff0989eca
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin: COnvert to use utf8_to_utf16()

This now-core function simplifies things, and removes the need for
changing the locale.


  Commit: 8c3da20edf72268c6f737202392173cbe8ce7272
      https://github.com/Perl/perl5/commit/8c3da20edf72268c6f737202392173cbe8ce7272
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  cygwin.c: Use utf8_to_wide_extra()

This function, added in the previous commit, accomplishes what this code
does, without needing to change the locale, and allowing for
simplification.


  Commit: c4f51f63e625d154b9a02425bf2821b3bb014a79
      https://github.com/Perl/perl5/commit/c4f51f63e625d154b9a02425bf2821b3bb014a79
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M utf8.c

  Log Message:
  -----------
  utf8


  Commit: 07b9ba0f2092b634415c86fd81a39175a573c261
      https://github.com/Perl/perl5/commit/07b9ba0f2092b634415c86fd81a39175a573c261
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M cygwin/cygwin.c

  Log Message:
  -----------
  smoke


  Commit: 6e5349a1a01b9471710d2547e43e7292ce010858
      https://github.com/Perl/perl5/commit/6e5349a1a01b9471710d2547e43e7292ce010858
  Author: Karl Williamson <khw@cpan.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M .github/workflows/testsuite.yml

  Log Message:
  -----------
  yml


Compare: https://github.com/Perl/perl5/compare/49ffa940912a%5E...6e5349a1a01b



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About