From d19e1a5b41f02c561f46c2f9b9a82b4fd243916c Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 23 Apr 2017 23:36:08 +0200 Subject: [PATCH] Add M_EMPTY_DEFAULT which is like M_NOTHING_DEFAULT except that it doesn't evaluate its arguments. --- m-core.h | 1 + m-dict.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/m-core.h b/m-core.h index da1ff634..a6103903 100644 --- a/m-core.h +++ b/m-core.h @@ -822,6 +822,7 @@ m_core_hash (const void *str, size_t length) #define M_INIT_DEFAULT(a) ((a) = 0) #define M_SET_DEFAULT(a,b) ((a) = (b)) #define M_NOTHING_DEFAULT(...) ((void)(__VA_ARGS__)) +#define M_EMPTY_DEFAULT(...) ((void)1) #define M_TRUE_DEFAULT(...) true #define M_NEW_DEFAULT(a) M_MEMORY_ALLOC(a) #define M_DEL_DEFAULT(a) M_MEMORY_DEL(a) diff --git a/m-dict.h b/m-dict.h index 0ee75b87..ec13a29b 100644 --- a/m-dict.h +++ b/m-dict.h @@ -66,8 +66,8 @@ ARRAY_DEF(M_C(list_dict_pair_,name), M_C3(list_dict_pair_,name,_t), LIST_OPLIST(M_C(dict_pair_, name), TUPLE_OPLIST(M_C(dict_pair_, name), key_oplist))) \ \ DICTI_DEF2_FUNC(name, key_type, key_oplist, key_type, \ - (INIT(M_NOTHING_DEFAULT), INIT_SET(M_NOTHING_DEFAULT), SET(M_NOTHING_DEFAULT), CLEAR(M_NOTHING_DEFAULT), \ - EQUAL(M_NOTHING_DEFAULT), GET_STR(M_NOTHING_DEFAULT), OUT_STR(M_NOTHING_DEFAULT), IN_STR(M_TRUE_DEFAULT)), \ + (INIT(M_EMPTY_DEFAULT), INIT_SET(M_EMPTY_DEFAULT), SET(M_EMPTY_DEFAULT), CLEAR(M_EMPTY_DEFAULT), \ + EQUAL(M_EMPTY_DEFAULT), GET_STR(M_EMPTY_DEFAULT), OUT_STR(M_EMPTY_DEFAULT), IN_STR(M_TRUE_DEFAULT)), \ 1, M_C3(dict_, name, _t), M_C3(dict_it_, name, _t))