Check-in [17b2b81a02]
Overview
Comment:Added syntaxes for byte arrays
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 17b2b81a025f8b6970c485bae2acaffbc4cace37
User & Date: rkeene on 2014-07-16 16:09:48
Other Links: manifest | tags
Context
2014-07-16
16:15
Corrected issue with checking for variables check-in: 37f218e272 user: rkeene tags: trunk
16:09
Added syntaxes for byte arrays check-in: 17b2b81a02 user: rkeene tags: trunk
14:44
Updated to create a proc if we are operating in an existing interpreter, to avoid setting local variables check-in: 500057b0ea user: rkeene tags: trunk
Changes

Modified tcc4tcl.tcl from [e6c673ebab] to [2aaf108bbf].

   259    259   						}
   260    260   					}
   261    261   
   262    262   					_ccode $handle "    _$arg = Tcl_New${convCmd}Obj($arg);"
   263    263   					_ccode $handle "    if (!_$arg) $return_failure;"
   264    264   				}
   265    265   				char* {
   266         -					_ccode $handle "    _$arg = Tcl_NewStringObj($arg, -1);"
          266  +					if {[info exists $types(${arg}_MemberCount)] && [info exists $types(${arg}_MemberLength)]} {
          267  +						_ccode $handle "    _$arg = Tcl_NewByteArrayObj($arg, ${arg}_MemberCount * ${arg}_MemberLength);"
          268  +					} elseif {[info exists $types(${arg}_Length)]} {
          269  +						_ccode $handle "    _$arg = Tcl_NewByteArrayObj($arg, ${arg}_Length);"
          270  +					} else {
          271  +						_ccode $handle "    _$arg = Tcl_NewStringObj($arg, -1);"
          272  +					}
   267    273   				}
   268    274   				Tcl_Obj* {
   269    275   					_ccode $handle "    _$arg = $arg;"
   270    276   				}
   271    277   				default {
   272    278   					return -code error "Unknown type: $type"
   273    279   				}