Index: TODO =================================================================== diff -u -rccca1a502b5c9b77ecfd8ce16c59d77b14f0ccfd -re5a42b6e8b73958a2532bfe604f16c3cab32cb62 --- TODO (.../TODO) (revision ccca1a502b5c9b77ecfd8ce16c59d77b14f0ccfd) +++ TODO (.../TODO) (revision e5a42b6e8b73958a2532bfe604f16c3cab32cb62) @@ -5758,6 +5758,8 @@ - added flags "-debug" and "-deprecated" to XOTcl 2 "instproc", "proc", "instforward" and "forward" methods + +- turned all for-loops controlled over a nonnull value into while loops. ======================================================================== TODO: - add regression tests for debug and deprecated in methods (behavior) @@ -5787,27 +5789,6 @@ nsf::method::property /obj/ ?-per-object? /method/ deprecated ?0|1? -- CHECK: - [nx::Class info methods -path "info lookup *"] returns "{info lookup parameters} {info lookup mixins} ..." - however, - nx::Class info method type {info lookup parameters} - returns "", while e.g. - nx::Class info method type {info method handle} - returns "scripted". The problem is not the case that the method is - an ensemble method, but probably the case that it is defined as an alias - pointing to nx:Object::...:info (same with "info has") - nx::Class alias "info lookup" ::nx::Object::slot::__info::lookup - nx::Class alias "info has" ::nx::Object::slot::__info::has - However, when this two lines are commented out, everything looks fine, - the regression test and OpenACS work without problems. - - -> check, whether the definitions can be eliminated, or whether the regression - test has to be extended. The result of - nx::Class info lookup methods -path - looks fine to me. - - - - gcc6: * ISOBJ(methodObj); will raise a warning, when methodObj is declared as nonnull * gcc6 seems to have a bug: when e.g. a variable "foo" is declared as nonnull, @@ -5819,7 +5800,6 @@ } while (foo != NULL); will raise a warning, despite of the fact that foo is overwritten. - * a few more for-loops have to be turned into do/while loops to avoid the warnings. - maybe use as well "$obj eval $cmd" for valuechangedcmd Index: generic/nsf.c =================================================================== diff -u -rdadf28efd0707ae40076f49837e6b45ad5b2a989 -re5a42b6e8b73958a2532bfe604f16c3cab32cb62 --- generic/nsf.c (.../nsf.c) (revision dadf28efd0707ae40076f49837e6b45ad5b2a989) +++ generic/nsf.c (.../nsf.c) (revision e5a42b6e8b73958a2532bfe604f16c3cab32cb62) @@ -8894,7 +8894,7 @@ /* * Iterate over the subclass hierarchy. */ - for (; likely(subClasses != NULL); subClasses = subClasses->nextPtr) { + do { Tcl_HashSearch hSrch; Tcl_HashEntry *hPtr; Tcl_HashTable *instanceTablePtr; @@ -8923,7 +8923,8 @@ object->flags &= ~NSF_MIXIN_ORDER_VALID; } } - } + subClasses = subClasses->nextPtr; + } while (subClasses != NULL); } @@ -9334,14 +9335,16 @@ nonnull_assert(name != NULL); nonnull_assert(clPtr != NULL); - for (; likely(mixinList != NULL); mixinList = mixinList->nextPtr) { + do { NsfClass *foundCl = NsfGetClassFromCmdPtr(mixinList->cmdPtr); if ((foundCl != NULL) && SearchCMethod(foundCl, name, &cmd)) { *clPtr = foundCl; return cmd; } - } + mixinList = mixinList->nextPtr; + } while (mixinList != NULL); + return NULL; }