lib: make public reference count functions have strict types
[babeltrace.git] / cli / babeltrace-cfg-cli-args.c
index f8c751045f019517dfcad75202ba9e3504c63f7c..d881e75c6160633d61598efaa3614e7912d20351 100644 (file)
@@ -417,7 +417,7 @@ success:
        }
 
 end:
-       BT_OBJECT_PUT_REF_AND_RESET(value);
+       BT_VALUE_PUT_REF_AND_RESET(value);
        return ret;
 }
 
@@ -535,7 +535,7 @@ struct bt_value *bt_value_from_ini(const char *arg,
        goto end;
 
 error:
-       BT_OBJECT_PUT_REF_AND_RESET(state.params);
+       BT_VALUE_PUT_REF_AND_RESET(state.params);
 
 end:
        if (state.scanner) {
@@ -759,7 +759,7 @@ void bt_config_component_destroy(struct bt_object *obj)
                g_string_free(bt_config_component->instance_name, TRUE);
        }
 
-       BT_OBJECT_PUT_REF_AND_RESET(bt_config_component->params);
+       BT_VALUE_PUT_REF_AND_RESET(bt_config_component->params);
        g_free(bt_config_component);
 
 end:
@@ -875,7 +875,7 @@ void bt_config_destroy(struct bt_object *obj)
                goto end;
        }
 
