values: make `bt_value_map_extend()` extend the provided base map
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 9 Oct 2019 19:36:22 +0000 (15:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Oct 2019 16:13:26 +0000 (12:13 -0400)
commitca914e549e4ff113292102d27edd6af662b860d3
tree778d6d2f6bc2665d830fca17d3d8b46da2fbf053
parentc42d6bd448276bc8140a76481883e5124fc10a3a
values: make `bt_value_map_extend()` extend the provided base map

The current behavior of this function is to create a new extended map
leaving the two provided maps untouched. I can see cases where that
would be useful, but I believe the user is going to expect the
`_extend()` function to extend an existing map.

If a user want to get a new map, she could still copy the base map using
`bt_value_copy()` before extending it.

So this commit changes the behavior of `bt_value_map_extend()` so that
it takes two arguments: the base map, and the extension map. The entries
of the extension map are added to the base map, overwriting any existing
keys.

Also, remove the `_MEMORY_ERROR` status from the
`bt_value_map_foreach_entry_status` and
`bt_value_map_foreach_entry_const_status` enums since those two are not
used at the moment.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I8fa7d4591da90dae50316d6db86af5ab1b76203c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2162
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
include/babeltrace2/value-const.h
include/babeltrace2/value.h
src/cli/babeltrace2-cfg-cli-args.c
src/lib/value.c
tests/lib/test_bt_values.c
This page took 0.024944 seconds and 4 git commands to generate.