On Thu, May 28, 2015 at 07:52:32PM +0200, Lukas Slebodnik wrote:
On (27/05/15 11:40), Jakub Hrozek wrote:
>On Wed, May 27, 2015 at 10:41:14AM +0200, Lukas Slebodnik wrote:
>> On (27/05/15 10:38), Jakub Hrozek wrote:
>> >On Wed, May 27, 2015 at 09:52:11AM +0200, Lukas Slebodnik wrote:
>> >> >+static errno_t
>> >> >+get_krb_primary(struct map_id_name_to_krb_primary
*name_to_primary,
>> >> >+ char *id_prov_name, bool cs, const char
**_krb_primary)
>> >> >+{
>> >> >+ errno_t ret;
>> >> >+ int i = 0;
>> >> >+
>> >> >+ while(name_to_primary != NULL &&
>> >> >+ name_to_primary[i].id_name != NULL &&
>> >> ^^
>> >> I thought we have a convention
to use
>> >> binary operatort in the
begining of
>> >> line and not at the end.
>> >>
>> >> IIRC Stephen sent mail with proposal and we agreed.
>> >> Sumit uses it quite often.
>> >
>> >Is that a nack or a remark?
>> >
>> It is a start of discussion (remark).
>>
>> We should make an agreement what do we want to use.
>> If we don't like Stephen's proposal then
>> We should agree on something else.
>>
>> It's really strange to see different convention in different places.
>> and sometimes difficult (slower?) to read a code.
>
>Well, I /do/ like what Stephen proposed, but if we start using it, we
>will have different convention in different places, because previously
>we were using the boolean operators at the end of the line, as Pavel
>did..
We already have code with both version.
So we should decide which one is prefered and which one should not be used.
OK, let's amend the FreeIPA coding guidelines then.
I like the multi-line condition splitting Stephen uses:
if (fooptr == NULL
|| barptr == NULL) {
do_stuff();
}
I would also like to formally say we can use C99. In particular, dynamic
arrays are often handy if we know the size is within certain limits.
Would you like to start a separate thread?