Skip to contentSkip to conversation

mem-pool: drop trailing semicolon from macro definition

PATCH New René Scharfe. 1 participant 1 message Mar 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mem-pool: drop trailing semicolon from macro definition

Allow BLOCK_GROWTH_SIZE to be used like an integer literal by removing the trailing semicolon from its definition. Also wrap the expression in parentheses, to allow it to be used with operators without leading to unexpected results. It doesn't matter for the current use site, but make it follow standard macro rules anyway to avoid future surprises.

---
 mem-pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mem-pool.c +1 -1
index 8401761dda..ccdcad2e3d 100644
@@ -5,7 +5,7 @@
 #include "cache.h"
 #include "mem-pool.h"
 
-#define BLOCK_GROWTH_SIZE 1024*1024 - sizeof(struct mp_block);
+#define BLOCK_GROWTH_SIZE (1024 * 1024 - sizeof(struct mp_block))
 
 /*
  * Allocate a new mp_block and insert it after the block specified in

--
2.30.2