cvs commit: ponie/src/pmc perl5cargo_cult.pmc

[email protected] (Nicholas Clark) 14 Oct 2004 15:51:37 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
cvsuser     04/10/14 08:51:37

  Modified:    perl     sv.h
               src/pmc  perl5cargo_cult.pmc
  Log:
  Move more SvOK variants into PMC calls.
  
  Revision  Changes    Path
  1.29      +4 -6      ponie/perl/sv.h
  
  Index: sv.h
  ===================================================================
  RCS file: /cvs/public/ponie/perl/sv.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -w -r1.28 -r1.29
  --- sv.h	14 Oct 2004 14:50:28 -0000	1.28
  +++ sv.h	14 Oct 2004 15:51:37 -0000	1.29
  @@ -422,7 +422,9 @@
   } Ponie_pointers;
   
   typedef enum {
  +  Ponie_I_SVp_OK,
     Ponie_I_SVf_OK,
  +  Ponie_I_SVf_OK_exc_UV,
     Ponie_I_SVf_IOK,
     Ponie_I_SVp_IOK,
     Ponie_I_SVpf_IOK,
  @@ -583,13 +585,9 @@
   
   #define SvOK(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVf_OK))
   #define SvOK_off(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVf_OK, 0)
  +#define SvOK_off_exc_UV(sv)	Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVf_OK_exc_UV, 0)
   
  -#define SvOK_off_exc_UV(sv)	(assert_not_ROK(sv)			\
  -				 SvFLAGS(sv) &=	~(SVf_OK|SVf_AMAGIC|	\
  -						  SVf_UTF8),		\
  -							SvOOK_off(sv))
  -
  -#define SvOKp(sv)		(SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK))
  +#define SvOKp(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_OK))
   #define SvIOKp(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_IOK))
   #define SvIOKp_on(sv)		Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_IOK, 1)
   #define SvNOKp(sv)		((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_NOK))
  
  
  
  1.18      +13 -1     ponie/src/pmc/perl5cargo_cult.pmc
  
  Index: perl5cargo_cult.pmc
  ===================================================================
  RCS file: /cvs/public/ponie/src/pmc/perl5cargo_cult.pmc,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -r1.17 -r1.18
  --- perl5cargo_cult.pmc	14 Oct 2004 14:50:28 -0000	1.17
  +++ perl5cargo_cult.pmc	14 Oct 2004 15:51:37 -0000	1.18
  @@ -1,7 +1,7 @@
   /* Perl5QQQ.pmc -*- c -*-
    *  Copyright: 2001-2004 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: perl5cargo_cult.pmc,v 1.17 2004/10/14 14:50:28 nicholas Exp $
  + *     $Id: perl5cargo_cult.pmc,v 1.18 2004/10/14 15:51:37 nicholas Exp $
    *  Overview:
    *     These are the vtable functions for the Perl5QQQ base class
    *  Data Structure and Algorithms:
  @@ -61,6 +61,9 @@
   
       INTVAL get_integer_keyed_int(INTVAL key) {
   	switch (key) {
  +	case Ponie_I_SVp_OK:
  +	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
  +			 & (SVp_IOK|SVp_NOK|SVp_POK);
   	case Ponie_I_SVf_OK:
   	    return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
   			 & SVf_OK;
  @@ -110,6 +113,15 @@
   		&= ~(SVf_OK|SVf_AMAGIC|SVf_IVisUV|SVf_UTF8);
   	      SvOOK_off(MUMBLE(SELF));
   	    }
  +	case Ponie_I_SVf_OK_exc_UV:
  +	    if (!value) {
  +		/* Only legal thing to do is turn this off.  */
  +	      assert_not_ROK(MUMBLE(SELF)) 0;
  +	      (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
  +		&= ~(SVf_OK|SVf_AMAGIC|SVf_UTF8);
  +	      SvOOK_off(MUMBLE(SELF));
  +	    }
  +
   	case Ponie_I_SVp_IOK:
   	    (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags) &= ~SVp_IOK;
   	    if (value) {