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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 10 Oct 2019 15:44:27 +0000 (11:44 -0400)
commitab26240fb6f0eeb5253d5cb067be662294ea185e
tree55e7c1db39cacbe2528707a1a9ac9eac99435952
parent065509d3bd9342344f5c163705c64cbfbbd39af5
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.024739 seconds and 4 git commands to generate.