[PATCH 1/1] shared: add nm_streq() and nm_streq0() macro

2016-02-12 Thread Thomas Haller
Using strcmp() to test for string equality is a well known pattern. However the inverse logic still hurts my brain every single time, especially in more complex expressions. nm_streq() should be preferred over strcmp(). And there is a counterpart nm_streq0() which uses g_strcmp0(). Kernel and

Re: [PATCH 1/1] shared: add nm_streq() and nm_streq0() macro

2016-02-12 Thread Dan Williams
On Fri, 2016-02-12 at 12:34 +0100, Thomas Haller wrote: > Using strcmp() to test for string equality is a well known pattern. > However the inverse logic still hurts my brain every single time, > especially in more complex expressions. > > nm_streq() should be preferred over strcmp(). And there