Re: [PATCH] Removed the unsafe ngx_memcmp() wrapper for memcmp(3)

2022-11-08 Thread Alejandro Colomar
Hi Maxim! On 11/8/22 10:50, Maxim Dounin wrote: [...] Another possibility is that these casts were simply added based on the ngx_str*() macro definitions and weren't actually needed. Yeah, that was my most-likely guess. But wanted to consider other possibilities just in case. Especially

Re: [PATCH] Removed the unsafe ngx_memcmp() wrapper for memcmp(3)

2022-11-08 Thread Maxim Dounin
Hello! On Sun, Nov 06, 2022 at 11:50:38PM +0100, Alejandro Colomar wrote: > On 11/5/22 03:39, Maxim Dounin wrote: > > The ngx_memcpy() macro was introduced in 107:b5be4b0448d3 > > (nginx-0.0.1-2003-07-01-19:00:03 import) as an alias to memcmp(), > > with the following explanation why it's just an

Re: [PATCH] Removed the unsafe ngx_memcmp() wrapper for memcmp(3)

2022-11-06 Thread Alejandro Colomar
Hello Maxim! On 11/5/22 03:39, Maxim Dounin wrote: The ngx_memcpy() macro was introduced in 107:b5be4b0448d3 (nginx-0.0.1-2003-07-01-19:00:03 import) as an alias to memcmp(), with the following explanation why it's just an alias: +/* msvc and icc compile memcmp() to inline loop */ +#define ngx_

Re: [PATCH] Removed the unsafe ngx_memcmp() wrapper for memcmp(3)

2022-11-04 Thread Maxim Dounin
Hello! On Fri, Nov 04, 2022 at 04:24:14PM +0100, Alejandro Colomar wrote: > The casts are unnecessary, since memcmp(3)'s arguments are > 'const void *', which allows implicit conversion from any pointer type. > It might have been necessary in the times of K&R C, where 'void *' > didn't exist yet,

Re: [PATCH] Removed the unsafe ngx_memcmp() wrapper for memcmp(3)

2022-11-04 Thread Alejandro Colomar
On 11/4/22 16:24, Alejandro Colomar wrote: The changes, apart from the removal of the macro itself, were scripted: $ find src/ -type f \ | grep '\.[ch]$' \ | xargs sed -i 's/ngx_memcmp/memcmp/'; And after running the script, I compressed manually some lines that could be compressed, suc