summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-04-18 18:42:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-04-18 18:42:54 (GMT)
commit88574b7bc539d00b6477f8d9bbe7f25158b57662 (patch)
tree4399ca38b73edfafc667956c4bb05e731d0dc862 /generic/tclUtil.c
parente5ced1c96d6213766cd6263eddcab12ba1a916a9 (diff)
downloadtcl-88574b7bc539d00b6477f8d9bbe7f25158b57662.zip
tcl-88574b7bc539d00b6477f8d9bbe7f25158b57662.tar.gz
tcl-88574b7bc539d00b6477f8d9bbe7f25158b57662.tar.bz2
Experimental branch where the interp->result field and related are removed
and all simplifications that makes possible are done. Seems this can at best be a Tcl 9 reform.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index a1c1996..32b1bfe 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2626,6 +2626,7 @@ Tcl_DStringResult(
Tcl_DString *dsPtr) /* Dynamic string that is to become the
* result of interp. */
{
+#if 0
Interp *iPtr = (Interp *) interp;
Tcl_ResetResult(interp);
@@ -2637,8 +2638,11 @@ Tcl_DStringResult(
iPtr->result = iPtr->resultSpace;
memcpy(iPtr->result, dsPtr->string, dsPtr->length + 1);
} else {
+#endif
Tcl_SetResult(interp, dsPtr->string, TCL_VOLATILE);
+#if 0
}
+#endif
dsPtr->string = dsPtr->staticSpace;
dsPtr->length = 0;
@@ -2672,6 +2676,7 @@ Tcl_DStringGetResult(
Tcl_DString *dsPtr) /* Dynamic string that is to become the result
* of interp. */
{
+#if 0
Interp *iPtr = (Interp *) interp;
if (dsPtr->string != dsPtr->staticSpace) {
@@ -2710,6 +2715,14 @@ Tcl_DStringGetResult(
iPtr->result = iPtr->resultSpace;
iPtr->resultSpace[0] = 0;
+#else
+ int length;
+ char *bytes = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length);
+
+ Tcl_DStringFree(dsPtr);
+ Tcl_DStringAppend(dsPtr, bytes, length);
+ Tcl_ResetResult(interp);
+#endif
}
/*