Welcome! Log In Create A New Profile

Advanced

[nginx] Core: enclosed parameters of the ngx_buf.h macros in parentheses.

July 27, 2020 06:30AM
details: https://hg.nginx.org/nginx/rev/2f9214713666
branches:
changeset: 7688:2f9214713666
user: balus <balus@foxmail.com>
date: Mon Jul 27 13:21:51 2020 +0300
description:
Core: enclosed parameters of the ngx_buf.h macros in parentheses.

diffstat:

src/core/ngx_buf.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)

diffs (43 lines):

diff -r d752a2c76d49 -r 2f9214713666 src/core/ngx_buf.h
--- a/src/core/ngx_buf.h Thu Jul 23 17:31:09 2020 +0300
+++ b/src/core/ngx_buf.h Mon Jul 27 13:21:51 2020 +0300
@@ -125,20 +125,20 @@ typedef struct {
#define NGX_CHAIN_ERROR (ngx_chain_t *) NGX_ERROR


-#define ngx_buf_in_memory(b) (b->temporary || b->memory || b->mmap)
-#define ngx_buf_in_memory_only(b) (ngx_buf_in_memory(b) && !b->in_file)
+#define ngx_buf_in_memory(b) ((b)->temporary || (b)->memory || (b)->mmap)
+#define ngx_buf_in_memory_only(b) (ngx_buf_in_memory(b) && !(b)->in_file)

#define ngx_buf_special(b) \
- ((b->flush || b->last_buf || b->sync) \
- && !ngx_buf_in_memory(b) && !b->in_file)
+ (((b)->flush || (b)->last_buf || (b)->sync) \
+ && !ngx_buf_in_memory(b) && !(b)->in_file)

#define ngx_buf_sync_only(b) \
- (b->sync \
- && !ngx_buf_in_memory(b) && !b->in_file && !b->flush && !b->last_buf)
+ ((b)->sync && !ngx_buf_in_memory(b) \
+ && !(b)->in_file && !(b)->flush && !(b)->last_buf)

#define ngx_buf_size(b) \
- (ngx_buf_in_memory(b) ? (off_t) (b->last - b->pos): \
- (b->file_last - b->file_pos))
+ (ngx_buf_in_memory(b) ? (off_t) ((b)->last - (b)->pos): \
+ ((b)->file_last - (b)->file_pos))

ngx_buf_t *ngx_create_temp_buf(ngx_pool_t *pool, size_t size);
ngx_chain_t *ngx_create_chain_of_bufs(ngx_pool_t *pool, ngx_bufs_t *bufs);
@@ -149,8 +149,8 @@ ngx_chain_t *ngx_create_chain_of_bufs(ng

ngx_chain_t *ngx_alloc_chain_link(ngx_pool_t *pool);
#define ngx_free_chain(pool, cl) \
- cl->next = pool->chain; \
- pool->chain = cl
+ (cl)->next = (pool)->chain; \
+ (pool)->chain = (cl)



_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Core: enclosed parameters of the ngx_buf.h macros in parentheses.

ru@nginx.com 642 July 27, 2020 06:30AM



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

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready