summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-10-08 14:42:44 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-10-08 14:42:44 (GMT)
commit76faac0f28fe9661f23ff9e35f44df1d899420e5 (patch)
tree7e3de1d0523d70328cfd81d9864b897058823d34 /generic/tclCmdIL.c
parent98a6fcad96289a40b501fbd2095387a245fd804d (diff)
downloadtcl-76faac0f28fe9661f23ff9e35f44df1d899420e5.zip
tcl-76faac0f28fe9661f23ff9e35f44df1d899420e5.tar.gz
tcl-76faac0f28fe9661f23ff9e35f44df1d899420e5.tar.bz2
TIP#237 IMPLEMENTATION
[kennykb-numerics-branch] Resynchronized with the HEAD; at this checkpoint [-rkennykb-numerics-branch-20051008], the HEAD and kennykb-numerics-branch contain identical code.
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index b98cf56..c7a9d83 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.81 2005/09/14 21:32:17 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.82 2005/10/08 14:42:44 dgp Exp $
*/
#include "tclInt.h"
@@ -301,16 +301,19 @@ Tcl_IncrObjCmd(dummy, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
+#if 0
long incrAmount = 1;
Tcl_WideInt wideIncrAmount;
- Tcl_Obj *newValuePtr;
int isWide = 0;
+#endif
+ Tcl_Obj *newValuePtr, *incrPtr;
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "varName ?increment?");
return TCL_ERROR;
}
+#if 0
/*
* Calculate the amount to increment by.
*/
@@ -357,6 +360,18 @@ Tcl_IncrObjCmd(dummy, interp, objc, objv)
newValuePtr = TclIncrVar2(interp, objv[1], (Tcl_Obj *) NULL,
incrAmount, TCL_LEAVE_ERR_MSG);
}
+#else
+ if (objc == 3) {
+ incrPtr = objv[2];
+ } else {
+ incrPtr = Tcl_NewIntObj(1);
+ }
+ Tcl_IncrRefCount(incrPtr);
+ newValuePtr = TclIncrObjVar2(interp, objv[1], NULL,
+ incrPtr, TCL_LEAVE_ERR_MSG);
+ Tcl_DecrRefCount(incrPtr);
+
+#endif
if (newValuePtr == NULL) {
return TCL_ERROR;
}