On 24 April 2017 at 11:32, Karel Zak <kzak@xxxxxxxxxx> wrote: > On Sun, Apr 23, 2017 at 09:58:17PM +0100, Sami Kerola wrote: >> Compilers probably got these evaluations right, but it is best not to leave >> any room of interpretation what is the human intention. > > Not sure if I like the patch.... the operators precedence is > important to understand C code, not sure if we want to use '(' ')' > everywhere to keep readers uneducated. > > Yes, in some complex conditions it makes sense (multi-line if()), but > this is not the case. > >> - return lb->flags & FDISK_LABEL_FL_REQUIRE_GEOMETRY ? 1 : 0; >> + return (lb->flags & FDISK_LABEL_FL_REQUIRE_GEOMETRY) ? 1 : 0; > > All the "<someting> ? 1 : 0" is non-elegant, what about: > > return !!(lb->flags & FDISK_LABEL_FL_REQUIRE_GEOMETRY); > > to keep code simple, fast and humans happy :) I dropped this change from my 2017wk16 branch. Maybe someday later I will come back to getting rid of none-elegant stuff. -- Sami Kerola http://www.iki.fi/kerolasa/ -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html