-#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"
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) ||
*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:
}
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;