From d753bbe1abdfd522dc28dbf8b02a559d1cfe7a9a Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 3 Feb 2017 21:02:07 -0800 Subject: [PATCH] Fix the macro to allow it to return something. --- include/pairmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pairmap.h b/include/pairmap.h index 628dc2b..50f5d8c 100644 --- a/include/pairmap.h +++ b/include/pairmap.h @@ -8,7 +8,7 @@ * to be copied. This requires at least 3 things - set the x value, set the y value, call the * hash table function the requires the key. These macros take care of these three things. */ -#define PAIRMAP_PUT(map, tmp, newx, newy, data) do { (tmp)->x = newx; (tmp)->y = newy; ht_put(map, tmp, data); } while(0) +#define PAIRMAP_PUT(map, tmp, newx, newy, data) ((tmp)->x = newx, (tmp)->y = newy, ht_put(map, tmp, data)) #define PAIRMAP_GET(map, tmp, newx, newy) ((tmp)->x = newx, (tmp)->y = newy, ht_get(map, tmp)) #include "ht.h"