[PATCH] Core: added const qualifier to ngx_parse_http_time argument

Maxim Dounin mdounin at mdounin.ru
Fri Jan 5 21:56:13 UTC 2018


Hello!

On Fri, Jan 05, 2018 at 05:56:40PM +0800, Zexuan Luo wrote:

> # HG changeset patch
> # User spacewander <spacewanderlzx at gmail.com>
> # Date 1515142886 -28800
> #      Fri Jan 05 17:01:26 2018 +0800
> # Node ID 17d6674fe60421961903d913831d7d19b351bd11
> # Parent  6d2e92acb013224e6ef2c71c9e61ab07f0b03271
> Core: added const qualifier to ngx_parse_http_time argument
> 
> 'ngx_parse_http_time(u_char *value, size_t len)' doesn't change the 'value'
> actually, so it is safe to add const qualifier to it. With this change we could
> pass const string without hacky '(u_char *)' casting.

No, thanks.

We generally don't use const qualifiers in the code since it adds 
little to no value, but is viral and forces ugly casts and/or 
const qualifiers in other parts of the code.

[...]

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list