summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-21 11:50:52 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-21 11:50:52 +0000
commit2f8edad0d37e91319b6ba10b3745327ea49c179b (patch)
treee3631bff088c1a90196228cea1088e9035d208e8
parent7df0357e86d252406ff52a5b94e0478fc1ccd1be (diff)
downloadperl-2f8edad0d37e91319b6ba10b3745327ea49c179b.tar.gz
Give G_VOID, G_SCALAR and G_ARRAY the same numeric values as
OPf_WANT_VOID, OPf_WANT_SCALAR and OPf_WANT_LIST. p4raw-id: //depot/perl@33025
-rw-r--r--cop.h20
-rw-r--r--op.h5
-rw-r--r--perl.c5
3 files changed, 16 insertions, 14 deletions
diff --git a/cop.h b/cop.h
index 641fb66ee9..f41e67acec 100644
--- a/cop.h
+++ b/cop.h
@@ -737,20 +737,20 @@ L<perlcall>.
=cut
*/
-#define G_SCALAR 0
-#define G_ARRAY 1
-#define G_VOID 128 /* skip this bit when adding flags below */
-#define G_WANT (128|1)
+#define G_SCALAR 2
+#define G_ARRAY 3
+#define G_VOID 1
+#define G_WANT 3
/* extra flags for Perl_call_* routines */
-#define G_DISCARD 2 /* Call FREETMPS.
+#define G_DISCARD 4 /* Call FREETMPS.
Don't change this without consulting the
hash actions codes defined in hv.h */
-#define G_EVAL 4 /* Assume eval {} around subroutine call. */
-#define G_NOARGS 8 /* Don't construct a @_ array. */
-#define G_KEEPERR 16 /* Append errors to $@, don't overwrite it */
-#define G_NODEBUG 32 /* Disable debugging at toplevel. */
-#define G_METHOD 64 /* Calling method. */
+#define G_EVAL 8 /* Assume eval {} around subroutine call. */
+#define G_NOARGS 16 /* Don't construct a @_ array. */
+#define G_KEEPERR 32 /* Append errors to $@, don't overwrite it */
+#define G_NODEBUG 64 /* Disable debugging at toplevel. */
+#define G_METHOD 128 /* Calling method. */
#define G_FAKINGEVAL 256 /* Faking an eval context for call_sv or
fold_constants. */
diff --git a/op.h b/op.h
index fa1230d544..63390ea196 100644
--- a/op.h
+++ b/op.h
@@ -70,10 +70,7 @@
((op)->op_flags & OPf_WANT) == OPf_WANT_LIST ? G_ARRAY : \
dfl)
-#define OP_GIMME_REVERSE(flags) \
- ((flags & G_VOID) ? OPf_WANT_VOID : \
- (flags & G_ARRAY) ? OPf_WANT_LIST : \
- OPf_WANT_SCALAR)
+#define OP_GIMME_REVERSE(flags) ((flags) & G_WANT)
/*
=head1 "Gimme" Values
diff --git a/perl.c b/perl.c
index 7dc6d14a2e..907f9cf8e4 100644
--- a/perl.c
+++ b/perl.c
@@ -2578,6 +2578,11 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
ENTER;
SAVETMPS;
}
+ if (!(flags & G_WANT)) {
+ /* Backwards compatibility - as G_SCALAR was 0, it could be omitted.
+ */
+ flags |= G_SCALAR;
+ }
Zero(&myop, 1, LOGOP);
myop.op_next = NULL;