chiark
/
gitweb
/
~ian
/
chiark-tcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Socket address stuff. Sockid is broken still.
[chiark-tcl.git]
/
hbytes
/
parse.c
diff --git
a/hbytes/parse.c
b/hbytes/parse.c
index a7ac819c637813e78caef4991c3c46f32e2ebdf0..b81511cc827e0c45d1cb53bfe318c74cb1a34cfe 100644
(file)
--- a/
hbytes/parse.c
+++ b/
hbytes/parse.c
@@
-42,13
+42,12
@@
int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) {
rc= Tcl_ConvertToType(ip,val,&hbytes_type);
if (rc) return rc;
rc= Tcl_ConvertToType(ip,val,&hbytes_type);
if (rc) return rc;
- agg->hb= &HBYTES(val);
- return TCL_OK;
-}
+ agg->hb= OBJ_HBYTES(val); return TCL_OK; }
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
Tcl_Obj *ro;
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
Tcl_Obj *ro;
+ if (agg->obj) Tcl_InvalidateStringRep(agg->obj);
if (!rc) {
assert(agg->obj);
ro= Tcl_ObjSetVar2(ip,agg->var,0,agg->obj,TCL_LEAVE_ERR_MSG);
if (!rc) {
assert(agg->obj);
ro= Tcl_ObjSetVar2(ip,agg->var,0,agg->obj,TCL_LEAVE_ERR_MSG);
@@
-61,12
+60,21
@@
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
int pat_hb(Tcl_Interp *ip, Tcl_Obj *obj, HBytes_Value *val) {
int rc;
rc= Tcl_ConvertToType(ip,obj,&hbytes_type); if (rc) return rc;
int pat_hb(Tcl_Interp *ip, Tcl_Obj *obj, HBytes_Value *val) {
int rc;
rc= Tcl_ConvertToType(ip,obj,&hbytes_type); if (rc) return rc;
- *val= HBYTES(obj);
+ *val=
*OBJ_
HBYTES(obj);
return TCL_OK;
}
Tcl_Obj *ret_hb(Tcl_Interp *ip, HBytes_Value val) {
return TCL_OK;
}
Tcl_Obj *ret_hb(Tcl_Interp *ip, HBytes_Value val) {
- return hbytes_set_obj(0, val.start, HBYTES_LEN(val));
+ Tcl_Obj *obj;
+ obj= Tcl_NewObj();
+ Tcl_InvalidateStringRep(obj);
+ *OBJ_HBYTES(obj)= val;
+ obj->typePtr= &hbytes_type;
+ return obj;
+}
+
+Tcl_Obj *ret_int(Tcl_Interp *ip, int val) {
+ return Tcl_NewIntObj(val);
}
Tcl_Obj *ret_obj(Tcl_Interp *ip, Tcl_Obj *val) {
}
Tcl_Obj *ret_obj(Tcl_Interp *ip, Tcl_Obj *val) {