In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1d43193d5d388c2cc55fe51bcb525be40cd80688?hp=8fbcb657f30d2c6ce842ca969787dcb532341df5>

- Log -----------------------------------------------------------------
commit 1d43193d5d388c2cc55fe51bcb525be40cd80688
Author: Yves Orton <[email protected]>
Date:   Thu Dec 25 03:53:31 2014 +0100

    add cast to make c++ happy

M       sv.c

commit 3efdcc9cc52ff5b9575a7be650bd473a7a56f550
Author: Yves Orton <[email protected]>
Date:   Thu Dec 25 03:29:57 2014 +0100

    Revert "dont compile unused static hash functions"
    
    This reverts commit 09c759bcfa4c2880c571df4da20458b2f781debf.
    
    The reverted patch causes us to not compile functions that we might
    not use. In theory this is a good thing. But any competent compiler
    is going to exclude them anyway if they aren't used, and we might
    miss useful warning messages, or whatnot. See b404539126a for an
    example of a patch that would not have happened, or would only
    have been partially done had this patch been applied.
    
    Also the reverted patch claimed that "It is not safe to have multiple
    hash funcs in 1 build due to conflicts on the size of
    PERL_HASH_SEED_BYTES." which is incorrect. The functions do not
    reference PERL_HASH_SEED_BYTES directly, and are usable by anyone
    who knows what size of seed they need.
    
    Additionally I have on my long-term todo list the following:
    
    * Allow Perl to randomly select the hash function at startup
    * Allow Perl to use the hash function determined by the ENV at startup.
    
    This patch would have to be reverted to complete either of those tasks.
    
    To recap, I am reverting this patch because it adds no real value,
    makes our hash functions susceptible to bit-rot, and because it blocks
    interesting future changes that I plan to work on in the future.

M       hv_func.h
-----------------------------------------------------------------------

Summary of changes:
 hv_func.h | 20 ++++----------------
 sv.c      |  2 +-
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/hv_func.h b/hv_func.h
index c3045c8..24ebf56 100644
--- a/hv_func.h
+++ b/hv_func.h
@@ -179,7 +179,6 @@
  * It is 64 bit only.
  */
 
-#if defined(PERL_HASH_FUNC_SIPHASH)
 #ifdef HAS_QUAD
 
 #define U8TO64_LE(p) \
@@ -258,7 +257,6 @@ S_perl_hash_siphash_2_4(const unsigned char * const seed, 
const unsigned char *i
   return (U32)(b & U32_MAX);
 }
 #endif /* defined(HAS_QUAD) */
-#endif /* defined(PERL_HASH_FUNC_SIPHASH) */
 
 /* FYI: This is the "Super-Fast" algorithm mentioned by Bob Jenkins in
  * (http://burtleburtle.net/bob/hash/doobs.html)
@@ -268,7 +266,7 @@ S_perl_hash_siphash_2_4(const unsigned char * const seed, 
const unsigned char *i
  * http://www.azillionmonkeys.com/qed/weblicense.html
  */
 
