T
Tassilo v. Parseval
Also sprach Sisyphus:
Wont help either. You cannot change 'a' in-place thusly. If you want
that you'd have to have something like:
void set_undef (SV **a) {
*a = &PL_sv_undef;
}
But I don't think that Inline::C or XS know about an SV** prototype. The
reason is again the difference between changing a C-structure internally
(this is what sv_setsv does) or having a variable point to something
else. If you want to do the latter, you need to pass the pointer by
reference. These are the usual C-semantics.
Only if the variable passed to set_undef() was a real PL_sv_undef in the
first place. What you are thinking of is a no-op.
Tassilo
Another thread, and another list - and it has just been drawn to my
attention that's not the right way to assign PL_sv_undef to an SV. The
above line should be replaced by:
a = &PL_sv_undef
Wont help either. You cannot change 'a' in-place thusly. If you want
that you'd have to have something like:
void set_undef (SV **a) {
*a = &PL_sv_undef;
}
But I don't think that Inline::C or XS know about an SV** prototype. The
reason is again the difference between changing a C-structure internally
(this is what sv_setsv does) or having a variable point to something
else. If you want to do the latter, you need to pass the pointer by
reference. These are the usual C-semantics.
I haven't tested, but I expect one would then find that the script
reports "A valid means of testing for &PL_sv_undef".
Only if the variable passed to set_undef() was a real PL_sv_undef in the
first place. What you are thinking of is a no-op.
Tassilo