configure: enable -Wsuggest-attribute=format
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_autodisc.i.h
index 9dcacddf0c52eb4201dfab50e67ba2135f639bb0..cb1bd84a4170443fdc8d386ef1a496a104410220 100644 (file)
@@ -47,6 +47,7 @@
  * This function can also return None, if it failed to allocate memory
  * for the return value and status code.
  */
+static
 bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
                const bt_plugin_set *plugin_set)
 {
@@ -69,9 +70,10 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
 
        result = bt_value_map_create();
        if (!result) {
-               static const char * const err = "Failed to create a map value.";
-               BT_LOGE_STR(err);
-               BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name, err);
+#define BT_FMT "Failed to create a map value."
+               BT_LOGE_STR(BT_FMT);
+               BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name, BT_FMT);
+#undef BT_FMT
                PyErr_NoMemory();
                goto end;
        }
@@ -127,7 +129,7 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
        }
 
        for (i = 0; i < auto_disc.results->len; i++) {
-               struct auto_source_discovery_result *result =
+               struct auto_source_discovery_result *autodisc_result =
                        g_ptr_array_index(auto_disc.results, i);
                bt_value_array_append_element_status append_element_status;
 
@@ -140,7 +142,7 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
                }
 
                append_element_status = bt_value_array_append_string_element(
-                       component_info, result->plugin_name);
+                       component_info, autodisc_result->plugin_name);
                if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
                        BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
                                "Failed to append one array element.");
@@ -149,7 +151,7 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
                }
 
                append_element_status = bt_value_array_append_string_element(
-                       component_info, result->source_cc_name);
+                       component_info, autodisc_result->source_cc_name);
                if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
                        BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
                                "Failed to append one array element.");
@@ -158,7 +160,7 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
                }
 
                append_element_status = bt_value_array_append_element(
-                       component_info, result->inputs);
+                       component_info, autodisc_result->inputs);
                if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
                        BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
                                "Failed to append one array element.");
@@ -167,7 +169,7 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
                }
 
                append_element_status = bt_value_array_append_element(
-                       component_info, result->original_input_indices);
+                       component_info, autodisc_result->original_input_indices);
                if (append_element_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
                        BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(module_name,
                                "Failed to append one array element.");
This page took 0.025 seconds and 4 git commands to generate.