This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove union _xivu from struct xpvav - replace it with a non-union xav_alloc.
authorNicholas Clark <nick@ccl4.org>
Mon, 25 Jan 2010 13:55:28 +0000 (13:55 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 21 May 2010 06:03:52 +0000 (07:03 +0100)
This was the only user of xivu_p1 in union _xivu, so remove that too.

av.h
sv.c
sv.h

diff --git a/av.h b/av.h
index f9af3ce..5231c4d 100644 (file)
--- a/av.h
+++ b/av.h
@@ -13,11 +13,9 @@ struct xpvav {
     union _xmgu        xmg_u;
     SSize_t    xav_fill;       /* Index of last element present */
     SSize_t    xav_max;        /* max index for which array has space */
-    union _xivu xiv_u;
+    SV**       xav_alloc;      /* pointer to beginning of C array of SVs */
 };
 
-/* SV**        xav_alloc; */
-#define xav_alloc xiv_u.xivu_p1
 /* SV* xav_arylen; */
 
 /* SVpav_REAL is set for all AVs whose xav_array contents are refcounted.
@@ -59,7 +57,7 @@ Same as C<av_len()>.  Deprecated, use C<av_len()> instead.
 #endif
 
 #define AvARRAY(av)    ((av)->sv_u.svu_array)
-#define AvALLOC(av)    (*((SV***)&((XPVAV*)  SvANY(av))->xav_alloc))
+#define AvALLOC(av)    ((XPVAV*)  SvANY(av))->xav_alloc
 #define AvMAX(av)      ((XPVAV*)  SvANY(av))->xav_max
 #define AvFILLp(av)    ((XPVAV*)  SvANY(av))->xav_fill
 #define AvARYLEN(av)   (*Perl_av_arylen_p(aTHX_ MUTABLE_AV(av)))
diff --git a/sv.c b/sv.c
index 3b332f2..fe3f362 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -976,7 +976,7 @@ static const struct body_details bodies_by_type[] = {
       HASARENA, FIT_ARENA(0, sizeof(XPVLV)) },
 
     { sizeof(XPVAV),
-      copy_length(XPVAV, xiv_u),
+      copy_length(XPVAV, xav_alloc),
       0,
       SVt_PVAV, TRUE, NONV, HASARENA,
       FIT_ARENA(0, sizeof(XPVAV)) },
diff --git a/sv.h b/sv.h
index f88f139..7793e29 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -418,7 +418,6 @@ union _xivu {
     IV     xivu_iv;            /* integer value */
                                /* xpvfm: lines */
     UV     xivu_uv;
-    void *  xivu_p1;
     I32            xivu_i32;
     HEK *   xivu_namehek;      /* xpvlv, xpvgv: GvNAME */
     HV *    xivu_hv;           /* regexp: paren_names */