On 04/01/2013 07:10 PM, Bill Spitzak wrote:
> Emilio Pozuelo Monfort wrote:
> 
>> I would rather do something like this to simplify the code (at least it looks
>> clearer to me but YMMV):
>>
>>     if (load_modules(ec, option_modules != NULL ? option_modules : modules,
>>             &argc, argv, config_file) < 0)
>>         goto out;
> 
> That's better than my suggestion.
> 
> I'm not thrilled with using "x != NULL" rather than just "x" as a conditional,
> to me I find it hard to read as I almost always read it inverted (ie "x ==
> NULL") unless I look carefully. However that may be me and it may not match
> wayland coding standards?

I also prefer "x ? x : y", but I did it that way because I thought
wayland/weston always tested for x != NULL. From a quick grep it seems I was
wrong, so just "option_modules ? option_modules : modules" would be fine and
clearer.

Thanks,
Emilio
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to