Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-23 Thread Jim Meyering
On Thu, May 22, 2014 at 12:04 AM, Paul Eggert wrote: > Jim Meyering wrote: >> >> What about the conflict with modules/streq? >> There are over 300 uses of STREQ in gnulib and coreutils. >> Are you suggesting to change all of those? > > > Yes. But if this is too much all at once, let's just call t

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-22 Thread Paul Eggert
Jim Meyering wrote: What about the conflict with modules/streq? There are over 300 uses of STREQ in gnulib and coreutils. Are you suggesting to change all of those? Yes. But if this is too much all at once, let's just call the inline function 'STREQ'. We can rename it to 'streq' later, if an

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Jim Meyering
On Wed, May 21, 2014 at 9:54 PM, Paul Eggert wrote: > Kieran Colford wrote: >> >> I deliberately chose to use it as a macro and call it this because that >> is how it is done everywhere else in gnulib. > > > Sure, but let's take this opportunity to do a better API, while we're making > a module fo

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Kieran Colford
On 14-05-22 12:54 AM, Paul Eggert wrote: > Kieran Colford wrote: >> I deliberately chose to use it as a macro and call it this because that >> is how it is done everywhere else in gnulib. > > Sure, but let's take this opportunity to do a better API, while we're > making a module for it. So my s

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Paul Eggert
Kieran Colford wrote: I deliberately chose to use it as a macro and call it this because that is how it is done everywhere else in gnulib. Sure, but let's take this opportunity to do a better API, while we're making a module for it. So my suggestion would be to replace STREQ with streq unifo

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Eric Blake
On 05/21/2014 10:31 PM, Eric Blake wrote: > On 05/21/2014 09:33 PM, Kieran Colford wrote: >> --- >> lib/stringops.h | 31 +++ >> modules/stringops | 22 ++ >> 2 files changed, 53 insertions(+) >> create mode 100644 lib/stringops.h >> create m

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Eric Blake
On 05/21/2014 09:33 PM, Kieran Colford wrote: > --- > lib/stringops.h | 31 +++ > modules/stringops | 22 ++ > 2 files changed, 53 insertions(+) > create mode 100644 lib/stringops.h > create mode 100644 modules/stringops Your commit message

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Kieran Colford
On 14-05-22 12:28 AM, Eric Blake wrote: > On 05/21/2014 10:14 PM, Paul Eggert wrote: >> Kieran Colford wrote: >>> +#define STRNEQ(X, Y) (strcmp (X, Y) != 0) >> >> 1. This name is poorly chosen (it looks too much like "strncmp", which >> means something quite different) and it's not needed (people

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Eric Blake
On 05/21/2014 10:14 PM, Paul Eggert wrote: > Kieran Colford wrote: >> +#define STRNEQ(X, Y) (strcmp (X, Y) != 0) > > 1. This name is poorly chosen (it looks too much like "strncmp", which > means something quite different) and it's not needed (people can just > use "!STREQ"). > > 2. STREQ shoul

Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Paul Eggert
Kieran Colford wrote: +#define STRNEQ(X, Y) (strcmp (X, Y) != 0) 1. This name is poorly chosen (it looks too much like "strncmp", which means something quite different) and it's not needed (people can just use "!STREQ"). 2. STREQ should be an inline function, not a macro. There's little

[PATCH] Added a module stringops that provides STREQ and STRNEQ

2014-05-21 Thread Kieran Colford
--- lib/stringops.h | 31 +++ modules/stringops | 22 ++ 2 files changed, 53 insertions(+) create mode 100644 lib/stringops.h create mode 100644 modules/stringops diff --git a/lib/stringops.h b/lib/stringops.h new file mode 100644 index