From 6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sun, 5 Feb 2023 14:49:35 -0500 Subject: c-statements: Use semi-opaque stmt & match handles, not bare indices I want the extra bit of type safety to help me debug with-all. Also fixes up cffi/tcl array support a bit --- lib/c.tcl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/c.tcl b/lib/c.tcl index 039e6d25..9e155502 100644 --- a/lib/c.tcl +++ b/lib/c.tcl @@ -241,15 +241,16 @@ namespace eval c { }] variable argtypes - set argscripts [list] ;# TODO: return a dictionary + set argscripts [list {$argtype $argname;}] foreach {fieldtype fieldname} $fields { lappend argscripts [csubst { Tcl_Obj* obj_$fieldname; Tcl_DictObjGet(interp, \$obj, Tcl_ObjPrintf("%s", "$fieldname"), &obj_$fieldname); }] - lappend argscripts [arg $fieldtype \$argname.$fieldname obj_$fieldname] + lappend argscripts [arg $fieldtype \${argname}_$fieldname obj_$fieldname] + lappend argscripts [subst {\$argname.$fieldname = \${argname}_$fieldname;}] } - argtype $type [list expr [list [join $argscripts "\n"]]] + argtype $type [join $argscripts "\n"] variable rtypes rtype $type { -- cgit v1.2.3