lib: force user to include `<babeltrace2/babeltrace.h>`
[babeltrace.git] / src / lib / current-thread.c
index 959e1695140d8941b9a47e1fb28c7376680062a8..743d6aa7c0c1fc2e7867db3879338bfe71047eee 100644 (file)
@@ -23,7 +23,7 @@
 #define BT_LOG_TAG "LIB/CUR-THREAD"
 #include "lib/logging.h"
 
-#include <babeltrace2/current-thread.h>
+#include <babeltrace2/babeltrace.h>
 #include <stdint.h>
 #include <stdarg.h>
 
@@ -58,6 +58,7 @@ void bt_current_thread_clear_error(void)
 
 void bt_current_thread_move_error(const struct bt_error *error)
 {
+       BT_ASSERT_PRE_NON_NULL(error, "Error");
        bt_current_thread_clear_error();
        thread_error = (void *) error;
        BT_LOGD("Moved error object as current thread's error: addr=%p",
@@ -100,6 +101,10 @@ bt_current_thread_error_append_cause_from_unknown(
                try_create_thread_error();
        va_list args;
 
+       BT_ASSERT_PRE_NON_NULL(module_name, "Module name");
+       BT_ASSERT_PRE_NON_NULL(file_name, "File name");
+       BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
+
        if (status) {
                goto end;
        }
@@ -124,6 +129,10 @@ bt_current_thread_error_append_cause_from_component(
                try_create_thread_error();
        va_list args;
 
+       BT_ASSERT_PRE_NON_NULL(self_comp, "Component");
+       BT_ASSERT_PRE_NON_NULL(file_name, "File name");
+       BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
+
        if (status) {
                goto end;
        }
@@ -148,6 +157,10 @@ bt_current_thread_error_append_cause_from_component_class(
                try_create_thread_error();
        va_list args;
 
+       BT_ASSERT_PRE_NON_NULL(self_comp_class, "Component class");
+       BT_ASSERT_PRE_NON_NULL(file_name, "File name");
+       BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
+
        if (status) {
                goto end;
        }
@@ -172,6 +185,10 @@ bt_current_thread_error_append_cause_from_message_iterator(
                try_create_thread_error();
        va_list args;
 
+       BT_ASSERT_PRE_NON_NULL(self_iter, "Message iterator");
+       BT_ASSERT_PRE_NON_NULL(file_name, "File name");
+       BT_ASSERT_PRE_NON_NULL(msg_fmt, "Message format string");
+
        if (status) {
                goto end;
        }
This page took 0.024725 seconds and 4 git commands to generate.