_qq pack.t Re: [PATCH] tests for hash assignment
[p5sagit/p5-mst-13.2.git] / hv.h
diff --git a/hv.h b/hv.h
index a1652d8..3475c87 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -58,13 +58,13 @@ struct xpvhv {
        } \
        hash_PeRlHaSh += (hash_PeRlHaSh << 3); \
        hash_PeRlHaSh ^= (hash_PeRlHaSh >> 11); \
-       (hash) = (hash_PeRlHaSh += (hash_PeRlHaSh << 15)); \
+       (hash) = (hash_PeRlHaSh + (hash_PeRlHaSh << 15)); \
     } STMT_END
 
 /*
 =for apidoc AmU||HEf_SVKEY
 This flag, used in the length slot of hash entries and magic structures,
-specifies the structure contains a C<SV*> pointer where a C<char*> pointer
+specifies the structure contains an C<SV*> pointer where a C<char*> pointer
 is to be expected. (For information only--not to be used).
 
 =for apidoc AmU||Nullhv
@@ -119,11 +119,11 @@ C<SV*>.
 */
 
 /* these hash entry flags ride on hent_klen (for use only in magic/tied HVs) */
-#define HEf_SVKEY      -2      /* hent_key is a SV* */
+#define HEf_SVKEY      -2      /* hent_key is an SV* */
 
 
 #define Nullhv Null(HV*)
-#define HvARRAY(hv)    ((HE**)((XPVHV*)  SvANY(hv))->xhv_array)
+#define HvARRAY(hv)    (*(HE***)&((XPVHV*)  SvANY(hv))->xhv_array)
 #define HvFILL(hv)     ((XPVHV*)  SvANY(hv))->xhv_fill
 #define HvMAX(hv)      ((XPVHV*)  SvANY(hv))->xhv_max
 #define HvKEYS(hv)     ((XPVHV*)  SvANY(hv))->xhv_keys
@@ -197,3 +197,7 @@ C<SV*>.
                         ? (size) * sizeof(HE*)                         \
                         : (size) * sizeof(HE*) * 2 - MALLOC_OVERHEAD)
 #endif
+
+/* available as a function in hv.c */
+#define Perl_sharepvn(sv, len, hash) HEK_KEY(share_hek(sv, len, hash))
+#define sharepvn(sv, len, hash)             Perl_sharepvn(sv, len, hash)