if (initial_plugin_paths) {
struct bt_value *initial_plugin_paths_copy;
- (void) bt_value_copy(&initial_plugin_paths_copy,
- initial_plugin_paths);
+ (void) bt_value_copy(initial_plugin_paths,
+ &initial_plugin_paths_copy);
cfg->plugin_paths = initial_plugin_paths_copy;
} else {
cfg->plugin_paths = bt_value_array_create();
BT_ASSERT(cur_base_params);
bt_object_put_ref(cur_cfg_comp->params);
- status = bt_value_copy(
- &cur_cfg_comp->params,
- cur_base_params);
+ status = bt_value_copy(cur_base_params,
+ &cur_cfg_comp->params);
if (status != BT_VALUE_STATUS_OK) {
print_err_oom();
goto error;
* this is where the unique path goes.
*/
BT_OBJECT_PUT_REF_AND_RESET(impl_args->extra_params);
- status = bt_value_copy(&impl_args->extra_params,
- base_implicit_ctf_input_args->extra_params);
+ status = bt_value_copy(base_implicit_ctf_input_args->extra_params,
+ &impl_args->extra_params);
if (status != BT_VALUE_STATUS_OK) {
print_err_oom();
destroy_implicit_component_args(impl_args);
struct bt_common_lttng_live_url_parts lttng_live_url_parts = { 0 };
char *output = NULL;
- (void) bt_value_copy(&plugin_paths, initial_plugin_paths);
+ (void) bt_value_copy(initial_plugin_paths, &plugin_paths);
*retcode = 0;
return bt_value_get_type(object) == BT_VALUE_TYPE_MAP;
}
-extern enum bt_value_status bt_value_copy(struct bt_value **copy,
- const struct bt_value *object);
+extern enum bt_value_status bt_value_copy(const struct bt_value *object,
+ struct bt_value **copy);
extern bt_bool bt_value_compare(const struct bt_value *object_a,
const struct bt_value *object_b);
BT_ASSERT(element_obj);
BT_LOGD("Copying array value's element: element-addr=%p, "
"index=%d", element_obj, i);
- ret = bt_value_copy(&element_obj_copy, element_obj);
+ ret = bt_value_copy(element_obj, &element_obj_copy);
if (ret) {
BT_LOGE("Cannot copy array value's element: "
"array-addr=%p, index=%d",
BT_ASSERT(key_str);
BT_LOGD("Copying map value's element: element-addr=%p, "
"key=\"%s\"", element_obj, key_str);
- ret = bt_value_copy(&element_obj_copy, element_obj);
+ ret = bt_value_copy(element_obj, &element_obj_copy);
if (ret) {
BT_LOGE("Cannot copy map value's element: "
"map-addr=%p, key=\"%s\"",
struct bt_value *extension_obj_elem_copy = NULL;
/* Copy object which is to replace the current one */
- extend_data->status = bt_value_copy(&extension_obj_elem_copy,
- extension_obj_elem);
+ extend_data->status = bt_value_copy(extension_obj_elem,
+ &extension_obj_elem_copy);
if (extend_data->status) {
BT_LOGE("Cannot copy map element: addr=%p",
extension_obj_elem);
*extended_map_obj = NULL;
/* Create copy of base map object to start with */
- extend_data.status = bt_value_copy(extended_map_obj, base_map_obj);
+ extend_data.status = bt_value_copy(base_map_obj, extended_map_obj);
if (extend_data.status) {
BT_LOGE("Cannot copy base value: base-value-addr=%p",
base_map_obj);
return extend_data.status;
}
-enum bt_value_status bt_value_copy(struct bt_value **copy_obj,
- const struct bt_value *object)
+enum bt_value_status bt_value_copy(const struct bt_value *object,
+ struct bt_value **copy_obj)
{
enum bt_value_status status = BT_VALUE_STATUS_OK;
BT_ASSERT(*result);
iret = bt_value_array_append_string_element(res, object);
BT_ASSERT(iret == 0);
- iret = bt_value_copy(&val, params);
+ iret = bt_value_copy(params, &val);
BT_ASSERT(iret == 0);
iret = bt_value_array_append_element(res, val);
BT_ASSERT(iret == 0);
string_obj);
BT_ASSERT(status == BT_VALUE_STATUS_OK);
- status = bt_value_copy(&map_copy_obj,
- map_obj);
+ status = bt_value_copy(map_obj, &map_copy_obj);
ok(status == BT_VALUE_STATUS_OK && map_copy_obj,
"bt_value_copy() succeeds");