bt2: Adapt test_graph.py and make it pass
[babeltrace.git] / bindings / python / bt2 / bt2 / native_bt_component_class.i
index 47a446dec93324157e5b14a092104eade4dd36c0..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:
@@ -1276,7 +1276,7 @@ bt_py3_component_class_query(
         * (PyLong) containing the address of a BT value object (new
         * reference).
         */
-       *result = (void *) PyLong_AsUnsignedLongLong(py_results_addr);
+       *result = PyLong_AsVoidPtr(py_results_addr);
        BT_ASSERT(!PyErr_Occurred());
        BT_ASSERT(*result);
        goto 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;
 
@@ -1519,9 +1519,7 @@ bt_py3_component_class_message_iterator_next(
         * (PyLong) containing the address of a native message
         * object (which is now ours).
         */
-       msgs[0] =
-               (const bt_message *) PyLong_AsUnsignedLongLong(
-                       py_method_result);
+       msgs[0] = PyLong_AsVoidPtr(py_method_result);
        *count = 1;
 
        /* Clear potential overflow error; should never happen */
This page took 0.024788 seconds and 4 git commands to generate.