On 08/28/2015 09:18 AM, Lukas Slebodnik wrote:
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/

Sorry for typo. My mail client plays game with me.

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
_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to