This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Extraneous warning for (?()A|B)
[perl5.git] / hv.h
diff --git a/hv.h b/hv.h
index 20af4ea..466f33d 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -22,11 +22,12 @@ struct hek {
     char       hek_key[1];
 };
 
+/* This structure must match the beginning of struct xpvmg in sv.h. */
 struct xpvhv {
     char *     xhv_array;      /* pointer to malloced string */
     STRLEN     xhv_fill;       /* how full xhv_array currently is */
     STRLEN     xhv_max;        /* subscript of last element of xhv_array */
-    I32                xhv_keys;       /* how many elements in the array */
+    IV         xhv_keys;       /* how many elements in the array */
     double     xnv_nv;         /* numeric value, if any */
     MAGIC*     xmg_magic;      /* magic for scalar array */
     HV*                xmg_stash;      /* class package */
@@ -44,7 +45,7 @@ struct xpvhv {
        register U32 hash_PeRlHaSh = 0; \
        while (i_PeRlHaSh--) \
            hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
-       (hash) = hash_PeRlHaSh; \
+       (hash) = hash_PeRlHaSh + (hash_PeRlHaSh>>5); \
     } STMT_END
 
 
@@ -109,7 +110,7 @@ struct xpvhv {
                                  HeKEY_sv(he) :                        \
                                  sv_2mortal(newSVpv(HeKEY(he),         \
                                                     HeKLEN(he)))) :    \
-                                &sv_undef)
+                                &PL_sv_undef)
 #define HeSVKEY_set(he,sv)     ((HeKLEN(he) = HEf_SVKEY), (HeKEY_sv(he) = sv))
 
 #define Nullhek Null(HEK*)