-#if defined(PERL_HASH_FUNC_SUPERFAST)
+
 PERL_STATIC_INLINE U32
 S_perl_hash_superfast(const unsigned char * const seed, const unsigned char 
*str, STRLEN len) {
     U32 hash = *((U32*)seed) + (U32)len;
@@ -307,7 +305,7 @@ S_perl_hash_superfast(const unsigned char * const seed, 
const unsigned char *str
     hash ^= hash << 25;
     return (hash + (hash >> 6));
 }
-#endif /* defined(PERL_HASH_FUNC_SUPERFAST) */
+
 
 /*-----------------------------------------------------------------------------
  * MurmurHash3 was written by Austin Appleby, and is placed in the public
@@ -334,7 +332,7 @@ S_perl_hash_superfast(const unsigned char * const seed, 
const unsigned char *str
  * on big endian machines, or a byte-by-byte read if the endianess is unknown.
  */
 
-#if defined(PERL_HASH_FUNC_MURMUR3)
+
 /*-----------------------------------------------------------------------------
  * Core murmurhash algorithm macros */
 
@@ -464,9 +462,8 @@ S_perl_hash_murmur3(const unsigned char * const seed, const 
unsigned char *ptr,
     h1 ^= h1 >> 16;
     return h1;
 }
-#endif /* defined(PERL_HASH_FUNC_MURMUR3) */
 
-#if defined(PERL_HASH_FUNC_DJB2)
+
 PERL_STATIC_INLINE U32
 S_perl_hash_djb2(const unsigned char * const seed, const unsigned char *str, 
const STRLEN len) {
     const unsigned char * const end = (const unsigned char *)str + len;
@@ -476,9 +473,7 @@ S_perl_hash_djb2(const unsigned char * const seed, const 
unsigned char *str, con
     }
     return hash;
 }
-#endif /* defined(PERL_HASH_FUNC_DJB2) */
 
-#if defined(PERL_HASH_FUNC_SDBM)
 PERL_STATIC_INLINE U32
 S_perl_hash_sdbm(const unsigned char * const seed, const unsigned char *str, 
const STRLEN len) {
     const unsigned char * const end = (const unsigned char *)str + len;
@@ -488,7 +483,6 @@ S_perl_hash_sdbm(const unsigned char * const seed, const 
unsigned char *str, con
     }
     return hash;
 }
-#endif /* defined(PERL_HASH_FUNC_SDBM) */
 
 /* - ONE_AT_A_TIME_HARD is the 5.17+ recommend ONE_AT_A_TIME algorithm
  * - ONE_AT_A_TIME_OLD is the unmodified 5.16 and older algorithm
@@ -506,7 +500,6 @@ S_perl_hash_sdbm(const unsigned char * const seed, const 
unsigned char *str, con
  * (http://burtleburtle.net/bob/hash/doobs.html)
  * With seed/len tweak.
  * */
-#if defined(PERL_HASH_FUNC_ONE_AT_A_TIME)
 PERL_STATIC_INLINE U32
 S_perl_hash_one_at_a_time(const unsigned char * const seed, const unsigned 
char *str, const STRLEN len) {
     const unsigned char * const end = (const unsigned char *)str + len;
@@ -520,10 +513,8 @@ S_perl_hash_one_at_a_time(const unsigned char * const 
seed, const unsigned char
     hash ^= (hash >> 11);
     return (hash + (hash << 15));
 }
-#endif /* defined(PERL_HASH_FUNC_ONE_AT_A_TIME) */
 
 /* Derived from "One-at-a-Time" algorithm by Bob Jenkins */
-#if defined(PERL_HASH_FUNC_ONE_AT_A_TIME_HARD)
 PERL_STATIC_INLINE U32
 S_perl_hash_one_at_a_time_hard(const unsigned char * const seed, const 
unsigned char *str, const STRLEN len) {
     const unsigned char * const end = (const unsigned char *)str + len;
@@ -558,9 +549,7 @@ S_perl_hash_one_at_a_time_hard(const unsigned char * const 
seed, const unsigned
     hash ^= (hash >> 11);
     return (hash + (hash << 15));
 }
-#endif /* defined(PERL_HASH_FUNC_ONE_AT_A_TIME_HARD) */
 
-#if defined(PERL_HASH_FUNC_ONE_AT_A_TIME_OLD)
 PERL_STATIC_INLINE U32
 S_perl_hash_old_one_at_a_time(const unsigned char * const seed, const unsigned 
char *str, const STRLEN len) {
     const unsigned char * const end = (const unsigned char *)str + len;
@@ -574,7 +563,6 @@ S_perl_hash_old_one_at_a_time(const unsigned char * const 
seed, const unsigned c
     hash ^= (hash >> 11);
     return (hash + (hash << 15));
 }
-#endif /* defined(PERL_HASH_FUNC_ONE_AT_A_TIME_OLD) */
 
 #ifdef PERL_HASH_FUNC_MURMUR_HASH_64A
 /* This code is from Austin Appleby and is in the public domain.
diff --git a/sv.c b/sv.c
index e91f5e9..1f9ea87 100644
--- a/sv.c
+++ b/sv.c
@@ -5959,7 +5959,7 @@ Perl_sv_get_backrefs(pTHX_ SV *const sv)
     if (SvTYPE(sv) == SVt_PVHV) {
         if (SvOOK(sv)) {
             struct xpvhv_aux * const iter = HvAUX((HV *)sv);
-            backrefs = iter->xhv_backreferences;
+            backrefs = (SV *)iter->xhv_backreferences;
         }
     } else if (SvMAGICAL(sv)) {
         MAGIC *mg = mg_find(sv, PERL_MAGIC_backref);

--
Perl5 Master Repository

Reply via email to