From: Gurusamy Sarathy Date: Fri, 4 Feb 2000 17:26:37 +0000 (+0000) Subject: avoid bad cast warnings (from Robin Barker ) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d2a79402699cee58f92911933abdc630babe73e5;p=p5sagit%2Fp5-mst-13.2.git avoid bad cast warnings (from Robin Barker ) p4raw-id: //depot/perl@4986 --- diff --git a/sv.c b/sv.c index 0697d8e..617d9a6 100644 --- 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;