This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
hash key code cleanup
authorNicholas Clark <nick@ccl4.org>
Sat, 11 Jun 2005 18:01:32 +0000 (18:01 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 11 Jun 2005 18:01:32 +0000 (18:01 +0000)
p4raw-id: //depot/perl@24803

embed.fnc
hv.c
hv.h
proto.h

index 7d51db5..b40a204 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -997,7 +997,7 @@ sR  |HE*    |new_he
 s      |void   |del_he         |NN HE *p
 sR     |HEK*   |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
 s      |void   |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
-s      |void   |unshare_hek_or_pvn|HEK* hek|const char* str|I32 len|U32 hash
+s      |void   |unshare_hek_or_pvn|const HEK* hek|const char* str|I32 len|U32 hash
 sR     |HE*    |share_hek_flags|const char* sv|I32 len|U32 hash|int flags
 rs     |void   |hv_notallowed  |int flags|NN const char *key|I32 klen|NN const char *msg
 s      |struct xpvhv_aux*|hv_auxinit|HV *hv
diff --git a/hv.c b/hv.c
index 2b00650..556996e 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -2149,7 +2149,7 @@ Perl_unshare_hek(pTHX_ HEK *hek)
    are used.  If so, len and hash must both be valid for str.
  */
 STATIC void
-S_unshare_hek_or_pvn(pTHX_ HEK *hek, const char *str, I32 len, U32 hash)
+S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash)
 {
     register XPVHV* xhv;
     register HE *entry;
diff --git a/hv.h b/hv.h
index a8f9b80..3115dba 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -39,8 +39,6 @@ struct xpvhv_aux {
     I32                xhv_riter;      /* current root of iterator */
 };
 
-#define HV_AUX_SIZE STRUCT_OFFSET(struct xpvhv_aux, xhv_array)
-
 /* hash structure: */
 /* This structure must match the beginning of struct xpvmg in sv.h. */
 struct xpvhv {
diff --git a/proto.h b/proto.h
index 2f5918a..779457d 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -1874,7 +1874,7 @@ STATIC void       S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC void    S_unshare_hek_or_pvn(pTHX_ HEK* hek, const char* str, I32 len, U32 hash);
+STATIC void    S_unshare_hek_or_pvn(pTHX_ const HEK* hek, const char* str, I32 len, U32 hash);
 STATIC HE*     S_share_hek_flags(pTHX_ const char* sv, I32 len, U32 hash, int flags)
                        __attribute__warn_unused_result__;