Mercurial > hg > nginx
comparison src/core/ngx_string.h @ 8109:2ffefe2f892e
Removed casts from ngx_memcmp() macro.
Casts are believed to be not needed, since memcmp() has "const void *"
arguments since introduction of the "void" type in C89. And on pre-C89
platforms nginx is unlikely to compile without warnings anyway, as there
are no casts in memcpy() and memmove() calls.
These casts were added in 1648:89a47f19b9ec without any details on why they
were added, and Igor does not remember details either. The most plausible
explanation is that they were copied from ngx_strcmp() and were not really
needed even at that time.
Prodded by Alejandro Colomar.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 30 Nov 2022 18:01:53 +0300 |
parents | 351d7f4e326f |
children |
comparison
equal
deleted
inserted
replaced
8108:351d7f4e326f | 8109:2ffefe2f892e |
---|---|
143 #define ngx_memmove(dst, src, n) (void) memmove(dst, src, n) | 143 #define ngx_memmove(dst, src, n) (void) memmove(dst, src, n) |
144 #define ngx_movemem(dst, src, n) (((u_char *) memmove(dst, src, n)) + (n)) | 144 #define ngx_movemem(dst, src, n) (((u_char *) memmove(dst, src, n)) + (n)) |
145 | 145 |
146 | 146 |
147 /* msvc and icc7 compile memcmp() to the inline loop */ | 147 /* msvc and icc7 compile memcmp() to the inline loop */ |
148 #define ngx_memcmp(s1, s2, n) memcmp((const char *) s1, (const char *) s2, n) | 148 #define ngx_memcmp(s1, s2, n) memcmp(s1, s2, n) |
149 | 149 |
150 | 150 |
151 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n); | 151 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n); |
152 u_char *ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src); | 152 u_char *ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src); |
153 u_char * ngx_cdecl ngx_sprintf(u_char *buf, const char *fmt, ...); | 153 u_char * ngx_cdecl ngx_sprintf(u_char *buf, const char *fmt, ...); |