-       BT_OBJECT_PUT_REF_AND_RESET(cfg->plugin_paths);
+       BT_VALUE_PUT_REF_AND_RESET(cfg->plugin_paths);
 
        switch (cfg->command) {
        case BT_CONFIG_COMMAND_RUN:
@@ -1104,7 +1104,7 @@ end:
        return names;
 
 error:
-       BT_OBJECT_PUT_REF_AND_RESET(names);
+       BT_VALUE_PUT_REF_AND_RESET(names);
        if (scanner) {
                g_scanner_destroy(scanner);
        }
@@ -1177,7 +1177,7 @@ struct bt_value *fields_from_arg(const char *arg)
        goto end;
 
 error:
-       BT_OBJECT_PUT_REF_AND_RESET(fields);
+       BT_VALUE_PUT_REF_AND_RESET(fields);
 
 end:
        if (scanner) {
@@ -1503,8 +1503,8 @@ struct bt_config *bt_config_base_create(enum bt_config_command command,
        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();
@@ -2036,7 +2036,7 @@ struct bt_config *bt_config_query_from_args(int argc, const char *argv[],
                        break;
                case OPT_PARAMS:
                {
-                       bt_object_put_ref(params);
+                       bt_value_put_ref(params);
                        params = bt_value_from_arg(arg);
                        if (!params) {
                                printf_err("Invalid format for --params option's argument:\n    %s\n",
@@ -2127,7 +2127,7 @@ end:
                poptFreeContext(pc);
        }
 
-       bt_object_put_ref(params);
+       bt_value_put_ref(params);
        free(arg);
        return cfg;
 }
@@ -2503,10 +2503,9 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[],
                        }
 
                        BT_ASSERT(cur_base_params);
-                       bt_object_put_ref(cur_cfg_comp->params);
-                       status = bt_value_copy(
-                               &cur_cfg_comp->params,
-                               cur_base_params);
+                       bt_value_put_ref(cur_cfg_comp->params);
+                       status = bt_value_copy(cur_base_params,
+                               &cur_cfg_comp->params);
                        if (status != BT_VALUE_STATUS_OK) {
                                print_err_oom();
                                goto error;
@@ -2533,10 +2532,9 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[],
                                goto error;
                        }
 
-                       status = bt_value_map_extend(&params_to_set,
-                               cur_cfg_comp->params,
-                               params);
-                       BT_OBJECT_PUT_REF_AND_RESET(params);
+                       status = bt_value_map_extend(cur_cfg_comp->params,
+                               params, &params_to_set);
+                       BT_VALUE_PUT_REF_AND_RESET(params);
                        if (status != BT_VALUE_STATUS_OK) {
                                printf_err("Cannot extend current component parameters with --params option's argument:\n    %s\n",
                                        arg);
@@ -2597,7 +2595,7 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[],
                        break;
                }
                case OPT_RESET_BASE_PARAMS:
-                       BT_OBJECT_PUT_REF_AND_RESET(cur_base_params);
+                       BT_VALUE_PUT_REF_AND_RESET(cur_base_params);
                        cur_base_params = bt_value_map_create();
                        if (!cur_base_params) {
                                print_err_oom();
@@ -2698,9 +2696,9 @@ end:
 
        free(arg);
        BT_OBJECT_PUT_REF_AND_RESET(cur_cfg_comp);
-       BT_OBJECT_PUT_REF_AND_RESET(cur_base_params);
-       BT_OBJECT_PUT_REF_AND_RESET(instance_names);
-       BT_OBJECT_PUT_REF_AND_RESET(connection_args);
+       BT_VALUE_PUT_REF_AND_RESET(cur_base_params);
+       BT_VALUE_PUT_REF_AND_RESET(instance_names);
+       BT_VALUE_PUT_REF_AND_RESET(connection_args);
        return cfg;
 }
 
@@ -3094,7 +3092,7 @@ void finalize_implicit_component_args(struct implicit_component_args *args)
                g_string_free(args->params_arg, TRUE);
        }
 
-       bt_object_put_ref(args->extra_params);
+       bt_value_put_ref(args->extra_params);
 }
 
 static
@@ -3543,9 +3541,9 @@ int fill_implicit_ctf_inputs_args(GPtrArray *implicit_ctf_inputs_args,
                 * We need our own copy of the extra parameters because
                 * 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);
+               BT_VALUE_PUT_REF_AND_RESET(impl_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);
@@ -3622,7 +3620,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
        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;
 
@@ -4166,7 +4164,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                        ret = insert_flat_params_from_array(
                                implicit_text_args.params_arg,
                                fields, "field");
-                       bt_object_put_ref(fields);
+                       bt_value_put_ref(fields);
                        if (ret) {
                                goto error;
                        }
@@ -4184,7 +4182,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                        ret = insert_flat_params_from_array(
                                implicit_text_args.params_arg,
                                names, "name");
-                       bt_object_put_ref(names);
+                       bt_value_put_ref(names);
                        if (ret) {
                                goto error;
                        }
@@ -4750,8 +4748,8 @@ end:
                g_ptr_array_free(implicit_ctf_inputs_args, TRUE);
        }
 
-       bt_object_put_ref(run_args);
-       bt_object_put_ref(all_names);
+       bt_value_put_ref(run_args);
+       bt_value_put_ref(all_names);
        destroy_glist_of_gstring(source_names);
        destroy_glist_of_gstring(filter_names);
        destroy_glist_of_gstring(sink_names);
@@ -4764,7 +4762,7 @@ end:
        finalize_implicit_component_args(&implicit_debug_info_args);
        finalize_implicit_component_args(&implicit_muxer_args);
        finalize_implicit_component_args(&implicit_trimmer_args);
-       bt_object_put_ref(plugin_paths);
+       bt_value_put_ref(plugin_paths);
        bt_common_destroy_lttng_live_url_parts(&lttng_live_url_parts);
        return cfg;
 }
@@ -4859,7 +4857,7 @@ struct bt_config *bt_config_cli_args_create(int argc, const char *argv[],
                        goto end;
                }
        } else {
-               bt_object_get_ref(initial_plugin_paths);
+               bt_value_get_ref(initial_plugin_paths);
        }
 
        if (argc <= 1) {
@@ -5021,6 +5019,6 @@ struct bt_config *bt_config_cli_args_create(int argc, const char *argv[],
        }
 
 end:
-       bt_object_put_ref(initial_plugin_paths);
+       bt_value_put_ref(initial_plugin_paths);
        return config;
 }
This page took 0.027099 seconds and 4 git commands to generate.