mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02: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
@ -39,7 +39,7 @@
|
|||||||
__p = malloc(((__len) >= sizeof (void *)) ? \
|
__p = malloc(((__len) >= sizeof (void *)) ? \
|
||||||
(__len) : sizeof(void *)); \
|
(__len) : sizeof(void *)); \
|
||||||
else { \
|
else { \
|
||||||
__pool = *(void **)(__pool); \
|
(__pool) = *(void **)(__pool); \
|
||||||
} \
|
} \
|
||||||
__p; \
|
__p; \
|
||||||
})
|
})
|
||||||
@ -87,8 +87,8 @@
|
|||||||
*/
|
*/
|
||||||
#define pool_free(type, ptr) \
|
#define pool_free(type, ptr) \
|
||||||
({ \
|
({ \
|
||||||
*(void **)ptr = (void *)pool_##type; \
|
*(void **)(ptr) = (void *)pool_##type; \
|
||||||
pool_##type = (void *)ptr; \
|
pool_##type = (void *)(ptr); \
|
||||||
})
|
})
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -171,11 +171,11 @@ void *pool_destroy2(struct pool_head *pool);
|
|||||||
#define pool_alloc2(pool) \
|
#define pool_alloc2(pool) \
|
||||||
({ \
|
({ \
|
||||||
void *__p; \
|
void *__p; \
|
||||||
if ((__p = pool->free_list) == NULL) \
|
if ((__p = (pool)->free_list) == NULL) \
|
||||||
__p = pool_refill_alloc(pool); \
|
__p = pool_refill_alloc(pool); \
|
||||||
else { \
|
else { \
|
||||||
pool->free_list = *(void **)pool->free_list; \
|
(pool)->free_list = *(void **)(pool)->free_list;\
|
||||||
pool->used++; \
|
(pool)->used++; \
|
||||||
} \
|
} \
|
||||||
__p; \
|
__p; \
|
||||||
})
|
})
|
||||||
@ -192,9 +192,9 @@ void *pool_destroy2(struct pool_head *pool);
|
|||||||
#define pool_free2(pool, ptr) \
|
#define pool_free2(pool, ptr) \
|
||||||
({ \
|
({ \
|
||||||
if (likely((ptr) != NULL)) { \
|
if (likely((ptr) != NULL)) { \
|
||||||
*(void **)ptr = (void *)pool->free_list;\
|
*(void **)(ptr) = (void *)(pool)->free_list; \
|
||||||
pool->free_list = (void *)ptr; \
|
(pool)->free_list = (void *)(ptr); \
|
||||||
pool->used--; \
|
(pool)->used--; \
|
||||||
} \
|
} \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user