Fix: bt2: enum-conversion warning in native_bt_component_class.i
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 1 May 2019 22:44:44 +0000 (18:44 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:40 +0000 (18:19 -0400)
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 <francis.deslauriers@efficios.com>
Change-Id: Icb3bc0141cdd9f35a5a42420bb48167c12e70df0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1183
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins
bindings/python/bt2/bt2/native_bt_component_class.i

index c71c7d4e79f992fcd76535d90656f7197b6479ce..deca5a38682820183e3c457be26c359a74a3c777 100644 (file)
@@ -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;
 
This page took 0.025853 seconds and 4 git commands to generate.