This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid bad cast warnings (from Robin Barker <rmb1@cise.npl.co.uk>)
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 4 Feb 2000 17:26:37 +0000 (17:26 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 4 Feb 2000 17:26:37 +0000 (17:26 +0000)
p4raw-id: //depot/perl@4986

sv.c

diff --git a/sv.c b/sv.c
index 0697d8e..617d9a6 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -6398,7 +6398,7 @@ void *
 Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv)
 {
     PTR_TBL_ENT_t *tblent;
-    UV hash = (UV)sv;
+    UV hash = PTR2UV(sv);
     assert(tbl);
     tblent = tbl->tbl_ary[hash & tbl->tbl_max];
     for (; tblent; tblent = tblent->next) {
@@ -6415,7 +6415,7 @@ Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv)
     /* XXX this may be pessimal on platforms where pointers aren't good
      * hash values e.g. if they grow faster in the most significant
      * bits */
-    UV hash = (UV)oldv;
+    UV hash = PTR2UV(oldv);
     bool i = 1;
 
     assert(tbl);
@@ -6455,7 +6455,7 @@ Perl_ptr_table_split(pTHX_ PTR_TBL_t *tbl)
            continue;
        curentp = ary + oldsize;
        for (entp = ary, ent = *ary; ent; ent = *entp) {
-           if ((newsize & (UV)ent->oldval) != i) {
+           if ((newsize & PTR2UV(ent->oldval)) != i) {
                *entp = ent->next;
                ent->next = *curentp;
                *curentp = ent;