mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 14:17:30 -04:00
[BUILD] memory: add a few missing parenthesis to the pool management macros
These missing ones caused a build error when a macro was called with operations as the argument.
This commit is contained in:
parent
aea940eb23
commit
f8f33284bd
1 changed files with 9 additions and 9 deletions
|
|
@ -39,7 +39,7 @@
|
|||
__p = malloc(((__len) >= sizeof (void *)) ? \
|
||||
(__len) : sizeof(void *)); \
|
||||
else { \
|
||||
__pool = *(void **)(__pool); \
|
||||
(__pool) = *(void **)(__pool); \
|
||||
} \
|
||||
__p; \
|
||||
})
|
||||
|
|
@ -87,8 +87,8 @@
|
|||
*/
|
||||
#define pool_free(type, ptr) \
|
||||
({ \
|
||||
*(void **)ptr = (void *)pool_##type; \
|
||||
pool_##type = (void *)ptr; \
|
||||
*(void **)(ptr) = (void *)pool_##type; \
|
||||
pool_##type = (void *)(ptr); \
|
||||
})
|
||||
|
||||
#else
|
||||
|
|
@ -171,11 +171,11 @@ void *pool_destroy2(struct pool_head *pool);
|
|||
#define pool_alloc2(pool) \
|
||||
({ \
|
||||
void *__p; \
|
||||
if ((__p = pool->free_list) == NULL) \
|
||||
if ((__p = (pool)->free_list) == NULL) \
|
||||
__p = pool_refill_alloc(pool); \
|
||||
else { \
|
||||
pool->free_list = *(void **)pool->free_list; \
|
||||
pool->used++; \
|
||||
(pool)->free_list = *(void **)(pool)->free_list;\
|
||||
(pool)->used++; \
|
||||
} \
|
||||
__p; \
|
||||
})
|
||||
|
|
@ -192,9 +192,9 @@ void *pool_destroy2(struct pool_head *pool);
|
|||
#define pool_free2(pool, ptr) \
|
||||
({ \
|
||||
if (likely((ptr) != NULL)) { \
|
||||
*(void **)ptr = (void *)pool->free_list;\
|
||||
pool->free_list = (void *)ptr; \
|
||||
pool->used--; \
|
||||
*(void **)(ptr) = (void *)(pool)->free_list; \
|
||||
(pool)->free_list = (void *)(ptr); \
|
||||
(pool)->used--; \
|
||||
} \
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue