diff options
author | dgp <dgp@users.sourceforge.net> | 2016-03-30 17:15:44 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-03-30 17:15:44 (GMT) |
commit | 6a381b9d0892f3bc68b0a1325f16098f05c0a2ca (patch) | |
tree | e003d15f42fcf4d3e25213168c505784767243ea | |
parent | 94a6be693df626b2e975b0e442f827a863d0bef2 (diff) | |
download | tcl-6a381b9d0892f3bc68b0a1325f16098f05c0a2ca.zip tcl-6a381b9d0892f3bc68b0a1325f16098f05c0a2ca.tar.gz tcl-6a381b9d0892f3bc68b0a1325f16098f05c0a2ca.tar.bz2 |
Remove direct access to Tcl_Obj typePtr field that does nothing of any
obvious benefit.
-rw-r--r-- | generic/tclTimer.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/generic/tclTimer.c b/generic/tclTimer.c index c10986a..d819657 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -789,7 +789,7 @@ Tcl_AfterObjCmd( AfterInfo *afterPtr; AfterAssocData *assocPtr; int length; - int index; + int index = -1; static const char *const afterSubCmds[] = { "cancel", "idle", "info", NULL }; @@ -818,15 +818,9 @@ Tcl_AfterObjCmd( * First lets see if the command was passed a number as the first argument. */ - if (objv[1]->typePtr == &tclIntType -#ifndef TCL_WIDE_INT_IS_LONG - || objv[1]->typePtr == &tclWideIntType -#endif - || objv[1]->typePtr == &tclBignumType - || (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "", 0, - &index) != TCL_OK)) { - index = -1; - if (Tcl_GetWideIntFromObj(NULL, objv[1], &ms) != TCL_OK) { + if (Tcl_GetWideIntFromObj(NULL, objv[1], &ms) != TCL_OK) { + if (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "", 0, &index) + != TCL_OK) { const char *arg = Tcl_GetString(objv[1]); Tcl_SetObjResult(interp, Tcl_ObjPrintf( |