diff --git a/README.md b/README.md index ea9ddc0c..1f5df4f3 100644 --- a/README.md +++ b/README.md @@ -1649,7 +1649,7 @@ Example: Return the oplist of the dictionary defined by calling DICT\_DEF2 with name & key\_oplist & value\_oplist. -#### DICT\_SET\_DEF2(name, key\_type[, key\_oplist]) +#### DICT\_SET\_DEF(name, key\_type[, key\_oplist]) Define the set 'name##\_t' and its associated methods as "static inline" functions. A set is a specialized version of a dictionary with no value. diff --git a/doc/API.txt b/doc/API.txt index 98d39908..29cf7c7b 100644 --- a/doc/API.txt +++ b/doc/API.txt @@ -14,5 +14,7 @@ V0.2.*: * worker_sync takes a 'worker_t' as an additional parameter _set_at2(a,i,x) ==> set(*_get_at(a,i),x) * DICT SET _set_at method has been renamed as _push Since there is no key, it is a push method, not a _set_at method. + * DICT_SET_DEF2 ==> DICT_SET_DEF + since it only requires one argument. diff --git a/example/ex-dict04.c b/example/ex-dict04.c index aa7f8a91..c06690d5 100644 --- a/example/ex-dict04.c +++ b/example/ex-dict04.c @@ -5,7 +5,7 @@ /* program that reads text from standard-input, and prints the total number of distinct words found in the text. */ -DICT_SET_DEF2(dict_str, string_t, STRING_OPLIST) +DICT_SET_DEF(dict_str, string_t, STRING_OPLIST) int main(void) { diff --git a/m-dict.h b/m-dict.h index 3383c01c..5163244f 100644 --- a/m-dict.h +++ b/m-dict.h @@ -57,9 +57,9 @@ /* Define a set with the key key_type - USAGE: DICT_SET_DEF2(name, key_type, key_oplist) + USAGE: DICT_SET_DEF(name, key_type, key_oplist) */ -#define DICT_SET_DEF2(name, ...) \ +#define DICT_SET_DEF(name, ...) \ DICTI_SET_DEF(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__), __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__) ), \ (name, __VA_ARGS__))) diff --git a/tests/test-mdict.c b/tests/test-mdict.c index 2a484495..d767fe6a 100644 --- a/tests/test-mdict.c +++ b/tests/test-mdict.c @@ -37,7 +37,7 @@ DICT_OA_DEF2(dict_oa_int, int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(oor_equal_ END_COVERAGE DICT_STOREHASH_DEF2(dict_str2, string_t, STRING_OPLIST, string_t, STRING_OPLIST) -DICT_SET_DEF2(dict_setstr, string_t, STRING_OPLIST) +DICT_SET_DEF(dict_setstr, string_t, STRING_OPLIST) DICT_DEF2(dict_int, int, M_DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) DICT_DEF2(dict_mpz, string_t, STRING_OPLIST, testobj_t, TESTOBJ_OPLIST)