Remove dict_ prefix for dictionnary.

See commit on shared-pointer.
This commit is contained in:
Patrick Pelissier committed 2017-07-29 13:01:38 +02:00
1 parent f8a1832fce
commit 80c273e6e2
10 files changed
+492 -462

No files matched your search

+4 -4
View File
@@ -1,10 +1,10 @@
#include "m-dict.h"
// Let's define a dictionary of 'unsigned int' --> 'char
DICT_DEF2(m32, unsigned int, M_DEFAULT_OPLIST, char, M_DEFAULT_OPLIST)
DICT_DEF2(dict_m32, unsigned int, M_DEFAULT_OPLIST, char, M_DEFAULT_OPLIST)
// Let's create a synonym for its oplist.
#define M32_OPLIST DICT_OPLIST(m32, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)
#define M32_OPLIST DICT_OPLIST(dict_m32, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)
#if 1 // Non macro version.
@@ -16,9 +16,9 @@ int main(void) {
int is_missing = (k != NULL); // true
assert (is_missing);
dict_m32_remove(h, 5); // h is now empty
dict_it_m32_t it; // iterate over all dictionnary
dict_m32_it_t it; // iterate over all dictionnary
for (dict_m32_it (it, h) ; !dict_m32_end_p (it); dict_m32_next(it)) {
dict_pair_m32_t *item = dict_m32_ref(it);
dict_m32_pair_t *item = dict_m32_ref(it);
(*item)->value = 1; // Set its value to 1
}
dict_m32_clear(h); // h is cleared