develooper Front page | perl.libwww | Postings from February 2001

Re: 64 bit ints & Parser.xs warnings

Thread Previous | Thread Next
From:
Mike Stok
Date:
February 1, 2001 02:37
Subject:
Re: 64 bit ints & Parser.xs warnings
Message ID:
Pine.LNX.4.30.0102010436250.7308-100000@ratdog.stok.co.uk
Worked for me...

Thanks,

Mike

On 31 Jan 2001, Gisle Aas wrote:

> Mike Stok <mike@stok.co.uk> writes:
>
> > I was just rebuilding everything with perl 5.6.1 trial 2
> >
> > This is perl, v5.6.1 built for i586-linux-64all-ld
> > (with 1 registered patch, see perl -V for more detail)
> >
> > and noticed a couple of warnings while building HTML-Parser-3.15:
> >
> > Parser.xs: In function `get_pstate_iv':
> > Parser.xs:114: warning: cast to pointer from integer of different size
> > Parser.xs: In function `XS_HTML__Parser__alloc_pstate':
> > Parser.xs:202: warning: cast from pointer to integer of different size
> >
> > It doesn't seem to affect the make test.
>
> Can you check this patch:
>
> Index: Parser.xs
> ===================================================================
> RCS file: /cvsroot/libwww-perl/html-parser/Parser.xs,v
> retrieving revision 2.95
> diff -u -p -u -r2.95 Parser.xs
> --- Parser.xs	2000/12/26 08:52:44	2.95
> +++ Parser.xs	2001/02/01 04:25:12
> @@ -111,7 +111,7 @@ static PSTATE*
>  get_pstate_iv(SV* sv)
>  {
>    dTHX;
> -  PSTATE* p = (PSTATE*)SvIV(sv);
> +  PSTATE* p = INT2PTR(PSTATE*, SvIV(sv));
>    if (p->signature != P_SIGNATURE)
>      croak("Bad signature in parser state object at %p", p);
>    return p;
> @@ -199,7 +199,7 @@ _alloc_pstate(self)
>  	Newz(56, pstate, 1, PSTATE);
>  	pstate->signature = P_SIGNATURE;
>
> -	sv = newSViv((IV)pstate);
> +	sv = newSViv(PTR2IV(pstate));
>  	sv_magic(sv, 0, '~', 0, 0);
>  	mg = mg_find(sv, '~');
>          assert(mg);
>
> Regards,
> Gisle
>

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |
GPG PGP Key 1024D/059913DA         | Fingerprint      0570 71CD 6790 7C28 3D60
stok@colltech.com (CT - work)      |                  75D2 9EC4 C1C0 0599 13DA


Thread Previous | 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