develooper Front page | perl.perl5.porters | Postings from November 2000

[PATCH @7595] int/ptr casts in perlio.c

Thread Next
From:
Robin Barker
Date:
November 8, 2000 03:11
Subject:
[PATCH @7595] int/ptr casts in perlio.c
Message ID:
200011081111.LAA07377@tempest.npl.co.uk
Small patch to deal with these warnings 

perlio.c: In function `PerlIO_define_layer':
perlio.c:343: warning: cast from pointer to integer of different size
perlio.c: In function `PerlIO_default_layer':
perlio.c:412: warning: cast to pointer from integer of different size

Robin

--- perl/perlio.c	Mon Nov  6 20:41:37 2000
+++ perl@7595/perlio.c	
@@ -340,7 +340,7 @@
 {
  dTHX;
  HV *stash = gv_stashpv("perlio::Layer", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv((IV) tab)),stash);
+ SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(tab))),stash);
  hv_store(PerlIO_layer_hv,tab->name,strlen(tab->name),sv,0);
 }
 
@@ -409,7 +409,7 @@
  svp = av_fetch(PerlIO_layer_av,n,0);
  if (svp && (layer = *svp) && SvROK(layer) && SvIOK((layer = SvRV(layer))))
   {
-   tab = (PerlIO_funcs *) SvIV(layer);
+   tab = INT2PTR(PerlIO_funcs *, SvIV(layer));
   }
  /* PerlIO_debug("Layer %d is %s\n",n,tab->name); */
  return tab;

-- 
Robin Barker                        | Email: Robin.Barker@npl.co.uk
CMSC, Building 10,                  | Phone: +44 (0) 20 8943 7090
National Physical Laboratory,       | Fax:   +44 (0) 20 8977 7091
Teddington, Middlesex, UK. TW11 OLW | WWW:   http://www.npl.co.uk

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About