Re: [PATCH libinput] evdev: replace null sentinel with ARRAY_SIZE

2017-05-10 Thread Peter Hutterer
On Wed, May 10, 2017 at 11:13:07AM +0100, Eric Engestrom wrote: > Signed-off-by: Eric Engestrom > --- > src/evdev.c | 17 +++-- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/src/evdev.c b/src/evdev.c > index a2be6fc..7895644 100644 >

Re: [PATCH libinput] evdev: replace null sentinel with ARRAY_SIZE

2017-05-10 Thread Eric Engestrom
On Wednesday, 2017-05-10 17:25:04 +0200, Jan Engelhardt wrote: > > On Wednesday 2017-05-10 17:20, Dima Ryazanov wrote: > > +#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a)[0]) > > > > > >I'm guessing this works, but "sizeof(a)[0]" looks very unintuitive to me. I > >think "sizeof(a[0])" is > >the

Re: [PATCH libinput] evdev: replace null sentinel with ARRAY_SIZE

2017-05-10 Thread Jan Engelhardt
On Wednesday 2017-05-10 17:20, Dima Ryazanov wrote: > +#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a)[0]) > > >I'm guessing this works, but "sizeof(a)[0]" looks very unintuitive to me. I >think "sizeof(a[0])" is >the convention? If going with the sizeof(T) syntax, then the answer would be

Re: [PATCH libinput] evdev: replace null sentinel with ARRAY_SIZE

2017-05-10 Thread Dima Ryazanov
On May 10, 2017 7:14 AM, "Eric Engestrom" wrote: Signed-off-by: Eric Engestrom --- src/evdev.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index a2be6fc..7895644 100644