Welcome! Log In Create A New Profile

Advanced

[njs] Introduced njs_chb_append_str() as inline function.

Dmitry Volyntsev
July 22, 2020 07:28AM
details: https://hg.nginx.org/njs/rev/a9e536ca9b69
branches:
changeset: 1473:a9e536ca9b69
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Wed Jul 22 11:27:18 2020 +0000
description:
Introduced njs_chb_append_str() as inline function.

To catch erroneous passing of njs_string_prop_t (instead of njs_str_t)
in compile time.

diffstat:

src/njs_chb.h | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 855edd76bdb6 -r a9e536ca9b69 src/njs_chb.h
--- a/src/njs_chb.h Wed Jul 15 19:19:19 2020 +0300
+++ b/src/njs_chb.h Wed Jul 22 11:27:18 2020 +0000
@@ -43,9 +43,6 @@ void njs_chb_destroy(njs_chb_t *chain);
#define njs_chb_append_literal(chain, literal) \
njs_chb_append0(chain, literal, njs_length(literal))

-#define njs_chb_append_str(chain, str) \
- njs_chb_append0(chain, (const char *) (str)->start, (str)->length)
-

#define njs_chb_node_size(n) (size_t) ((n)->pos - (n)->start)
#define njs_chb_node_room(n) (size_t) ((n)->end - (n)->pos)
@@ -61,6 +58,13 @@ njs_chb_init(njs_chb_t *chain, njs_mp_t
}


+njs_inline void
+njs_chb_append_str(njs_chb_t *chain, njs_str_t *str)
+{
+ njs_chb_append0(chain, (const char *) str->start, str->length);
+}
+
+
njs_inline int64_t
njs_chb_size(njs_chb_t *chain)
{
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Introduced njs_chb_append_str() as inline function.

Dmitry Volyntsev 91 July 22, 2020 07:28AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 80
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready