From: kruland <kr...@us...> - 2006-02-06 14:02:52
|
Update of /cvsroot/swig/SWIG/Lib/php4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25941 Modified Files: php4.swg typemaps.i Log Message: Fix typemaps for void* and void**. Index: typemaps.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/php4/typemaps.i,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** typemaps.i 20 Sep 2005 14:44:56 -0000 1.6 --- typemaps.i 6 Feb 2006 14:02:44 -0000 1.7 *************** *** 152,169 **** if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ ! if ((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input)) { #ifdef __cplusplus ! ptr=new $*1_ltype; #else ! ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); #endif ! $1=&ptr; ! /* have to passback arg$arg too */ ! force=1; ! } else { /* wasn't a pre/ref/thing, OR anything like an int thing */ ! force=0; ! SWIG_PHP_Error(E_ERROR, "Type error in argument $arg of $symname."); ! } ! } else force=0; } --- 152,171 ---- if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ ! if (!((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input))) { ! /* wasn't a pre/ref/thing, OR anything like an int thing */ ! SWIG_PHP_Error(E_ERROR, "Type error in argument $arg of $symname."); ! } ! } ! force=0; ! if (arg1==NULL) { #ifdef __cplusplus ! ptr=new $*1_ltype; #else ! ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); #endif ! $1=&ptr; ! /* have to passback arg$arg too */ ! force=1; ! } } Index: php4.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/php4/php4.swg,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** php4.swg 26 Nov 2005 09:28:19 -0000 1.22 --- php4.swg 6 Feb 2006 14:02:44 -0000 1.23 *************** *** 120,137 **** if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ ! if ((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input)) { #ifdef __cplusplus ! ptr=new $*1_ltype; #else ! ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); #endif ! $1=&ptr; ! /* have to passback arg$arg too */ ! force=1; ! } else { /* wasn't a pre/ref/thing, OR anything like an int thing */ ! force=0; ! SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor"); ! } ! } else force=0; } %typemap(argout) void **, --- 120,139 ---- if(SWIG_ConvertPtr(*$input, (void **) &$1, $1_descriptor, 0) < 0) { /* So... we didn't get a ref or ptr, but we'll accept NULL by reference */ ! if (!((*$input)->type==IS_NULL && PZVAL_IS_REF(*$input))) { ! /* wasn't a pre/ref/thing, OR anything like an int thing */ ! SWIG_PHP_Error(E_ERROR, "Type error in argument $arg of $symname."); ! } ! } ! force=0; ! if (arg1==NULL) { #ifdef __cplusplus ! ptr=new $*1_ltype; #else ! ptr=($*1_ltype) calloc(1,sizeof($*1_ltype)); #endif ! $1=&ptr; ! /* have to passback arg$arg too */ ! force=1; ! } } %typemap(argout) void **, |