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
Reuse code from defined macro #15901
Comments
From @KES777Created by @KES777Hi. The same code `sv_setuv(PUSHmortal, (UV)(u))` is seen in `mPUSH*` macro. We may reuse it like mPUSHp does $cat 0001-Reuse-defined-macro.patch --- Inline Patchdiff --git a/pp.h b/pp.h
index 3b8f36f..16cb937 100644
--- a/pp.h
+++ b/pp.h
@@ -443,9 +443,9 @@ Does not use C<TARG>. See also C<L</XPUSHu>>, C<L</mPUSHu>> and C<L</PUSHu>>.
#define mXPUSHs(s) XPUSHs(sv_2mortal(s))
#define XPUSHmortal XPUSHs(sv_newmortal())
#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); mPUSHp((p), (l)); } STMT_END
-#define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
-#define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
-#define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
+#define mXPUSHn(n) STMT_START { EXTEND(sp,1); mPUSHn(n); } STMT_END
+#define mXPUSHi(i) STMT_START { EXTEND(sp,1); mPUSHi(i); } STMT_END
+#define mXPUSHu(u) STMT_START { EXTEND(sp,1); mPUSHu(u); } STMT_END
#define SETs(s) (*sp = s)
#define SETTARG STMT_START { SvSETMAGIC(TARG); SETs(TARG); } STMT_END
--
2.7.4 Perl Info
|
From @jkeenanOn Wed, 01 Mar 2017 22:49:57 GMT, kes-kes@yandex.ru wrote:
Converting patch to attachment. -- |
From @jkeenan130893-0001-Reuse-defined-macro.patchFrom 4110fac479be5e7101d800c14ebcd04f1a133863 Mon Sep 17 00:00:00 2001
From: Eugen Konkov <kes-kes@yandex.ru>
Date: Wed, 1 Mar 2017 23:28:04 +0200
Subject: [PATCH] Reuse code from defined macro
---
pp.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pp.h b/pp.h
index 3b8f36f..16cb937 100644
--- a/pp.h
+++ b/pp.h
@@ -443,9 +443,9 @@ Does not use C<TARG>. See also C<L</XPUSHu>>, C<L</mPUSHu>> and C<L</PUSHu>>.
#define mXPUSHs(s) XPUSHs(sv_2mortal(s))
#define XPUSHmortal XPUSHs(sv_newmortal())
#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); mPUSHp((p), (l)); } STMT_END
-#define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
-#define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
-#define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
+#define mXPUSHn(n) STMT_START { EXTEND(sp,1); mPUSHn(n); } STMT_END
+#define mXPUSHi(i) STMT_START { EXTEND(sp,1); mPUSHi(i); } STMT_END
+#define mXPUSHu(u) STMT_START { EXTEND(sp,1); mPUSHu(u); } STMT_END
#define SETs(s) (*sp = s)
#define SETTARG STMT_START { SvSETMAGIC(TARG); SETs(TARG); } STMT_END
--
2.7.4
|
From [Unknown Contact. See original ticket]On Wed, 01 Mar 2017 22:49:57 GMT, kes-kes@yandex.ru wrote:
Converting patch to attachment. -- |
From @jkeenanOn Thu, 02 Mar 2017 01:23:53 GMT, jkeenan wrote:
Post code-freeze, I tried to apply the patch. I had to convert the whitespace before 'STMT' to a hard tab to match the existing code. Once, I started to run 'make', however, I got compiler (gcc) warnings like these: ##### We managed to clean up all compiler warnings during a regular gcc 'make' for perl-5.26.0. So I consider this patch to be a regression and not ready for application. Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
@jkeenan - Status changed from 'open' to 'rejected' |
@iabyn - Status changed from 'rejected' to 'resolved' |
From @iabynOn Thu, Jun 01, 2017 at 08:50:09AM -0700, James E Keenan via RT wrote:
I think something went wrong when you applied the patch - you got left I've applied the patch by hand as v5.27.0-98-g2ca72cb, and it compiles So "thanks, applied". -- |
Migrated from rt.perl.org#130893 (status was 'resolved')
Searchable as RT130893$
The text was updated successfully, but these errors were encountered: