This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Given that we now have a union, there's no need for all the HvARRAY()
authorNicholas Clark <nick@ccl4.org>
Wed, 17 Aug 2005 09:06:33 +0000 (09:06 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 17 Aug 2005 09:06:33 +0000 (09:06 +0000)
casting games.

p4raw-id: //depot/perl@25297

hv.h
sv.h

diff --git a/hv.h b/hv.h
index 956f949..1ec5d56 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -8,10 +8,6 @@
  *
  */
 
-/* typedefs to eliminate some typing */
-typedef struct he HE;
-typedef struct hek HEK;
-
 /* entry in hash value chain */
 struct he {
     /* Keep hent_next first in this structure, because sv_free_arenas take
@@ -209,7 +205,7 @@ C<SV*>.
 
 
 #define Nullhv Null(HV*)
-#define HvARRAY(hv)    (*(HE***)&((hv)->sv_u.svu_array))
+#define HvARRAY(hv)    ((hv)->sv_u.svu_hash)
 #define HvFILL(hv)     ((XPVHV*)  SvANY(hv))->xhv_fill
 #define HvMAX(hv)      ((XPVHV*)  SvANY(hv))->xhv_max
 /* This quite intentionally does no flag checking first. That's your
diff --git a/sv.h b/sv.h
index 6983f45..003e041 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -62,6 +62,11 @@ typedef enum {
        SVt_PVIO        /* 15 */
 } svtype;
 
+
+/* typedefs to eliminate some typing */
+typedef struct he HE;
+typedef struct hek HEK;
+
 /* Using C's structural equivalence to help emulate C++ inheritance here... */
 
 struct STRUCT_SV {             /* struct sv { */
@@ -74,6 +79,7 @@ struct STRUCT_SV {            /* struct sv { */
        SV*     svu_rv;         /* pointer to another SV */
        char*   svu_pv;         /* pointer to malloced string */
        SV**    svu_array;
+       HE**    svu_hash;
     }          sv_u;
 #ifdef DEBUG_LEAKING_SCALARS
     unsigned   sv_debug_optype:9;      /* the type of OP that allocated us */
@@ -94,6 +100,7 @@ struct gv {
        SV*     svu_rv;
        char*   svu_pv;
        SV**    svu_array;
+       HE**    svu_hash;
     }          sv_u;
 };
 
@@ -107,6 +114,7 @@ struct cv {
        SV*     svu_rv;
        char*   svu_pv;
        SV**    svu_array;
+       HE**    svu_hash;
     }          sv_u;
 };
 
@@ -120,6 +128,7 @@ struct av {
        SV*     svu_rv;
        char*   svu_pv;         /* pointer to first array element */
        SV**    svu_array;
+       HE**    svu_hash;
     }          sv_u;
 };
 
@@ -133,6 +142,7 @@ struct hv {
        SV*     svu_rv;
        char*   svu_pv;
        SV**    svu_array;
+       HE**    svu_hash;
     }          sv_u;
 };
 
@@ -146,6 +156,7 @@ struct io {
        SV*     svu_rv;
        char*   svu_pv;
        SV**    svu_array;
+       HE**    svu_hash;
     }          sv_u;
 };