X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_component_class.i.h;h=628d58679b90f54349fa207e9ed25d2e641e3ec2;hb=HEAD;hp=3759335c8122945819eb6d56029c8f32819aee40;hpb=900eef7317d3e8b350a93fb8782639845c62c2bd;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index 3759335c..de11581a 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -4,6 +4,9 @@ * Copyright (c) 2017 Philippe Proulx */ +#ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_COMPONENT_CLASS_I_H +#define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_COMPONENT_CLASS_I_H + #include "logging/comp-logging.h" #include "compat/glib.h" @@ -298,7 +301,8 @@ component_class_get_supported_mip_versions( py_cls = lookup_cc_ptr_to_py_cls(component_class); if (!py_cls) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, "Cannot find Python class associated to native component class: " "comp-cls-addr=%p", component_class); goto error; @@ -307,7 +311,8 @@ component_class_get_supported_mip_versions( py_params_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(params), SWIGTYPE_p_bt_value, 0); if (!py_params_ptr) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, BT_FMT_SWIG_ALLOC_FAILED); goto error; } @@ -324,7 +329,8 @@ component_class_get_supported_mip_versions( py_params_ptr, init_method_data ? init_method_data : Py_None, (int) log_level); if (!py_range_set_addr) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_WARNING, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_WARNING, + (enum bt_log_level) log_level, BT_LOG_TAG, "Failed to call Python class's _bt_get_supported_mip_versions_from_native() method: " "py-cls-addr=%p", py_cls); status = py_exc_to_status_component_class_clear(self_component_class, @@ -355,7 +361,8 @@ component_class_get_supported_mip_versions( bt_integer_range_unsigned_get_lower(range), bt_integer_range_unsigned_get_upper(range)); if (add_range_status) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, "Failed to add range to supported MIP versions range set."); goto error; } @@ -939,7 +946,8 @@ bt_component_class_query_method_status component_class_query( py_cls = lookup_cc_ptr_to_py_cls(component_class); if (!py_cls) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, "Cannot find Python class associated to native component class: " "comp-cls-addr=%p", component_class); goto error; @@ -948,7 +956,8 @@ bt_component_class_query_method_status component_class_query( py_params_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(params), SWIGTYPE_p_bt_value, 0); if (!py_params_ptr) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, BT_FMT_SWIG_ALLOC_FAILED); goto error; } @@ -957,14 +966,16 @@ bt_component_class_query_method_status component_class_query( SWIG_as_voidptr(priv_query_executor), SWIGTYPE_p_bt_private_query_executor, 0); if (!py_priv_query_exec_ptr) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, BT_FMT_SWIG_ALLOC_FAILED); goto error; } py_object = SWIG_FromCharPtr(object); if (!py_object) { - BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG, + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_ERROR, + (enum bt_log_level) log_level, BT_LOG_TAG, "Failed to create a Python string."); goto error; } @@ -985,8 +996,9 @@ bt_component_class_query_method_status component_class_query( log_level); if (status < 0) { #define BT_FMT "Failed to call Python class's _bt_query_from_native() method: py-cls-addr=%p" - BT_LOG_WRITE_CUR_LVL(BT_LOG_WARNING, log_level, BT_LOG_TAG, - BT_FMT, py_cls); + BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_WARNING, + (enum bt_log_level) log_level, + BT_LOG_TAG, BT_FMT, py_cls); BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_COMPONENT_CLASS( self_component_class, BT_FMT, py_cls); #undef BT_FMT @@ -1205,6 +1217,7 @@ end: Py_XDECREF(py_comp_cls); Py_XDECREF(py_iter_cls); Py_XDECREF(py_iter_ptr); + Py_XDECREF(py_config_ptr); Py_XDECREF(py_component_port_output_ptr); Py_XDECREF(py_init_method_result); Py_XDECREF(py_iter); @@ -1514,3 +1527,5 @@ bt_component_class_sink *bt_bt2_component_class_sink_create( end: return component_class_sink; } + +#endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_COMPONENT_CLASS_I_H */