<meta http-equiv="Content-Type" content="text/html; charset=GB18030"><div><br></div><div><div>Seems more comprehensive and the commit message is more accurate</div><div>now, thank you.</div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From:</b>                                                                                                                        "nginx-devel"                                                                                    <ru@nginx.com>;</div><div><b>Date:</b> Sat, Jul 25, 2020 03:58 AM</div><div><b>To:</b> "nginx-devel"<nginx-devel@nginx.org>;<wbr></div><div></div><div><b>Subject:</b> Re: [PATCH] Core: enclosed parameters of macros in parentheses.</div></div><div><br></div>On Sat, Jul 18, 2020 at 08:09:30PM +0800, balus wrote:<br>> # HG changeset patch<br>> # User balus <balus@foxmail.com&gt;<br>> # Date 1595073121 -28800<br>> #&nbsp; &nbsp; &nbsp; Sat Jul 18 19:52:01 2020 +0800<br>> # Node ID 92d9878c0c7549345f0a144cd81a6b6d45f21fc6<br>> # Parent&nbsp; 32a343635b50662979975e1204417bb1fc7e1b1f<br>> Core: enclosed parameters of macros in parentheses.<br><br>I'm going to commit the following updated patch:<br><br># HG changeset patch<br># User balus <balus@foxmail.com><br># Date 1595399139 -10800<br>#      Wed Jul 22 09:25:39 2020 +0300<br># Node ID 827f61a45a12382773c4053e7858594c2ce611c0<br># Parent  4f30f75dbdf33d6fae9e70086e0df5cbab7db027<br>Core: enclosed parameters of the ngx_buf.h macros in parentheses.<br><br>diff --git a/src/core/ngx_buf.h b/src/core/ngx_buf.h<br>--- a/src/core/ngx_buf.h<br>+++ b/src/core/ngx_buf.h<br>@@ -125,20 +125,20 @@ typedef struct {<br> #define NGX_CHAIN_ERROR     (ngx_chain_t *) NGX_ERROR<br> <br> <br>-#define ngx_buf_in_memory(b)        (b->temporary || b->memory || b->mmap)<br>-#define ngx_buf_in_memory_only(b)   (ngx_buf_in_memory(b) && !b->in_file)<br>+#define ngx_buf_in_memory(b)       ((b)->temporary || (b)->memory || (b)->mmap)<br>+#define ngx_buf_in_memory_only(b)  (ngx_buf_in_memory(b) && !(b)->in_file)<br> <br> #define ngx_buf_special(b)                                                   \<br>-    ((b->flush || b->last_buf || b->sync)                                    \<br>-     && !ngx_buf_in_memory(b) && !b->in_file)<br>+    (((b)->flush || (b)->last_buf || (b)->sync)                              \<br>+     && !ngx_buf_in_memory(b) && !(b)->in_file)<br> <br> #define ngx_buf_sync_only(b)                                                 \<br>-    (b->sync                                                                 \<br>-     && !ngx_buf_in_memory(b) && !b->in_file && !b->flush && !b->last_buf)<br>+    ((b)->sync && !ngx_buf_in_memory(b)                                      \<br>+     && !(b)->in_file && !(b)->flush && !(b)->last_buf)<br> <br> #define ngx_buf_size(b)                                                      \<br>-    (ngx_buf_in_memory(b) ? (off_t) (b->last - b->pos):                      \<br>-                            (b->file_last - b->file_pos))<br>+    (ngx_buf_in_memory(b) ? (off_t) ((b)->last - (b)->pos):                  \<br>+                            ((b)->file_last - (b)->file_pos))<br> <br> ngx_buf_t *ngx_create_temp_buf(ngx_pool_t *pool, size_t size);<br> ngx_chain_t *ngx_create_chain_of_bufs(ngx_pool_t *pool, ngx_bufs_t *bufs);<br>@@ -149,8 +149,8 @@ ngx_chain_t *ngx_create_chain_of_bufs(ng<br> <br> ngx_chain_t *ngx_alloc_chain_link(ngx_pool_t *pool);<br> #define ngx_free_chain(pool, cl)                                             \<br>-    cl->next = pool->chain;                                                  \<br>-    pool->chain = cl<br>+    (cl)->next = (pool)->chain;                                              \<br>+    (pool)->chain = (cl)<br> <br> <br> <br>_______________________________________________<br>nginx-devel mailing list<br>nginx-devel@nginx.org<br>http://mailman.nginx.org/mailman/listinfo/nginx-devel<br></div>