Hugo <hv@crypt0.demon.co.uk> writes:
>In <20010530143239.567.18@dromedary.ni-s.u-net.com>, Nick Ing-Simmons writes:
>:>PS What's the difference between SvPV and SvPVx?
>:
>:Read the source (i.e. sv.h) ...
>:
>:SvPVx makes a copy of the SV * so that
>:
>:SvPVx(*p++,len) is "okay"
>:whereas
>:SvPV(*p++,len) isn't as the macro may do multiple ++s.
>
>But SvPV doesn't actually use the argument multiple times.
#define SvPV(sv, lp) SvPV_flags(sv, lp, SV_GMAGIC)
#define SvPV_flags(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
^^ 1
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
^^ 2 ^^3 ^^4
Looks like more than one to me ...
>
>Hugo
--
Nick Ing-Simmons
who is looking for a new job see http://www.ni-s.u-net.com/
Thread Previous
|
Thread Next