dict_ref & dict_cref returns a pointer to struct pair_s instead of pair_t (which

is an array of struct pair_s).
This will break API compatibility. However:
it makes the user code cleaner as a level of indirection is removed.
it uniformizes with the OA dict version
This commit is contained in:
Patrick Pelissier committed 2017-10-18 23:25:39 +02:00
1 parent 8265ccbb42
commit 8914d336a0
7 files changed
+32 -33

No files matched your search

+4 -4
View File
@@ -48,13 +48,13 @@ int main(void)
// Iterate over the dictionary container
for M_EACH(p, *item, MY_DICT_OPLIST) {
// Dictionary iterator are pair (key,value)
if (my_integer_n_p((*p)->value)) {
if (my_integer_n_p(p->value)) {
printf ("It is a long long, value = %lld\n",
*my_integer_get_n((*p)->value));
*my_integer_get_n(p->value));
}
if (my_integer_z_p((*p)->value)) {
if (my_integer_z_p(p->value)) {
printf ("It is a mpz_t, value =");
mpz_out_str(stdout, 10, *my_integer_get_z((*p)->value));
mpz_out_str(stdout, 10, *my_integer_get_z(p->value));
printf("\n");
}
}