summaryrefslogtreecommitdiffstats
path: root/generic/tclTestObj.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-11-25 23:19:01 (GMT)
committernijtmans <nijtmans>2008-11-25 23:19:01 (GMT)
commit00452d9d7d4d961a4659fc21e69febb307d184f0 (patch)
tree30839af6e8ba95ccd3b3546349a8e12b36608a0b /generic/tclTestObj.c
parent27413e2e6be699ec19189b0c87894f786205deb5 (diff)
downloadtcl-00452d9d7d4d961a4659fc21e69febb307d184f0.zip
tcl-00452d9d7d4d961a4659fc21e69febb307d184f0.tar.gz
tcl-00452d9d7d4d961a4659fc21e69febb307d184f0.tar.bz2
Eliminate 3 calls to Tcl_SetResult, as
examples how it should have been done. purpose: contribute in the TIP #340 discussion.
Diffstat (limited to 'generic/tclTestObj.c')
-rw-r--r--generic/tclTestObj.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index 842cbd0..c643822 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTestObj.c,v 1.25 2008/10/16 22:34:19 nijtmans Exp $
+ * RCS: @(#) $Id: tclTestObj.c,v 1.26 2008/11/25 23:19:02 nijtmans Exp $
*/
#include "tclInt.h"
@@ -930,8 +930,7 @@ TestobjCmd(
if (CheckIfVarUnset(interp, varIndex)) {
return TCL_ERROR;
}
- TclFormatInt(buf, varPtr[varIndex]->refCount);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(varPtr[varIndex]->refCount));
} else if (strcmp(subCmd, "type") == 0) {
if (objc != 3) {
goto wrongNumArgs;