[mplspm]: Deference a hash reference _twice_ in *.xs??

Mark Conty Mark_Conty at cargill.com
Mon Mar 11 15:34:00 CST 2002


Ken Williams writes
> I'm far from adept at XS, but what happens if you turn 'hashref' to 
> '*hashref' on line 9?
> >
> >     1   SV*
> >     2   showHash(hashref)
> >     3   	SV	*hashref
> >     4       CODE:
> >     5   	HV	*hash;
> >     6   	I32	count;
> >     7   {
> >     8   	if ( ! SvROK(hashref) ||
> >     9   		SvTYPE((hash=(HV*)SvRV(SvRV(hashref)))) != SVt_PVHV )
> >    10   	    croak("Parameter is not a reference to a hash -- type is 
> > %d.\n",
> >    11   		SvTYPE(hash));

No dice.  Then it whines about the dereferencing:

	showHash.xs:7337: invalid type argument of `->'

... for the line:

	SvTYPE((hash=(HV*)SvRV(*hashref))) != SVt_PVHV )

Good idea, though -- thanks for giving it a shot!
-- 
Mark Conty
APS/NAGO IT Group
Server Team - MS 64
952-984-0503


--------------------------------------------------
Minneapolis Perl Mongers mailing list

To unsubscribe, send mail to majordomo at pm.org
with "unsubscribe mpls" in the body of the message.



More information about the Mpls-pm mailing list