X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Flib%2Ftrace-ir%2Fclock-class.h;h=7c5b76af7d18204c0321595e9af170247f164b30;hp=4cbf77eaf1533da3d20abbd219b9872d0e4bad1e;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=91d8147391efdc4d42cc4e1c171a65c0372a008f diff --git a/src/lib/trace-ir/clock-class.h b/src/lib/trace-ir/clock-class.h index 4cbf77ea..7c5b76af 100644 --- a/src/lib/trace-ir/clock-class.h +++ b/src/lib/trace-ir/clock-class.h @@ -1,35 +1,19 @@ -#ifndef BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H -#define BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H - /* + * SPDX-License-Identifier: MIT + * * Copyright 2017-2018 Philippe Proulx * Copyright 2013, 2014 Jérémie Galarneau - * - * 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: - * - * 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. */ +#ifndef BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H +#define BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H + #include #include "lib/object.h" #include "common/macros.h" #include "common/common.h" #include "lib/object-pool.h" -#include "compat/uuid.h" +#include "common/uuid.h" #include #include "lib/property.h" #include "common/assert.h" @@ -37,9 +21,14 @@ #include #include +#include "lib/func-status.h" + struct bt_clock_class { struct bt_object base; + /* Owned by this */ + struct bt_value *user_attributes; + struct { GString *str; @@ -60,7 +49,7 @@ struct bt_clock_class { uint64_t offset_cycles; struct { - uint8_t uuid[BABELTRACE_UUID_LEN]; + bt_uuid_t uuid; /* NULL or `uuid` above */ bt_uuid value; @@ -109,11 +98,10 @@ int bt_clock_class_clock_value_from_ns_from_origin( struct bt_clock_class *cc, int64_t ns_from_origin, uint64_t *raw_value) { - BT_ASSERT(cc); - + BT_ASSERT_DBG(cc); return bt_common_clock_value_from_ns_from_origin(cc->offset_seconds, cc->offset_cycles, cc->frequency, ns_from_origin, - raw_value); + raw_value) ? BT_FUNC_STATUS_OVERFLOW_ERROR : BT_FUNC_STATUS_OK; } #endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H */