On (28/08/15 09:03), Petr Cech wrote:
Hi everyone,
I would like to ask you what you think about the initialization of iterative
variables in forloops. I know that present code style does not allow it. But
how I recognized, we use C99, and this feature is here now.
(example)
Instead of:|
|||# inti;
# for(i =0;...)|||
we could write:
||# for(inti =0;...)|
^
There is a synteax error;
variable inti is not definded :-)
s/inti/int i/
otherwise +1
and there are also precedents in sssd code.
src/lib/sifp/sss_sifp_parser.c:434: for (unsigned int i = 0;
src/providers/ipa/ipa_init.c:103: for (int i = 0; list[i]; i++) {
src/tests/ipa_ldap_opt-tests.c:267: for (int i=0; i < SDAP_OPTS_BASIC; i++) {
src/tools/tools_mc_util.c:173: for (size_t i = 0; i < steps_count; ++i) {
src/util/domain_info_utils.c:74: for (int i=0; parent->sd_enumerate[i]; i++) {
LS