]> mj.ucw.cz Git - libucw.git/commitdiff
gary: Allow GARY_RESIZE to be used for immediate array indexing
authorMartin Mares <mj@ucw.cz>
Fri, 2 Nov 2012 21:36:42 +0000 (22:36 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 2 Nov 2012 21:36:42 +0000 (22:36 +0100)
ucw/gary.h

index b87a6fef03c36c5debe42ab9a21e6b0cbc9215b9..6b4adfb1d36c5ec52cd5b583c01c3ef5d588a78b 100644 (file)
@@ -22,7 +22,7 @@ struct gary_hdr {
 #define GARY_INIT_ZERO(ptr, n) (ptr) = gary_init(sizeof(*(ptr)), (n), 1)
 #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))
+#define GARY_RESIZE(ptr, n) ((ptr) = gary_set_size((ptr), (n)))
 #define GARY_INIT_OR_RESIZE(ptr, n) (ptr) = (ptr) ? gary_set_size((ptr), (n)) : gary_init(sizeof(*(ptr)), (n), 0)
 
 #define GARY_PUSH(ptr, n) ({                                           \