Mailinglist Archive: opensuse-bugs (6633 mails)

< Previous Next >
[Bug 535200] bindings for LibStorage::Environment::swig_logdir_set do not work
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Mon, 31 Aug 2009 08:44:11 -0600
  • Message-id: <20090831144411.3035ECC7CD@xxxxxxxxxxxxxxxxxxxxxx>
http://bugzilla.novell.com/show_bug.cgi?id=535200

User mvidner@xxxxxxxxxx added comment
http://bugzilla.novell.com/show_bug.cgi?id=535200#c2


Martin Vidner <mvidner@xxxxxxxxxx> changed:

What |Removed |Added
----------------------------------------------------------------------------
Priority|P5 - None |P3 - Medium
Status|NEW |ASSIGNED




--- Comment #2 from Martin Vidner <mvidner@xxxxxxxxxx> 2009-08-31 08:44:07 MDT
---
It's this code in
http://svn.opensuse.org/viewvc/yast/trunk/perl-bindings/pluglib-bindings/swig/stl/string.i?revision=57030&view=markup#l30

%typemap(in) std::string* (std::string temp), std::string& (std::string temp),
const std::string* (std::string temp), const std::string& (std::string
temp)
{
SV *sv;
if (!SvROK($input) || !(sv = (SV*)SvRV($input)) || !SvPOK(sv) )
SWIG_croak("Type error in argument $argnum of $symname. Expected a
REFERENCE to STRING.\n");

STRLEN len;
const char *ptr = SvPV(sv, len);
if (!ptr)
SWIG_croak("Undefined variable in argument $argnum of $symname.");
temp.assign(ptr, len);
$1 = &temp;
}

Now, the typemap makes a copy of the referenced string anyway, so there is no
point in requiring a reference instead of a plain string. I wonder how it can
work in the other cases:

$ grep "REFERENCE to STRING" LibStorage_wrap.cc | wc -l
200

--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >
References