Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git] / src / common / uuid.c
index f6d895a8914c63d34f2a64de766cf9d86698f7bc..d59f750ca0bab0a2aabac414b7c9c462db30d4a5 100644 (file)
@@ -70,8 +70,8 @@ void bt_uuid_generate(bt_uuid_t uuid_out)
 BT_HIDDEN
 void bt_uuid_to_str(const bt_uuid_t uuid_in, char *str_out)
 {
-       BT_ASSERT(uuid_in);
-       BT_ASSERT(str_out);
+       BT_ASSERT_DBG(uuid_in);
+       BT_ASSERT_DBG(str_out);
 
        sprintf(str_out, BT_UUID_FMT, BT_UUID_FMT_VALUES(uuid_in));
 }
@@ -82,8 +82,8 @@ int bt_uuid_from_str(const char *str_in, bt_uuid_t uuid_out)
        int ret = 0;
        bt_uuid_t uuid_scan;
 
-       BT_ASSERT(uuid_out);
-       BT_ASSERT(str_in);
+       BT_ASSERT_DBG(uuid_out);
+       BT_ASSERT_DBG(str_in);
 
        if (strnlen(str_in, BT_UUID_STR_LEN + 1) != BT_UUID_STR_LEN) {
                ret = -1;
@@ -103,13 +103,7 @@ end:
 BT_HIDDEN
 int bt_uuid_compare(const bt_uuid_t uuid_a, const bt_uuid_t uuid_b)
 {
-       int ret = 0;
-
-       if (memcmp(uuid_a, uuid_b, BT_UUID_LEN) != 0) {
-               ret = -1;
-       }
-
-       return ret;
+       return memcmp(uuid_a, uuid_b, BT_UUID_LEN);
 }
 
 BT_HIDDEN
This page took 0.023522 seconds and 4 git commands to generate.