From eb9a408134b9356cc91927cbd46de9ad16224119 Mon Sep 17 00:00:00 2001 From: Tomas Valla Date: Mon, 22 Jul 2013 11:08:43 +0200 Subject: [PATCH] gary.h: Fixed bug in INIT_SPACE_* macros commit 629bd47e7b61b251d055dccfecf124bacad17f76 from MD2 --- ucw/gary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ucw/gary.h b/ucw/gary.h index 5630bc2f..8fa72929 100644 --- a/ucw/gary.h +++ b/ucw/gary.h @@ -20,8 +20,8 @@ struct gary_hdr { #define GARY_INIT(ptr, n) (ptr) = gary_init(sizeof(*(ptr)), (n), 0) #define GARY_INIT_ZERO(ptr, n) (ptr) = gary_init(sizeof(*(ptr)), (n), 1) -#define GARY_INIT_SPACE(ptr, n) do { GARY_INIT(ptr, n); (ptr)->num_elts = 0; } while (0) -#define GARY_INIT_SPACE_ZERO(ptr, n) do { GARY_INIT_ZERO(ptr, n); (ptr)->num_elts = 0; } while (0) +#define GARY_INIT_SPACE(ptr, n) do { GARY_INIT(ptr, n); (GARY_HDR(ptr))->num_elts = 0; } while (0) +#define GARY_INIT_SPACE_ZERO(ptr, n) do { GARY_INIT_ZERO(ptr, n); (GARY_HDR(ptr))->num_elts = 0; } while (0) #define GARY_FREE(ptr) do { if (ptr) xfree(GARY_HDR(ptr)); } while (0) #define GARY_SIZE(ptr) (GARY_HDR(ptr)->num_elts) #define GARY_RESIZE(ptr, n) ((ptr) = gary_set_size((ptr), (n))) -- 2.39.5