-
Notifications
You must be signed in to change notification settings - Fork 571
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
[PATCH] Cleanup PERL_VERSION checks in .c files #15710
Comments
From @atoomicCreated by @atoomicThis commit is removing code not exercised by blead Perl Info
|
From @atoomic0001-Cleanup-PERL_VERSION-checks-in-.c-files.patchFrom d60f4b9eba0447c686d0b9cc5ad93f74146d9833 Mon Sep 17 00:00:00 2001
From: Nicolas R <atoomic@cpan.org>
Date: Sun, 13 Nov 2016 02:16:23 -0700
Subject: [PATCH] Cleanup PERL_VERSION checks in .c files
This commit is removing code not exercised by blead
or any later versions using PERL_VERSION.
This is a noop, mainly cleaning code.
---
regexec.c | 7 -------
universal.c | 5 -----
vutil.c | 28 ----------------------------
3 files changed, 40 deletions(-)
diff --git a/regexec.c b/regexec.c
index 6c5ce9f..c54c159 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3694,9 +3694,6 @@ Perl_re_exec_indentf(pTHX_ const char *fmt, U32 depth, ...)
STATIC regmatch_state *
S_push_slab(pTHX)
{
-#if PERL_VERSION < 9 && !defined(PERL_CORE)
- dMY_CXT;
-#endif
regmatch_slab *s = PL_regmatch_slab->next;
if (!s) {
Newx(s, 1, regmatch_slab);
@@ -5328,10 +5325,6 @@ S_backup_one_WB(pTHX_ WB_enum * previous, const U8 * const strbeg, U8 ** curpos,
STATIC SSize_t
S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
{
-
-#if PERL_VERSION < 9 && !defined(PERL_CORE)
- dMY_CXT;
-#endif
dVAR;
const bool utf8_target = reginfo->is_utf8_target;
const U32 uniflags = UTF8_ALLOW_DEFAULT;
diff --git a/universal.c b/universal.c
index b88d3e2..a9d7514 100644
--- a/universal.c
+++ b/universal.c
@@ -965,12 +965,7 @@ XS(XS_re_regexp_pattern)
} else {
/* Scalar, so use the string that Perl would return */
/* return the pattern in (?msixn:..) format */
-#if PERL_VERSION >= 11
pattern = sv_2mortal(newSVsv(MUTABLE_SV(re)));
-#else
- pattern = newSVpvn_flags(RX_WRAPPED(re), RX_WRAPLEN(re),
- (RX_UTF8(re) ? SVf_UTF8 : 0) | SVs_TEMP);
-#endif
PUSHs(pattern);
XSRETURN(1);
}
diff --git a/vutil.c b/vutil.c
index bd51707..32fa663 100644
--- a/vutil.c
+++ b/vutil.c
@@ -576,9 +576,6 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
const MAGIC *mg;
#endif
-#if PERL_VERSION_LT(5,19,8) && defined(USE_ITHREADS)
- ENTER;
-#endif
PERL_ARGS_ASSERT_UPG_VERSION;
if ( (SvUOK(ver) && SvUVX(ver) > VERSION_MAX)
@@ -593,17 +590,11 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
"Integer overflow in version %d",VERSION_MAX);
}
else if ( SvUOK(ver) || SvIOK(ver))
-#if PERL_VERSION_LT(5,17,2)
-VER_IV:
-#endif
{
version = savesvpv(ver);
SAVEFREEPV(version);
}
else if (SvNOK(ver) && !( SvPOK(ver) && SvCUR(ver) == 3 ) )
-#if PERL_VERSION_LT(5,17,2)
-VER_NV:
-#endif
{
STRLEN len;
@@ -612,12 +603,10 @@ VER_NV:
SV *sv = SvNVX(ver) > 10e50 ? newSV(64) : 0;
char *buf;
-#if PERL_VERSION_GE(5,19,0)
if (SvPOK(ver)) {
/* dualvar? */
goto VER_PV;
}
-#endif
#ifdef USE_LOCALE_NUMERIC
{
@@ -686,7 +675,6 @@ VER_PV:
version = savepvn(SvPV(ver,len), SvCUR(ver));
SAVEFREEPV(version);
#ifndef SvVOK
-# if PERL_VERSION > 5
/* This will only be executed for 5.6.0 - 5.8.0 inclusive */
if ( len >= 3 && !instr(version,".") && !instr(version,"_")) {
/* may be a v-string */
@@ -719,20 +707,8 @@ VER_PV:
}
}
}
-# endif
#endif
}
-#if PERL_VERSION_LT(5,17,2)
- else if (SvIOKp(ver)) {
- goto VER_IV;
- }
- else if (SvNOKp(ver)) {
- goto VER_NV;
- }
- else if (SvPOKp(ver)) {
- goto VER_PV;
- }
-#endif
else
{
/* no idea what this is */
@@ -745,10 +721,6 @@ VER_PV:
"Version string '%s' contains invalid data; "
"ignoring: '%s'", version, s);
-#if PERL_VERSION_LT(5,19,8) && defined(USE_ITHREADS)
- LEAVE;
-#endif
-
return ver;
}
--
2.10.2
|
From @tonycozOn Sun, 13 Nov 2016 01:42:29 -0800, atoomic@cpan.org wrote:
vutil.c (as it says at the top) is meant to match the vutil/vutil.c The other changes seem sane though. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @atoomicSorry missed this I assume I do not need to provide an updated patch. As On Mon, Nov 14, 2016 at 01:38 Tony Cook via RT <perlbug-followup@perl.org>
|
From @atoomicUpdated patch without vutil.c changes On Sun, 13 Nov 2016 16:41:24 -0800, atoomic@cpan.org wrote:
|
From @atoomic0001-Cleanup-PERL_VERSION-checks-in-.c-files.patchFrom d058799276347ecf23ab4f86b7a3dfaa5e43699a Mon Sep 17 00:00:00 2001
From: Nicolas R <atoomic@cpan.org>
Date: Sun, 13 Nov 2016 02:16:23 -0700
Subject: [PATCH 1/1] Cleanup PERL_VERSION checks in .c files
This commit is removing code not exercised by blead
or any later versions using PERL_VERSION.
This is a noop, mainly cleaning code.
---
regexec.c | 7 -------
universal.c | 5 -----
2 files changed, 12 deletions(-)
diff --git a/regexec.c b/regexec.c
index 6c5ce9f..c54c159 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3694,9 +3694,6 @@ Perl_re_exec_indentf(pTHX_ const char *fmt, U32 depth, ...)
STATIC regmatch_state *
S_push_slab(pTHX)
{
-#if PERL_VERSION < 9 && !defined(PERL_CORE)
- dMY_CXT;
-#endif
regmatch_slab *s = PL_regmatch_slab->next;
if (!s) {
Newx(s, 1, regmatch_slab);
@@ -5328,10 +5325,6 @@ S_backup_one_WB(pTHX_ WB_enum * previous, const U8 * const strbeg, U8 ** curpos,
STATIC SSize_t
S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
{
-
-#if PERL_VERSION < 9 && !defined(PERL_CORE)
- dMY_CXT;
-#endif
dVAR;
const bool utf8_target = reginfo->is_utf8_target;
const U32 uniflags = UTF8_ALLOW_DEFAULT;
diff --git a/universal.c b/universal.c
index b88d3e2..a9d7514 100644
--- a/universal.c
+++ b/universal.c
@@ -965,12 +965,7 @@ XS(XS_re_regexp_pattern)
} else {
/* Scalar, so use the string that Perl would return */
/* return the pattern in (?msixn:..) format */
-#if PERL_VERSION >= 11
pattern = sv_2mortal(newSVsv(MUTABLE_SV(re)));
-#else
- pattern = newSVpvn_flags(RX_WRAPPED(re), RX_WRAPLEN(re),
- (RX_UTF8(re) ? SVf_UTF8 : 0) | SVs_TEMP);
-#endif
PUSHs(pattern);
XSRETURN(1);
}
--
2.10.2
|
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#130082 (status was 'resolved')
Searchable as RT130082$
The text was updated successfully, but these errors were encountered: