Move to kernel style SPDX license identifiers
[babeltrace.git] / src / lib / trace-ir / utils.h
index a50fe55f624527c8ebb907320b87f49322974c88..f37d1a828d6a2d81eb5078a2431bb5630163966b 100644 (file)
@@ -1,30 +1,15 @@
-#ifndef BABELTRACE_TRACE_IR_UTILS_INTERNAL_H
-#define BABELTRACE_TRACE_IR_UTILS_INTERNAL_H
-
 /*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * SPDX-License-Identifier: MIT
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  */
 
+#ifndef BABELTRACE_TRACE_IR_UTILS_INTERNAL_H
+#define BABELTRACE_TRACE_IR_UTILS_INTERNAL_H
+
 #include "common/macros.h"
 #include <babeltrace2/trace-ir/field-class.h>
+#include <stdbool.h>
 #include <stdint.h>
 
 #include "clock-class.h"
@@ -62,7 +47,7 @@ bool bt_util_get_base_offset_ns(int64_t offset_seconds, uint64_t offset_cycles,
        bool overflows = false;
        uint64_t offset_cycles_ns;
 
-       BT_ASSERT(base_offset_ns);
+       BT_ASSERT_DBG(base_offset_ns);
 
        /* Initialize nanosecond timestamp to clock's offset in seconds */
        if (offset_seconds <= (INT64_MIN / INT64_C(1000000000) - 1) ||
@@ -82,10 +67,10 @@ bool bt_util_get_base_offset_ns(int64_t offset_seconds, uint64_t offset_cycles,
        *base_offset_ns = offset_seconds * INT64_C(1000000000);
 
        /* Add offset in cycles */
-       BT_ASSERT(offset_cycles < frequency);
+       BT_ASSERT_DBG(offset_cycles < frequency);
        offset_cycles_ns = bt_util_ns_from_value(frequency,
                offset_cycles);
-       BT_ASSERT(offset_cycles_ns < 1000000000);
+       BT_ASSERT_DBG(offset_cycles_ns < 1000000000);
        *base_offset_ns += (int64_t) offset_cycles_ns;
 
 end:
@@ -120,7 +105,7 @@ int bt_util_ns_from_origin_inline(int64_t base_offset_ns,
        }
 
        value_ns_signed = (int64_t) value_ns_unsigned;
-       BT_ASSERT(value_ns_signed >= 0);
+       BT_ASSERT_DBG(value_ns_signed >= 0);
 
        if (*ns_from_origin <= 0) {
                goto add_value;
This page took 0.024689 seconds and 4 git commands to generate.