Tye McQueen wrote:
> 
> Simply change the second line to:
> 
>         unsigned long &vi

Cool, thanks for that.

> ) >>>>  sv_setpvn(ST(0), (char *)vi, sizeof(*vi)), XFree((char *)vi);
> [...]
> ) First, from what I see in lib/CORE/proto.h, sv_setpvn should
> ) have 3 params, not 4.  What's happening here?
> 
> C<sv_setpvn()> _is_ given 3 args above.  Match the parens more
> carefully.

Argh, the C comma expression!!  (Is writing it this way
instead of on two lines someone's idea of a "funny"?)

> ) Second, I have searched in the Perl directory, and
> ) the only files that contain "XFree" are typemap and xsubpp.
> ) How is the reference to XFree supposed to be satisfied?
> 
> I don't have a good answer.  The default typemap file appears
> to have several undocumented things as far as I can tell.
> But it looks like they are expecting you to C<#define XFree>
> assuming that your pointer to opaque data needs to be freed
> after the contents of the buffer have been copied.  This seems
> like a rather silly typemap to me since, among other things, it
> expects that only output parameters need to be freed.  Of course,
> you have to C<#define XFree> because we don't know whether your
> buffer should be freed via C<free>, C<Perl_mfree>, etc.

I think the point is that it's a DELIBERATE error to flag to
you that you should think about how to deal with the returned
memory.  Fair enough.

> ) So it looks like it's being generated by the entry in the typemap file.
> ) Which is odd, since I don't think a pointer to a long should be
> ) regarded as an opaque ptr.
> 
> More strange things in the default typemap file.

I think Jan Dubois' reply will also help things.

Regards,

Mitch.
--
| mailto:[EMAIL PROTECTED]       | Not the official view of: |
| mailto:[EMAIL PROTECTED] | Australian Calculator Opn |
| Certified Linux Evangelist! | Hewlett Packard Australia |

Reply via email to