summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-04-30 18:26:09 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-05-10 12:07:13 +0000
commit25da4f389200e19df8aa50bcef9af9506f48ed2e (patch)
tree65b30771e2788ce1648d3a92a6cb6ca63f48ca23 /sv.h
parenta1bd196e40598e773ccd679fc8778a94de7814af (diff)
downloadperl-25da4f389200e19df8aa50bcef9af9506f48ed2e.tar.gz
Self-consistent numeric conversion again
Message-Id: <199905010226.WAA19127@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@3378
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/sv.h b/sv.h
index 92e9207e5d..533b4c4a46 100644
--- a/sv.h
+++ b/sv.h
@@ -153,11 +153,15 @@ struct io {
/* Some private flags. */
-#define SVpfm_COMPILED 0x80000000
+#define SVf_IVisUV 0x80000000 /* use XPVUV instead of XPVIV */
+
+#define SVpfm_COMPILED 0x80000000 /* FORMLINE is compiled */
#define SVpbm_VALID 0x80000000
#define SVpbm_TAIL 0x40000000
+#define SVrepl_EVAL 0x40000000 /* Replacement part of s///e */
+
#define SVphv_SHAREKEYS 0x20000000 /* keys live on shared string table */
#define SVphv_LAZYDEL 0x40000000 /* entry in xhv_eiter must be deleted */
@@ -320,10 +324,13 @@ struct xpvio {
#define SvNIOK(sv) (SvFLAGS(sv) & (SVf_IOK|SVf_NOK))
#define SvNIOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK))
#define SvNIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| \
- SVp_IOK|SVp_NOK))
+ SVp_IOK|SVp_NOK|SVf_IVisUV))
#define SvOK(sv) (SvFLAGS(sv) & SVf_OK)
-#define SvOK_off(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC), \
+#define SvOK_off(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC| \
+ SVf_IVisUV), \
+ SvOOK_off(sv))
+#define SvOK_off_exc_UV(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC), \
SvOOK_off(sv))
#define SvOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK))
@@ -337,9 +344,20 @@ struct xpvio {
#define SvIOK(sv) (SvFLAGS(sv) & SVf_IOK)
#define SvIOK_on(sv) (SvOOK_off(sv), \
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
-#define SvIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVp_IOK))
+#define SvIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVp_IOK|SVf_IVisUV))
#define SvIOK_only(sv) (SvOK_off(sv), \
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
+#define SvIOK_only_UV(sv) (SvOK_off_exc_UV(sv), \
+ SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
+
+#define SvIOK_UV(sv) ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
+ == (SVf_IOK|SVf_IVisUV))
+#define SvIOK_notUV(sv) ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
+ == SVf_IOK)
+
+#define SvIsUV(sv) (SvFLAGS(sv) & SVf_IVisUV)
+#define SvIsUV_on(sv) (SvFLAGS(sv) |= SVf_IVisUV)
+#define SvIsUV_off(sv) (SvFLAGS(sv) &= ~SVf_IVisUV)
#define SvNOK(sv) (SvFLAGS(sv) & SVf_NOK)
#define SvNOK_on(sv) (SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
@@ -350,7 +368,7 @@ struct xpvio {
#define SvPOK(sv) (SvFLAGS(sv) & SVf_POK)
#define SvPOK_on(sv) (SvFLAGS(sv) |= (SVf_POK|SVp_POK))
#define SvPOK_off(sv) (SvFLAGS(sv) &= ~(SVf_POK|SVp_POK))
-#define SvPOK_only(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC), \
+#define SvPOK_only(sv) (SvFLAGS(sv) &= ~(SVf_OK|SVf_AMAGIC|SVf_IVisUV), \
SvFLAGS(sv) |= (SVf_POK|SVp_POK))
#define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK)
@@ -423,6 +441,10 @@ struct xpvio {
#define SvCOMPILED_on(sv) (SvFLAGS(sv) |= SVpfm_COMPILED)
#define SvCOMPILED_off(sv) (SvFLAGS(sv) &= ~SVpfm_COMPILED)
+#define SvEVALED(sv) (SvFLAGS(sv) & SVrepl_EVAL)
+#define SvEVALED_on(sv) (SvFLAGS(sv) |= SVrepl_EVAL)
+#define SvEVALED_off(sv) (SvFLAGS(sv) &= ~SVrepl_EVAL)
+
#define SvTAIL(sv) (SvFLAGS(sv) & SVpbm_TAIL)
#define SvTAIL_on(sv) (SvFLAGS(sv) |= SVpbm_TAIL)
#define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL)
@@ -522,12 +544,13 @@ struct xpvio {
#define SvIV(sv) SvIVx(sv)
#define SvNV(sv) SvNVx(sv)
-#define SvUV(sv) SvIVx(sv)
+#define SvUV(sv) SvUVx(sv)
#define SvTRUE(sv) SvTRUEx(sv)
#ifndef CRIPPLED_CC
/* redefine some things to more efficient inlined versions */
+/* Let us hope that bitmaps for UV and IV are the same */
#undef SvIV
#define SvIV(sv) (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv))