Documentation patches from Mark Goodman
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7154 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
31c19ff7b7
commit
ca7834309c
7 changed files with 27 additions and 25 deletions
|
|
@ -2380,6 +2380,7 @@ as shown. To work with heap allocated data, the following technique can be use
|
|||
$1[i] = (float) PyFloat_AsDouble(o);
|
||||
} else {
|
||||
PyErr_SetString(PyExc_ValueError,"Sequence elements must be numbers");
|
||||
free($1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -2465,7 +2466,7 @@ can be set nicely, but reading the member simply returns a pointer:
|
|||
<div class="targetlang">
|
||||
<pre>
|
||||
>>> s = SomeObject()
|
||||
>>> s.x = [1, 2.5, 5. 10]
|
||||
>>> s.x = [1, 2.5, 5, 10]
|
||||
>>> print s.x
|
||||
_1008fea8_p_float
|
||||
>>>
|
||||
|
|
@ -3084,7 +3085,7 @@ descriptor name for any C datatype. For example:
|
|||
%typemap(in) Foo * {
|
||||
if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor)) == -1) {
|
||||
Bar *temp;
|
||||
if ((SWIG_ConvertPtr($input), (void **) &temp, <b>$descriptor(Bar *)</b>) == -1) {
|
||||
if ((SWIG_ConvertPtr($input, (void **) &temp, <b>$descriptor(Bar *)</b>) == -1) {
|
||||
return NULL;
|
||||
}
|
||||
$1 = (Foo *) temp;
|
||||
|
|
@ -3587,6 +3588,7 @@ in a tremendous amount of code bloat. For example, consider this typemap for an
|
|||
$1[i] = (float) PyFloat_AsDouble(o);
|
||||
} else {
|
||||
PyErr_SetString(PyExc_ValueError,"Sequence elements must be numbers");
|
||||
free(result);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue