-
Notifications
You must be signed in to change notification settings - Fork 596
Remove most #ifdef DOINIT #23778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
khwilliamson
wants to merge
14
commits into
Perl:blead
Choose a base branch
from
khwilliamson:INIT_api
base: blead
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Remove most #ifdef DOINIT #23778
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
None of the affected code is in EBCDIC platforms; by making that the outermost #ifdef, we can eliminate some nesting
Most of the tables defined here can use INIT() instead of the more clumsy #ifdef DOINIT..#else..#endif sequences. The one that can't has #ifdef's in its initialization, so can't be initialized with INIT().
This removes some DOINITs
By changing its regenerating program regcomp.pl
And avoid the more clumsy DOINITs
and not DOINIT
by changing regen/opcode.pl
There are no tables currently generated by this file that are affected, however.
I'm uncertain about the other DOINIT use in this file.
0af1f3e
to
d9e77e0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Use merge commit
Don't merge this p.r. from github It contains multiple related commits. Instructions in perlgit
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that I have documented
INIT
and kin in #23742, I realize that I and others have failed to realize its usefulness in removing most needs for using the#ifdef DOINIT ... #else ... #endif
paradigm that requires repetitive lines, and makes things harder to read.
The only cases I found for needing the directives are when the initialization requires preprocessor directives itself. One such case is where it
#include
s a file.This p.r. is a series of commits that convert
DOINIT
conditionals intoINIT