develooper Front page | perl.perl5.changes | Postings from November 2022

[Perl/perl5] 222976: mro_core.c - define PERL_IN_MRO_CORE_C as well

From:
Yves Orton via perl5-changes
Date:
November 17, 2022 10:21
Subject:
[Perl/perl5] 222976: mro_core.c - define PERL_IN_MRO_CORE_C as well
Message ID:
Perl/perl5/push/refs/heads/yves/auto_embed_fnc/261177-26b449@github.com
  Branch: refs/heads/yves/auto_embed_fnc
  Home:   https://github.com/Perl/perl5
  Commit: 22297665d1c50cb33c8ac76ef6deb77ee1a4fba3
      https://github.com/Perl/perl5/commit/22297665d1c50cb33c8ac76ef6deb77ee1a4fba3
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M mro_core.c

  Log Message:
  -----------
  mro_core.c - define PERL_IN_MRO_CORE_C as well

Each core file defines a symbol which represents that its in that file.
Sometime where we split or move code around this ends up with a file
claiming to be another file. This is fine, but it should also define
its own file specific define.

Currently this isn't used. But if we ever want to restrict functions
in this file to just this file (eg a static function) we will need this
define.


  Commit: fca02e5c8caa195a00c60b9bceb4b7e0b40700a9
      https://github.com/Perl/perl5/commit/fca02e5c8caa195a00c60b9bceb4b7e0b40700a9
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M embed.fnc

  Log Message:
  -----------
  embed.fnc - expand comment about exporting symbols

The explanation was a bit scanty and out of date. This expands and
updates it to modern practice.


  Commit: b747efef20ed4b37890cedff59b7d53d1ed64a06
      https://github.com/Perl/perl5/commit/b747efef20ed4b37890cedff59b7d53d1ed64a06
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

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

  Log Message:
  -----------
  embed.fnc - normalize defines and sort functions

Turn 'ifdef' into 'if defined()' and 'ifndef' into 'if !defined()'

For example:

  ifdef DEBUGGING
  if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_PP_HOT_C)

is converted into

  if defined(DEBUGGING)
    if defined(PERL_IN_PP_HOT_C) || defined(PERL_IN_REGCOMP_C)

All functions under the same conditional guards are grouped, and
sorted by function name so that 'thing_set()' is next to 'THINGSET()'.
Eg, two functions in different parts of the file with the same
duplicated guard clauses will be replaced by a single set of guard
clauses containing all the relevant functions.

CPP conditionals are indented consistently, and endif's and else clauses
include comments showing the condition they are related to.

Currently long conditionals are kept on one line, a future patch might
break them up, or use some other device to reduce line length. This
means some existing conditionals using line continuations will be
converted to a single line. (Necessary for grouping.)


  Commit: 8985e5d6b9206fe6d0a492f929ca56ad08024b6e
      https://github.com/Perl/perl5/commit/8985e5d6b9206fe6d0a492f929ca56ad08024b6e
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M embed.fnc

  Log Message:
  -----------
  embed.fnc - normalize flags

The previous patch did not alter the flags. This patch normalizes
the flags by sorting them asciibetically.


  Commit: e077c680bd220acaeb20cdb79987f4fa1295cb43
      https://github.com/Perl/perl5/commit/e077c680bd220acaeb20cdb79987f4fa1295cb43
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M embed.fnc
    M embed.h

  Log Message:
  -----------
  embed.fnc - change things to use 'C' export type.

These functions are being used by code that does not define
PERL_CORE or PERL_EXT so they cant be 'E', but they aren't API
so they arent 'A', that leaves 'C'.


  Commit: bb4e4f9a05d72f24f0366a83c85fd528796aacba
      https://github.com/Perl/perl5/commit/bb4e4f9a05d72f24f0366a83c85fd528796aacba
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M embed.fnc

  Log Message:
  -----------
  embed.fnc - make it easier to find the docs for a flag

Put single quotes around all mentions of a flag in embed.fnc's commented
documentation, so that by searching for C< 'A' > results in finding all the
docs that mention the 'A' flag, including its own documentation.

Many sections in the docs mention other flags, and its a bit hard to get an
overview of all the implications of a current flag as they are letters used in
the docs itself. By consistently using single quotes you can jump from doc
fragment to doc fragment easily.


  Commit: 26b449e760087c318368f123686990d856b6e24a
      https://github.com/Perl/perl5/commit/26b449e760087c318368f123686990d856b6e24a
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

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

  Log Message:
  -----------
  embed.fnc - minor cleanup, break up PERL_CORE expression and remove spaces after defined

The earlier normalization didn't notice that some defines have spaces
behind them, and didn't normalize that out. This also breaks up an
expression that used && to join a commonly used clause with a rarely
used one. By breaking it up the rarely used clause can be grouped
together with the other functions guarded by the common clause.

By removing the spaces the clause grouping algorithm was able to merge
together more of the functions and reduce the total number of guard
clauses in the file.


Compare: https://github.com/Perl/perl5/compare/261177d3863b...26b449e76008



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