From: Marcelo M. <mar...@us...> - 2004-10-01 21:46:53
|
Update of /cvsroot/swig/SWIG/Source/Swig In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7774/Swig Modified Files: stype.c Log Message: fix fnc_ptr wrap for functions with ref,enums,etc Index: stype.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/stype.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** stype.c 27 May 2004 11:29:39 -0000 1.46 --- stype.c 1 Oct 2004 21:45:28 -0000 1.47 *************** *** 513,516 **** --- 513,517 ---- int nelements, i; int firstarray = 1; + int notypeconv = 0; result = NewString(""); *************** *** 536,539 **** --- 537,544 ---- for (i = 0; i < nelements; i++) { element = Getitem(elements,i); + /* when we see a function, we need to preserve the following types */ + if (SwigType_isfunction(element)) { + notypeconv = 1; + } if (SwigType_isqualifier(element)) { /* Do nothing. Ignore */ *************** *** 545,555 **** firstarray = 0; } else if (SwigType_isreference(element)) { ! Append(result,"p."); firstarray = 0; } else if (SwigType_isarray(element) && firstarray) { ! Append(result,"p."); firstarray = 0; } else if (SwigType_isenum(element)) { ! Append(result,"int"); } else { Append(result,element); --- 550,572 ---- firstarray = 0; } else if (SwigType_isreference(element)) { ! if (notypeconv) { ! Append(result,element); ! } else { ! Append(result,"p."); ! } firstarray = 0; } else if (SwigType_isarray(element) && firstarray) { ! if (notypeconv) { ! Append(result,element); ! } else { ! Append(result,"p."); ! } firstarray = 0; } else if (SwigType_isenum(element)) { ! if (notypeconv) { ! Append(result,element); ! } else { ! Append(result,"int"); ! } } else { Append(result,element); |