From: Francis Deslauriers Date: Wed, 1 May 2019 22:44:44 +0000 (-0400) Subject: Fix: bt2: enum-conversion warning in native_bt_component_class.i X-Git-Tag: v2.0.0-pre5~12 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=c348a6fd553758b3d6c9fd51ae4e90abf614137f Fix: bt2: enum-conversion warning in native_bt_component_class.i clang warns about the following enumeration conversion. bt2/native_bt_wrap.c:3896:12: warning: implicit conversion from enumeration type 'enum bt_message_iterator_status' to different enumeration type 'enum bt_self_message_iterator_status' [-Wenum-conversion] status = BT_MESSAGE_ITERATOR_STATUS_END; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bt2/native_bt_wrap.c:3898:12: warning: implicit conversion from enumeration type 'enum bt_message_iterator_status' to different enumeration type 'enum bt_self_message_iterator_status' [-Wenum-conversion] status = BT_MESSAGE_ITERATOR_STATUS_AGAIN; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bt2/native_bt_wrap.c:3901:12: warning: implicit conversion from enumeration type 'enum bt_message_iterator_status' to different enumeration type 'enum bt_self_message_iterator_status' [-Wenum-conversion] status = BT_MESSAGE_ITERATOR_STATUS_ERROR; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bt2/native_bt_wrap.c:4513:43: warning: implicit conversion from enumeration type 'enum bt_message_iterator_status' to different enumeration type 'bt_self_message_iterator_status' (aka 'enum bt_self_message_iterator_status') [-Wenum-conversion] bt_self_message_iterator_status status = BT_MESSAGE_ITERATOR_STATUS_OK; ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bt2/native_bt_wrap.c:4678:43: warning: implicit conversion from enumeration type 'enum bt_message_iterator_status' to different enumeration type 'bt_self_message_iterator_status' (aka 'enum bt_self_message_iterator_status') [-Wenum-conversion] bt_self_message_iterator_status status = BT_MESSAGE_ITERATOR_STATUS_OK; ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Francis Deslauriers Change-Id: Icb3bc0141cdd9f35a5a42420bb48167c12e70df0 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1183 Reviewed-by: Philippe Proulx Tested-by: jenkins --- diff --git a/bindings/python/bt2/bt2/native_bt_component_class.i b/bindings/python/bt2/bt2/native_bt_component_class.i index c71c7d4e..deca5a38 100644 --- a/bindings/python/bt2/bt2/native_bt_component_class.i +++ b/bindings/python/bt2/bt2/native_bt_component_class.i @@ -719,12 +719,12 @@ bt_py3_exc_to_self_message_iterator_status(void) } if (PyErr_GivenExceptionMatches(exc, py_mod_bt2_exc_stop_type)) { - status = BT_MESSAGE_ITERATOR_STATUS_END; + status = BT_SELF_MESSAGE_ITERATOR_STATUS_END; } else if (PyErr_GivenExceptionMatches(exc, py_mod_bt2_exc_try_again_type)) { - status = BT_MESSAGE_ITERATOR_STATUS_AGAIN; + status = BT_SELF_MESSAGE_ITERATOR_STATUS_AGAIN; } else { bt2_py_loge_exception(); - status = BT_MESSAGE_ITERATOR_STATUS_ERROR; + status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR; } end: @@ -1336,7 +1336,7 @@ bt_py3_component_class_message_iterator_init( bt_self_component *self_component, bt_self_component_port_output *self_component_port_output) { - bt_self_message_iterator_status status = BT_MESSAGE_ITERATOR_STATUS_OK; + bt_self_message_iterator_status status = BT_SELF_MESSAGE_ITERATOR_STATUS_OK; PyObject *py_comp_cls = NULL; PyObject *py_iter_cls = NULL; PyObject *py_iter_ptr = NULL; @@ -1501,7 +1501,7 @@ bt_py3_component_class_message_iterator_next( bt_message_array_const msgs, uint64_t capacity, uint64_t *count) { - bt_self_message_iterator_status status = BT_MESSAGE_ITERATOR_STATUS_OK; + bt_self_message_iterator_status status = BT_SELF_MESSAGE_ITERATOR_STATUS_OK; PyObject *py_message_iter = bt_self_message_iterator_get_data(message_iterator); PyObject *py_method_result = NULL;