From 931b58fb28fa5ca73161678109fa052134ce70b3 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 28 Dec 2006 22:03:56 +0000 Subject: [PATCH] Move PAD_COMPNAME_GEN from SvCUR to SvUVX. p4raw-id: //depot/perl@29632 --- op.c | 2 +- pad.c | 4 +--- pad.h | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/op.c b/op.c index 8aca413..814c5e2 100644 --- a/op.c +++ b/op.c @@ -3818,7 +3818,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right) * that value, we know we've got commonality. We could use a * single bit marker, but then we'd have to make 2 passes, first * to clear the flag, then to test and set it. To find somewhere - * to store these values, evil chicanery is done with SvCUR(). + * to store these values, evil chicanery is done with SvUVX(). */ { diff --git a/pad.c b/pad.c index 67913b0..cae1c02 100644 --- a/pad.c +++ b/pad.c @@ -76,7 +76,7 @@ xlow+1..xhigh inclusive in the NV union is a range of cop_seq numbers for which the name is valid. For typed lexicals name SV is SVt_PVMG and SvSTASH points at the type. For C lexicals, the type is also SVt_PVMG, with the OURSTASH slot pointing at the stash of the associated global (so that -duplicate C declarations in the same package can be detected). SvCUR is +duplicate C declarations in the same package can be detected). SvUVX is sometimes hijacked to store the generation number during compilation. If SvFAKE is set on the name SV, then that slot in the frame AV is @@ -417,8 +417,6 @@ for a slot which has no name and no active value. /* And flag whether the incoming name is UTF8 or 8 bit? Could do this either with the +ve/-ve hack of the HV code, or expanding the flag bits. Either way, this makes proper Unicode safe pad support. - Also could change the sv structure to make the NV a union with 2 U32s, - so that SvCUR() could stop being overloaded in pad SVs. NWC */ diff --git a/pad.h b/pad.h index 44e9385..6e06955 100644 --- a/pad.h +++ b/pad.h @@ -276,11 +276,11 @@ Assumes the slot entry is a valid C lexical. =for apidoc m|STRLEN|PAD_COMPNAME_GEN|PADOFFSET po The generation number of the name at offset C in the current -compiling pad (lvalue). Note that C is hijacked for this purpose. +compiling pad (lvalue). Note that C is hijacked for this purpose. =for apidoc m|STRLEN|PAD_COMPNAME_GEN_set|PADOFFSET po|int gen Sets the generation number of the name at offset C in the current -ling pad (lvalue) to C. Note that C is hijacked for this purpose. +ling pad (lvalue) to C. Note that C is hijacked for this purpose. =cut @@ -296,9 +296,9 @@ ling pad (lvalue) to C. Note that C is hijacked for this purpos #define PAD_COMPNAME_OURSTASH(po) \ (OURSTASH(*av_fetch(PL_comppad_name, (po), FALSE))) -#define PAD_COMPNAME_GEN(po) SvCUR(AvARRAY(PL_comppad_name)[po]) +#define PAD_COMPNAME_GEN(po) ((STRLEN)SvUVX(AvARRAY(PL_comppad_name)[po])) -#define PAD_COMPNAME_GEN_set(po, gen) SvCUR_set(AvARRAY(PL_comppad_name)[po], gen) +#define PAD_COMPNAME_GEN_set(po, gen) SvUV_set(AvARRAY(PL_comppad_name)[po], (UV)(gen)) /* -- 1.8.3.1