Denys Vlasenko wrote: > Hi Bernhard, folks, > > Can you indicate what coding style you prefer > in uclibc? > Hi Denys, my preferred style is kernel's one, I don't think uclibc has a preferred one, even if, yesy, a Coding style rules could be useful.
> Curretly we have a mixture of all kinds, > GNU style with its uniquely difficult placement > of {}s: > > if (set == NULL || signo <= 0 || signo >= NSIG) > { > __set_errno (EINVAL); > return -1; > } > > indent-by-4 style: > > if (act) { > kact.k_sa_handler = act->sa_handler; > kact.sa_mask = act->sa_mask.__val[0]; > kact.sa_flags = act->sa_flags; > # ifdef HAVE_SA_RESTORER > if (kact.sa_flags & SA_RESTORER) { > kact.sa_restorer = act->sa_restorer; > } else { > kact.sa_restorer = choose_restorer (kact.sa_flags); > kact.sa_flags |= SA_RESTORER; > } > # endif > } > > Linux kernel style: > > if (bufsize > count) { > bufsize = count; > if (count == 0) { /* We're at the end of the > buffer... */ > __set_errno(EFBIG); > return -1; > } > } > > etc. > > > Can you let us know what aspects of style you plan to > make more uniform, and in what way; what you don't plan > to regulate. > > For example, how would you write this? > > while ((n > 1) > && ((wi = fgetwc_unlocked(stream)) != WEOF) > && ((*p++ = wi) != '\n') > ) { > --n; > } > I'd write as follow: while ((n > 1) && ((wi = fgetwc_unlocked(stream)) != WEOF) && ((*p++ = wi) != '\n')) { --n; } > I promise to not engage in gratuitous style changes, > there will be no rain of commits with s/spaces/tabs/, :) > good ;-) > I merely plan to follow the agreed-on style in the code > I touch. > > -- > vda carmelo > _______________________________________________ > uClibc mailing list > uClibc@uclibc.org > http://busybox.net/cgi-bin/mailman/listinfo/uclibc > _______________________________________________ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc