diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-08 13:43:56 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-08 13:43:56 (GMT) |
| commit | 133b43a5217bb5e27bced051732443f474610b9c (patch) | |
| tree | b797bd5bf200e6fcf4c14ee68016a6b6cbc03a6c | |
| parent | 0d8a08dbf1d766bcd778253199b782a231a202e7 (diff) | |
| download | tcl-133b43a5217bb5e27bced051732443f474610b9c.zip tcl-133b43a5217bb5e27bced051732443f474610b9c.tar.gz tcl-133b43a5217bb5e27bced051732443f474610b9c.tar.bz2 | |
Better version, keeping the (undocumented) behavior of 'i' initialization
| -rw-r--r-- | generic/tclOOInt.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 8a19f74..0b49359 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -590,11 +590,11 @@ 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 * variable set to a pointer to each of those elements in turn. - * REQUIRES DECLARATION: int i; + * REQUIRES DECLARATION: int i; See [96551aca55] for more FOREACH_STRUCT details. */ #define FOREACH_STRUCT(var,ary) \ - if ((ary).num > 0) for(i=0; var=&((ary).list[i]), i<(ary).num; i++) + i=0; if ((ary).num > 0) for(; var=&((ary).list[i]), i<(ary).num; i++) /* * Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS |
