From: <fu...@us...> - 2010-05-12 17:31:54
|
Revision: 10992 http://plplot.svn.sourceforge.net/plplot/?rev=10992&view=rev Author: furnish Date: 2010-05-12 17:31:47 +0000 (Wed, 12 May 2010) Log Message: ----------- For Tcl versions less than 8.5, back down to multiple uses of lindex to extract the result coords. We could do it this way for all Tcl versions, but the lassign technique introduced in Tcl 8.5 is surely more efficient. Tcl example 19 now works with both Tcl/Tk 8.5 and 8.4. Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2010-05-12 02:09:41 UTC (rev 10991) +++ trunk/bindings/tcl/tclAPI.c 2010-05-12 17:31:47 UTC (rev 10992) @@ -3332,7 +3332,12 @@ static Tcl_Interp *tcl_xform_interp = 0; static char *tcl_xform_procname = 0; static const char *tcl_xform_template = - "set result [%s ${_##_x} ${_##_y}] ; lassign $result _##_x _##_y"; +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5 + "set result [%s ${_##_x} ${_##_y}] ; set _##_x [lindex $result 0] ; set _##_y [lindex $result 1]" +#else + "set result [%s ${_##_x} ${_##_y}] ; lassign $result _##_x _##_y" +#endif + ; static char *tcl_xform_code = 0; @@ -3353,6 +3358,10 @@ "_##_y", NULL, objy, 0 ); Tcl_DecrRefCount( objy ); +/* printf( "objx=%x objy=%x\n", objx, objy ); */ + +/* printf( "Evaluating code: %s\n", tcl_xform_code ); */ + // Call identified Tcl proc. Forget data, Tcl can use namespaces and custom // procs to manage transmission of the custom client data. // Proc should return a two element list which is xt yt. @@ -3361,6 +3370,8 @@ if ( code != TCL_OK ) { printf( "Unable to evaluate Tcl-side coordinate transform.\n" ); + printf( "code = %d\n", code ); + printf( "Error result: %s\n", Tcl_GetStringResult( tcl_xform_interp ) ); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |