cvs commit: ponie/src/pmc perl5cargo_cult.pmc
[email protected] (Nicholas Clark) 14 Oct 2004 17:11:00 -0000
| Newsgroups | perl.ponie.changes |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 04/10/14 10:11:00
Modified: perl sv.h
src/pmc perl5cargo_cult.pmc
Log:
Move simple POK flags to PMC
Revision Changes Path
1.30 +8 -7 ponie/perl/sv.h
Index: sv.h
===================================================================
RCS file: /cvs/public/ponie/perl/sv.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- sv.h 14 Oct 2004 15:51:37 -0000 1.29
+++ sv.h 14 Oct 2004 17:11:00 -0000 1.30
@@ -434,6 +434,9 @@
Ponie_I_SVf_NOK,
Ponie_I_SVp_NOK,
Ponie_I_SVpf_NOK,
+ Ponie_I_SVf_POK,
+ Ponie_I_SVp_POK,
+ Ponie_I_SVpf_POK,
Ponie_I_MAX
} Ponie_integers;
@@ -592,9 +595,8 @@
#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))
#define SvNOKp_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_NOK, 1)
-#define SvPOKp(sv) (SvFLAGS(sv) & SVp_POK)
-#define SvPOKp_on(sv) (assert_not_ROK(sv) \
- SvFLAGS(sv) |= SVp_POK)
+#define SvPOKp(sv) ((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_POK))
+#define SvPOKp_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVp_POK, 1)
#define SvIOK(sv) ((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVf_IOK))
#define SvIOK_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVpf_IOK, 1)
@@ -642,10 +644,9 @@
#define SvUTF8_on(sv) (SvFLAGS(sv) |= (SVf_UTF8))
#define SvUTF8_off(sv) (SvFLAGS(sv) &= ~(SVf_UTF8))
-#define SvPOK(sv) (SvFLAGS(sv) & SVf_POK)
-#define SvPOK_on(sv) (assert_not_ROK(sv) \
- SvFLAGS(sv) |= (SVf_POK|SVp_POK))
-#define SvPOK_off(sv) (SvFLAGS(sv) &= ~(SVf_POK|SVp_POK))
+#define SvPOK(sv) ((U32)Parrot_PMC_get_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVf_POK))
+#define SvPOK_on(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVpf_POK, 1)
+#define SvPOK_off(sv) Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SVpf_POK, 0)
#define SvPOK_only(sv) (assert_not_ROK(sv) \
SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \
SVf_IVisUV|SVf_UTF8), \
1.19 +38 -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.18
retrieving revision 1.19
diff -u -w -r1.18 -r1.19
--- perl5cargo_cult.pmc 14 Oct 2004 15:51:37 -0000 1.18
+++ perl5cargo_cult.pmc 14 Oct 2004 17:11:00 -0000 1.19
@@ -1,7 +1,7 @@
/* Perl5QQQ.pmc -*- c -*-
* Copyright: 2001-2004 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: perl5cargo_cult.pmc,v 1.18 2004/10/14 15:51:37 nicholas Exp $
+ * $Id: perl5cargo_cult.pmc,v 1.19 2004/10/14 17:11:00 nicholas Exp $
* Overview:
* These are the vtable functions for the Perl5QQQ base class
* Data Structure and Algorithms:
@@ -96,6 +96,17 @@
case Ponie_I_SVpf_NOK:
return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
& (SVf_NOK|SVf_NOK);
+
+ case Ponie_I_SVp_POK:
+ return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
+ & SVp_POK;
+ case Ponie_I_SVf_POK:
+ return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
+ & SVf_POK;
+ case Ponie_I_SVpf_POK:
+ return ((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags
+ & (SVf_POK|SVf_POK);
+
default:
croak ("Out of range or illegal key %d (max is %d) "
" in get_integer_keyed_int", key, Ponie_P_MAX - 1);
@@ -175,6 +186,32 @@
(((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
|= (SVp_NOK|SVf_NOK);
return;
+
+
+ case Ponie_I_SVp_POK:
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags) &= ~SVp_POK;
+ if (value) {
+ assert_not_ROK(MUMBLE(SELF)) 0;
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
+ |= SVp_POK;
+ }
+ return;
+ case Ponie_I_SVf_POK:
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags) &= ~SVf_POK;
+ if (value) {
+ assert_not_ROK(MUMBLE(SELF)) 0;
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
+ |= SVf_POK;
+ }
+ return;
+ case Ponie_I_SVpf_POK:
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
+ &= ~(SVp_POK|SVf_POK);
+ if (value)
+ (((struct STRUCT_SV *)PMC_struct_val(SELF))->sv_flags)
+ |= (SVp_POK|SVf_POK);
+ return;
+
default:
croak ("Out of range or illegal key %d (max is %d)"
" in get_integer_keyed_int", key, Ponie_P_MAX - 1);