diff options
| -rw-r--r-- | generic/tclOOInt.h | 6 | ||||
| -rw-r--r-- | tests/ooUtil.test | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 725c4ce..bbe4102 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -589,12 +589,12 @@ MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr); /* * A variation where the array is an array of structs. There's no issue with * possible NULLs; every element of the array will be iterated over and the - * varable set to a pointer to each of those elements in turn. - * REQUIRES DECLARATION: int i; + * variable set to a pointer to each of those elements in turn. + * REQUIRES DECLARATION: int i; See [96551aca55] for more FOREACH_STRUCT details. */ #define FOREACH_STRUCT(var,ary) \ - for(i=0 ; var=&((ary).list[i]), i<(ary).num; i++) + if (i=0, (ary).num>0) for(; var=&((ary).list[i]), i<(ary).num; i++) /* * Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS diff --git a/tests/ooUtil.test b/tests/ooUtil.test index c8be9c8..f41c668 100644 --- a/tests/ooUtil.test +++ b/tests/ooUtil.test @@ -429,7 +429,7 @@ test ooUtil-5.1 {TIP 478: abstract} -setup { parent destroy } -result {1 1 1 123 456 ::y} -test ooUtil-6.1 {TIP 478: classvarable} -setup { +test ooUtil-6.1 {TIP 478: classvariable} -setup { oo::class create parent } -body { oo::class create xyz { @@ -459,7 +459,7 @@ test ooUtil-6.1 {TIP 478: classvarable} -setup { } -cleanup { parent destroy } -result {{1 2} {1 2} {2 3}} -test ooUtil-6.2 {TIP 478: classvarable error case} -setup { +test ooUtil-6.2 {TIP 478: classvariable error case} -setup { oo::class create parent } -body { oo::class create xyz { @@ -475,7 +475,7 @@ test ooUtil-6.2 {TIP 478: classvarable error case} -setup { } -returnCodes error -cleanup { parent destroy } -result {bad variable name "x(1)": can't create a scalar variable that looks like an array element} -test ooUtil-6.3 {TIP 478: classvarable error case} -setup { +test ooUtil-6.3 {TIP 478: classvariable error case} -setup { oo::class create parent } -body { oo::class create xyz { |
