securing the call to SWIG_IsOK, which is a macro
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8131 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a9111581bd
commit
7e8fc00652
10 changed files with 63 additions and 58 deletions
|
|
@ -1,7 +1,7 @@
|
|||
%include <std_common.i>
|
||||
%include <typemaps/implicit.swg>
|
||||
|
||||
#warning "This file provide the %implicit directive, which is an old and fragil"
|
||||
#warning "This file provides the %implicit directive, which is an old and fragile"
|
||||
#warning "way to implement the C++ implicit conversion mechanism."
|
||||
#warning "Try using the more robust '%implicitconv Type;' directive instead."
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ SWIG_AsVal_dec(bool)(PyObject *obj, bool *val)
|
|||
|
||||
/* long */
|
||||
|
||||
%fragment(SWIG_From_frag(long),"header",
|
||||
fragment="<limits.h>") {
|
||||
%fragment(SWIG_From_frag(long),"header") {
|
||||
%define_as(SWIG_From_dec(long), PyInt_FromLong)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ namespace swig {
|
|||
struct traits_as<Type, value_category> {
|
||||
static Type as(PyObject *obj, bool throw_error) {
|
||||
Type v;
|
||||
if (!obj || !SWIG_IsOK(asval(obj, &v))) {
|
||||
int res = asval(obj, &v);
|
||||
if (!obj || !SWIG_IsOK(res)) {
|
||||
if (!PyErr_Occurred()) {
|
||||
%type_error(swig::type_name<Type>());
|
||||
}
|
||||
|
|
@ -161,20 +162,22 @@ namespace swig {
|
|||
|
||||
template <class Type>
|
||||
struct traits_check<Type, value_category> {
|
||||
static bool check(PyObject *obj) {
|
||||
return obj && SWIG_IsOK(asval(obj, (Type *)(0)));
|
||||
static int check(PyObject *obj) {
|
||||
int res = asval(obj, (Type *)(0));
|
||||
return obj && SWIG_IsOK(res) ? res : 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <class Type>
|
||||
struct traits_check<Type, pointer_category> {
|
||||
static bool check(PyObject *obj) {
|
||||
return obj && asptr(obj, (Type **)(0));
|
||||
static int check(PyObject *obj) {
|
||||
int res = asptr(obj, (Type **)(0));
|
||||
return obj && SWIG_IsOK(res) ? res : 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <class Type>
|
||||
inline bool check(PyObject *obj) {
|
||||
inline int check(PyObject *obj) {
|
||||
return traits_check<Type, typename traits<Type>::category>::check(obj);
|
||||
}
|
||||
}
|
||||
|
|
@ -232,8 +235,9 @@ namespace swig {
|
|||
|
||||
template <>
|
||||
struct traits_check<Type, value_category> {
|
||||
static bool check(PyObject *obj) {
|
||||
return obj && Check(obj);
|
||||
static int check(PyObject *obj) {
|
||||
int res = Check(obj);
|
||||
return obj && res ? res : 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
%define Name ## _input_binary(TYPEMAP, SIZE)
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) (TYPEMAP, SIZE)
|
||||
(Char *buf = 0, size_t size = 0, int alloc = 0) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum);
|
||||
}
|
||||
$1 = ($1_ltype) buf;
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
%define Name ## _bounded_mutable(TYPEMAP,MAX)
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) TYPEMAP
|
||||
(Char temp[MAX+1], Char *t = 0, size_t n = 0, int alloc = 0) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &t, &n, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &t, &n, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError, "TYPEMAP", $argnum);
|
||||
}
|
||||
if ( n > (size_t) MAX ) n = (size_t) MAX;
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
#if #EXP != ""
|
||||
expansion += EXP;
|
||||
#endif
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &t, &n, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &t, &n, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError, "TYPEMAP", $argnum);
|
||||
}
|
||||
$1 = %new_array(n+expansion, $*1_ltype);
|
||||
|
|
@ -182,7 +182,7 @@
|
|||
|
||||
%define Name ## _output_maxsize(TYPEMAP, SIZE)
|
||||
%typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (TYPEMAP, SIZE) (size_t size, Char *buff = 0) {
|
||||
if (!SWIG_IsOK(SWIG_AsVal(size_t)($input, &size))) {
|
||||
if (!SWIG_IsOK((SWIG_AsVal(size_t)($input, &size)))) {
|
||||
%argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum);
|
||||
}
|
||||
buff= %new_array(size+1, Char);
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
|
||||
%define Name ## _output_withsize(TYPEMAP, SIZE)
|
||||
%typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (TYPEMAP, SIZE) (size_t n, Char *buff = 0, $*2_ltype size) {
|
||||
if (!SWIG_IsOK(SWIG_AsVal(size_t)($input, &n))) {
|
||||
if (!SWIG_IsOK((SWIG_AsVal(size_t)($input, &n)))) {
|
||||
%argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum);
|
||||
}
|
||||
buff= %new_array(n+1, Char);
|
||||
|
|
|
|||
|
|
@ -44,12 +44,14 @@
|
|||
%define %implicit_frag(Type...) ,fragment=SWIG_Traits_frag(Type) %enddef
|
||||
|
||||
%define %implicit_code(Type...)
|
||||
if (SWIG_IsOK(swig::asval<Type >(obj, 0))) {
|
||||
Type _v;
|
||||
int res = swig::asval<Type >(obj, &_v);
|
||||
{
|
||||
Type _v;
|
||||
int res = swig::asval<Type >(obj, &_v);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (val) *val = %new_copy(_v, value_type);
|
||||
return SWIG_AddNewMask(res);
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
||||
/* implicit */
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ or you can use the %apply directive :
|
|||
|
||||
*/
|
||||
#if defined(SWIG_INPUT_ACCEPT_PTRS)
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK(res = SWIG_ConvertPtr(input,%as_voidptrptr(arg),desc,disown)))
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK((res = SWIG_ConvertPtr(input,%as_voidptrptr(arg),desc,disown))))
|
||||
#else
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK(res = SWIG_ERROR))
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK((res = SWIG_ERROR)))
|
||||
#endif
|
||||
|
||||
%define %_value_input_typemap(code, asval_meth, asval_frag, Type)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ SWIGINTERN int
|
|||
SWIG_AsPtr_dec(String)(SWIG_Object obj, String **val)
|
||||
{
|
||||
Char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
|
||||
if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) {
|
||||
if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
|
||||
if (buf) {
|
||||
if (val) *val = new String(buf, size - 1);
|
||||
if (alloc == SWIG_NEWOBJ) %delete_array(buf);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
}
|
||||
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtr) Char const*& (Char *buf = 0, int alloc = 0) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtr($input, &buf, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize) Char * {
|
||||
Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc)))) {
|
||||
%variable_fail(SWIG_TypeError,"$type","$name");
|
||||
}
|
||||
if ($1) %delete_array($1);
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * {
|
||||
Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
if (alloc == SWIG_NEWOBJ) {
|
||||
|
|
@ -159,7 +159,7 @@
|
|||
|
||||
%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
Char * (Char* buf = 0, int alloc = SWIG_NEWOBJ) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtr($input, &buf, &alloc)))) {
|
||||
%dirout_fail(SWIG_TypeError, "$type");
|
||||
}
|
||||
if (alloc == SWIG_NEWOBJ) {
|
||||
|
|
@ -178,7 +178,7 @@
|
|||
%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
Char * const& (Char* buf = 0, int alloc = SWIG_NEWOBJ),
|
||||
Char const* const& (Char* buf = 0, int alloc = SWIG_NEWOBJ) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtr($input, &buf, &alloc)))) {
|
||||
%dirout_fail(SWIG_TypeError, "$type");
|
||||
}
|
||||
static $*ltype tmp = buf;
|
||||
|
|
@ -249,7 +249,7 @@
|
|||
Char [ANY] (Char temp[$1_dim0]),
|
||||
const Char [ANY](Char temp[$1_dim0])
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, temp, $1_dim0))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharArray($input, temp, $1_dim0)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = temp;
|
||||
|
|
@ -258,7 +258,7 @@
|
|||
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0])
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, temp, $1_dim0))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharArray($input, temp, $1_dim0)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
|
|
@ -279,7 +279,7 @@
|
|||
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharArray) Char [ANY]
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, $1, $1_dim0))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharArray($input, $1, $1_dim0)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
}
|
||||
|
|
@ -327,7 +327,7 @@
|
|||
Char [ANY] (Char temp[$result_dim0]),
|
||||
const Char [ANY] (Char temp[$result_dim0])
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, temp, $result_dim0))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharArray($input, temp, $result_dim0)))) {
|
||||
%dirout_fail(SWIG_TypeError, "$type");
|
||||
}
|
||||
$result = temp;
|
||||
|
|
@ -397,7 +397,7 @@
|
|||
(Char *STRING, size_t LENGTH) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(const Char *STRING, size_t LENGTH) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = %static_cast(buf, $1_ltype);
|
||||
|
|
@ -416,7 +416,7 @@
|
|||
(Char *STRING, size_t SIZE) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(const Char *STRING, size_t SIZE) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = %static_cast(buf, $1_ltype);
|
||||
|
|
@ -437,7 +437,7 @@
|
|||
(size_t LENGTH, Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(size_t LENGHT, const Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$2 = %static_cast(buf, $2_ltype) ;
|
||||
|
|
@ -455,7 +455,7 @@
|
|||
(size_t SIZE, Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(size_t SIZE, const Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type",$argnum);
|
||||
}
|
||||
$2 = %static_cast(buf, $2_ltype) ;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/* Pointers and arrays */
|
||||
%typemap(in, noblock=1) SWIGTYPE *(void *argp = 0) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
%typemap(freearg) SWIGTYPE * "";
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE* const& (void *argp = 0, $*ltype temp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError, "$*ltype", $argnum);
|
||||
}
|
||||
temp = %reinterpret_cast(argp, $*ltype);
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
/* Reference */
|
||||
%typemap(in, noblock=1) SWIGTYPE & (void *argp = 0) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) { %argument_nullref("$type", $argnum); }
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
}
|
||||
#else
|
||||
%typemap(in,noblock=1) const SWIGTYPE & (void *argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) { %argument_nullref("$type", $argnum); }
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
%typemap(in) SWIGTYPE {
|
||||
void *argp;
|
||||
$<ype temp;
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) {
|
||||
|
|
@ -268,7 +268,7 @@
|
|||
#else
|
||||
%typemap(varin,noblock=1) SWIGTYPE {
|
||||
void *argp = 0;
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
if (!argp) {
|
||||
|
|
@ -374,7 +374,7 @@
|
|||
}
|
||||
#else
|
||||
%typemap(directorout,noblock=1) SWIGTYPE (void * argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = *(%reinterpret_cast(argp, $<ype));
|
||||
|
|
@ -383,7 +383,7 @@
|
|||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
SWIGTYPE *(void *argp, swig_owntype own) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
|
|
@ -397,7 +397,7 @@
|
|||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
SWIGTYPE &(void *argp, swig_owntype own) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
if (!argp) { %dirout_nullref("$type"); }
|
||||
|
|
@ -450,7 +450,7 @@
|
|||
* ------------------------------------------------------------ */
|
||||
|
||||
%typemap(in,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
}
|
||||
|
|
@ -460,7 +460,7 @@
|
|||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($type), $descriptor))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($type), $descriptor)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
}
|
||||
|
|
@ -484,7 +484,7 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
|
|
@ -501,7 +501,7 @@
|
|||
some providences.
|
||||
*/
|
||||
%typemap(in, noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
}
|
||||
|
|
@ -518,7 +518,7 @@
|
|||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
}
|
||||
|
|
@ -542,7 +542,7 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
}
|
||||
|
|
@ -561,14 +561,14 @@
|
|||
/* DISOWN typemap */
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE *DISOWN {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags)))) {
|
||||
%argument_fail(SWIG_TypeError,"$type", $argnum);
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE *DISOWN {
|
||||
void *temp = 0;
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
$1 = ($ltype) temp;
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
/* in */
|
||||
|
||||
%typemap(in,noblock=1) void * {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) void * "";
|
||||
|
||||
%typemap(in,noblock=1) void * const& ($*ltype temp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown)))) {
|
||||
%argument_fail(SWIG_TypeError, "Stype", $argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
%typemap(varin,noblock=1) void * {
|
||||
void *temp = 0;
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
$1 = ($1_ltype) temp;
|
||||
|
|
@ -59,14 +59,14 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) void * (void *argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, 0, 0))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, 0, 0)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) void * const& (void *argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, 0, $disown))) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, 0, $disown)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
static $*ltype temp = %reinterpret_cast(argp, $*ltype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue