diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-10 17:37:18 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-10 17:37:18 (GMT) |
commit | fb115db64ceb2b31b68345ef5fa6a0c2442cab8e (patch) | |
tree | fa53e822ce2d92ac9b431f3afcc8a9f785b0ce1e /generic | |
parent | eb31ffcba4c70826a0766a12f72e6ed03d5c605d (diff) | |
download | tcl-fb115db64ceb2b31b68345ef5fa6a0c2442cab8e.zip tcl-fb115db64ceb2b31b68345ef5fa6a0c2442cab8e.tar.gz tcl-fb115db64ceb2b31b68345ef5fa6a0c2442cab8e.tar.bz2 |
clarify 'yieldparameter'. Eliminate variable 'unused'
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclBasic.c | 14 | ||||
-rw-r--r-- | generic/tclExecute.c | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 2e684e7..9214994 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -8955,9 +8955,8 @@ TclNRCoroutineActivateCallback( Tcl_Interp *interp, TCL_UNUSED(int) /*result*/) { + size_t numLevels, type = PTR2INT(data[1]); CoroutineData *corPtr = (CoroutineData *)data[0]; - int unused, type = PTR2INT(data[1]); - size_t numLevels; if (!corPtr->stackLevel) { /* @@ -8974,7 +8973,7 @@ TclNRCoroutineActivateCallback( * the interp's environment to make it suitable to run this coroutine. */ - corPtr->stackLevel = &unused; + corPtr->stackLevel = &corPtr; numLevels = corPtr->auxNumLevels; corPtr->auxNumLevels = iPtr->numLevels; @@ -8988,7 +8987,7 @@ TclNRCoroutineActivateCallback( * Coroutine is active: yield */ - if (corPtr->stackLevel != &unused) { + if (corPtr->stackLevel != &corPtr) { NRE_callback *runPtr; iPtr->execEnvPtr = corPtr->callerEEPtr; @@ -9214,10 +9213,9 @@ TclNRCoroProbeObjCmd( int objc, Tcl_Obj *const objv[]) { - CoroutineData *corPtr; ExecEnv *savedEEPtr = iPtr->execEnvPtr; size_t numLevels; - int unused; + CoroutineData *corPtr; /* * Usage more or less like tailcall: @@ -9267,7 +9265,7 @@ TclNRCoroProbeObjCmd( * the interp's environment to make it suitable to run this coroutine. */ - corPtr->stackLevel = &unused; + corPtr->stackLevel = &corPtr; numLevels = corPtr->auxNumLevels; corPtr->auxNumLevels = iPtr->numLevels; @@ -9360,7 +9358,7 @@ InjectHandlerPostCall( Tcl_Obj *listPtr = (Tcl_Obj *)data[1]; size_t nargs = PTR2INT(data[2]); void *isProbe = data[3]; - int numLevels; + size_t numLevels; /* * Delete the command words for what we just executed. diff --git a/generic/tclExecute.c b/generic/tclExecute.c index b4fcbb5..b9b6459 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2369,7 +2369,7 @@ TEBCresume( { CoroutineData *corPtr; - int yieldParameter; + size_t yieldParameter; case INST_YIELD: corPtr = iPtr->execEnvPtr->corPtr; @@ -2397,7 +2397,7 @@ TEBCresume( fflush(stdout); } #endif - yieldParameter = 0; + yieldParameter = PTR2INT(NULL); /*==CORO_ACTIVATE_YIELD*/ Tcl_SetObjResult(interp, OBJ_AT_TOS); goto doYield; @@ -2452,7 +2452,7 @@ TEBCresume( TclSetTailcall(interp, valuePtr); corPtr->yieldPtr = valuePtr; iPtr->execEnvPtr = corPtr->eePtr; - yieldParameter = (PTR2INT(NULL)+1); /*==CORO_ACTIVATE_YIELDM*/ + yieldParameter = PTR2INT(NULL)+1; /*==CORO_ACTIVATE_YIELDM*/ doYield: /* TIP #280: Record the last piece of info needed by |