summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-26 16:07:20 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-26 16:07:20 +0000
commit339049b035d3e07ff8c7f574dac68f06816b9af2 (patch)
treee9a629e87321d08b52b8b6e9a05e24c33805ce30 /sv.h
parent42a116590b56a49035a440a6b0f3a679f91e9375 (diff)
downloadperl-339049b035d3e07ff8c7f574dac68f06816b9af2.tar.gz
Rename the members of the SV head union to avoid pre-processor
arguments with embed.h p4raw-id: //depot/perl@24590
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h102
1 files changed, 51 insertions, 51 deletions
diff --git a/sv.h b/sv.h
index 69aad463ad..1533fb92ba 100644
--- a/sv.h
+++ b/sv.h
@@ -69,11 +69,11 @@ struct STRUCT_SV { /* struct sv { */
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
union {
- IV sv_iv;
- UV sv_uv;
- SV* sv_rv; /* pointer to another SV */
- char* sv_pv; /* pointer to malloced string */
- SV** sv_array;
+ IV svu_iv;
+ UV svu_uv;
+ SV* svu_rv; /* pointer to another SV */
+ char* svu_pv; /* pointer to malloced string */
+ SV** svu_array;
} sv_u;
#ifdef DEBUG_LEAKING_SCALARS
unsigned sv_debug_optype:9; /* the type of OP that allocated us */
@@ -89,11 +89,11 @@ struct gv {
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
union {
- IV sv_iv;
- UV sv_uv;
- SV* sv_rv;
- char* sv_pv;
- SV** sv_array;
+ IV svu_iv;
+ UV svu_uv;
+ SV* svu_rv;
+ char* svu_pv;
+ SV** svu_array;
} sv_u;
};
@@ -102,11 +102,11 @@ struct cv {
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
union {
- IV sv_iv;
- UV sv_uv;
- SV* sv_rv;
- char* sv_pv;
- SV** sv_array;
+ IV svu_iv;
+ UV svu_uv;
+ SV* svu_rv;
+ char* svu_pv;
+ SV** svu_array;
} sv_u;
};
@@ -115,11 +115,11 @@ struct av {
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
union {
- IV sv_iv;
- UV sv_uv;
- SV* sv_rv;
- char* sv_pv; /* pointer to first array element */
- SV** sv_array;
+ IV svu_iv;
+ UV svu_uv;
+ SV* svu_rv;
+ char* svu_pv; /* pointer to first array element */
+ SV** svu_array;
} sv_u;
};
@@ -128,11 +128,11 @@ struct hv {
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
union {
- IV sv_iv;
- UV sv_uv;
- SV* sv_rv;
- char* sv_pv;
- SV** sv_array;
+ IV svu_iv;
+ UV svu_uv;
+ SV* svu_rv;
+ char* svu_pv;
+ SV** svu_array;
} sv_u;
};
@@ -141,11 +141,11 @@ struct io {
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
union {
- IV sv_iv;
- UV sv_uv;
- SV* sv_rv;
- char* sv_pv;
- SV** sv_array;
+ IV svu_iv;
+ UV svu_uv;
+ SV* svu_rv;
+ char* svu_pv;
+ SV** svu_array;
} sv_u;
};
@@ -276,7 +276,7 @@ perform the upgrade if necessary. See C<svtype>.
struct xpv {
IV xpv_dummy; /* This isn't allocated. */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
};
@@ -284,26 +284,26 @@ struct xpv {
typedef struct xpv xpv_allocated;
#else
typedef struct {
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
} xpv_allocated;
#endif
struct xpviv {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
};
struct xpvuv {
UV xuv_uv; /* unsigned value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
};
struct xpvnv {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -322,7 +322,7 @@ struct xpvnv {
/* These structure must match the beginning of struct xpvhv in hv.h. */
struct xpvmg {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -340,7 +340,7 @@ struct xpvmg {
struct xpvlv {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -371,7 +371,7 @@ struct xpvlv {
struct xpvgv {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -395,7 +395,7 @@ struct xpvgv {
struct xpvbm {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -421,7 +421,7 @@ typedef U16 cv_flags_t;
struct xpvfm {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -455,7 +455,7 @@ struct xpvfm {
struct xpvio {
IV xiv_iv; /* integer value or pv offset */
- STRLEN xpv_cur; /* length of sv_pv as a C string */
+ STRLEN xpv_cur; /* length of svu_pv as a C string */
STRLEN xpv_len; /* allocated size */
union {
struct {
@@ -865,9 +865,9 @@ in gv.h: */
#endif
#ifdef PERL_DEBUG_COW
-#define SvRV(sv) (0 + (sv)->sv_u.sv_rv)
+#define SvRV(sv) (0 + (sv)->sv_u.svu_rv)
#else
-#define SvRV(sv) ((sv)->sv_u.sv_rv)
+#define SvRV(sv) ((sv)->sv_u.svu_rv)
#endif
#define SvRVx(sv) SvRV(sv)
@@ -875,10 +875,10 @@ in gv.h: */
#define SvIVX(sv) (0 + ((XPVIV*) SvANY(sv))->xiv_iv)
#define SvUVX(sv) (0 + ((XPVUV*) SvANY(sv))->xuv_uv)
#define SvNVX(sv) (0 + ((XPVNV*) SvANY(sv))->xnv_nv)
-#define SvPVX(sv) (0 + (sv)->sv_u.sv_pv)
+#define SvPVX(sv) (0 + (sv)->sv_u.svu_pv)
#define SvCUR(sv) (0 + ((XPV*) SvANY(sv))->xpv_cur)
#define SvLEN(sv) (0 + ((XPV*) SvANY(sv))->xpv_len)
-#define SvEND(sv) ((sv)->sv_u.sv_pv + ((XPV*)SvANY(sv))->xpv_cur)
+#define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur)
#ifdef DEBUGGING
# ifdef PERL_IN_SV_C
@@ -900,10 +900,10 @@ in gv.h: */
#define SvIVX(sv) ((XPVIV*) SvANY(sv))->xiv_iv
#define SvUVX(sv) ((XPVUV*) SvANY(sv))->xuv_uv
#define SvNVX(sv) ((XPVNV*) SvANY(sv))->xnv_nv
-#define SvPVX(sv) ((sv)->sv_u.sv_pv)
+#define SvPVX(sv) ((sv)->sv_u.svu_pv)
#define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur
#define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len
-#define SvEND(sv) ((sv)->sv_u.sv_pv + ((XPV*)SvANY(sv))->xpv_cur)
+#define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur)
#ifdef DEBUGGING
#define SvMAGIC(sv) (*(assert(SvTYPE(sv) >= SVt_PVMG), &((XPVMG*) SvANY(sv))->xmg_magic))
@@ -937,13 +937,13 @@ in gv.h: */
(((XPVNV*)SvANY(sv))->xnv_nv = (val)); } STMT_END
#define SvPV_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
- ((sv)->sv_u.sv_pv = (val)); } STMT_END
+ ((sv)->sv_u.svu_pv = (val)); } STMT_END
#define SvUV_set(sv, val) \
STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
(((XPVUV*)SvANY(sv))->xuv_uv = (val)); } STMT_END
#define SvRV_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
- ((sv)->sv_u.sv_rv = (val)); } STMT_END
+ ((sv)->sv_u.svu_rv = (val)); } STMT_END
#define SvMAGIC_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
(((XPVMG*)SvANY(sv))->xmg_magic = (val)); } STMT_END
@@ -1267,7 +1267,7 @@ Like C<sv_catsv> but doesn't process magic.
? (({XPV *nxpv = (XPV*)SvANY(sv); \
nxpv && \
(nxpv->xpv_cur > 1 || \
- (nxpv->xpv_cur && *(sv)->sv_u.sv_pv != '0')); }) \
+ (nxpv->xpv_cur && *(sv)->sv_u.svu_pv != '0')); }) \
? 1 \
: 0) \
: \
@@ -1295,7 +1295,7 @@ Like C<sv_catsv> but doesn't process magic.
: SvPOK(sv) \
? ((PL_Xpv = (XPV*)SvANY(PL_Sv = (sv))) && \
(PL_Xpv->xpv_cur > 1 || \
- (PL_Xpv->xpv_cur && *PL_Sv->sv_u.sv_pv != '0')) \
+ (PL_Xpv->xpv_cur && *PL_Sv->sv_u.svu_pv != '0')) \
? 1 \
: 0) \
: \