Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-03 Thread Bernd Petrovitsch
On Fri, 2020-07-03 at 08:12 +0200, Tito wrote: [...] > Improved version: > > char* last_char_is(const char *s, int c) { > if (!s || !*s) return NULL; > while (*(s + 1))s++; > return (c == *s) ? (char *)s : NULL; > } I like that;-) > or if you like gotos: > > char* FAST_FUNC l

Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-03 Thread Jody Bruchon
This is what I love about coding. We'll play with optimizing some of the simplest and least important things on a whim. May the winds of hackerdom ever be in your favor. On July 3, 2020 3:34:23 AM EDT, Bernd Petrovitsch wrote: >On Fri, 2020-07-03 at 08:12 +0200, Tito wrote: >[...] >> Improved

Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-03 Thread Xabier Oneca -- xOneca
Hi all, > >On Fri, 2020-07-03 at 08:12 +0200, Tito wrote: > >[...] > >> Improved version: > >> > >> char* last_char_is(const char *s, int c) { > >> if (!s || !*s) return NULL; > >> while (*(s + 1))s++; > >> return (c == *s) ? (char *)s : NULL; > >> } Let me "improve" the Tito's -1

Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-03 Thread Tito
On 7/3/20 6:13 PM, Xabier Oneca -- xOneca wrote: > Hi all, > >>> On Fri, 2020-07-03 at 08:12 +0200, Tito wrote: >>> [...] Improved version: char* last_char_is(const char *s, int c) { if (!s || !*s) return NULL; while (*(s + 1))s++; return (c == *s) ?

Re: Applet hwclock does not work

2020-07-03 Thread Markus Gothe
Hi,please submit a patch with #ifdef's checking for the specific version and above of glibc with defines for the current function call and the new. IFF that's what have been changed.BR,Markus

Re: [PATCH 3/4] lsscsi: code shrink and refactor

2020-07-03 Thread Markus Gothe
As the original author of the applet I don't want to see atoi() calls in the code. You know what atoi() returns when it fails? Same as atoi("0"). Please use bb_stroi() for signed integers. BR, Markus Sent from my BlackBerry - the most secure mobile device   Original Message   Fr