Use side_ptr_t in side_type_bool
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Sep 2023 06:22:19 +0000 (07:22 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Sep 2023 06:22:19 +0000 (07:22 +0100)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/side/trace.h
src/tracer.c

index 6cb0185c73fcf2d8ed6b9e35faf1802303792288..839db6981103814a468b94110541d801a8157c0c 100644 (file)
@@ -288,7 +288,7 @@ struct side_type_null {
 } SIDE_PACKED;
 
 struct side_type_bool {
-       const struct side_attr *attr;
+       side_ptr_t(const struct side_attr) attr;
        uint32_t nr_attr;
        uint16_t bool_size;             /* bytes */
        uint16_t len_bits;              /* bits. 0 for (bool_size * CHAR_BITS) */
@@ -805,7 +805,7 @@ struct side_event_description {
                .type = SIDE_TYPE_BOOL, \
                .u = { \
                        .side_bool = { \
-                               .attr = SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list()), \
+                               .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                                .nr_attr = SIDE_ARRAY_SIZE(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                                .bool_size = sizeof(uint8_t), \
                                .len_bits = 0, \
@@ -1139,7 +1139,7 @@ struct side_event_description {
                                                .offset = _offset, \
                                                .access_mode = _access_mode, \
                                                .type = { \
-                                                       .attr = SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list()), \
+                                                       .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                                                        .nr_attr = SIDE_ARRAY_SIZE(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                                                        .bool_size = _bool_size, \
                                                        .len_bits = _len_bits, \
@@ -1500,7 +1500,7 @@ struct side_event_description {
                        .side_dynamic = { \
                                .side_bool = { \
                                        .type = { \
-                                               .attr = SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list()), \
+                                               .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                                                .nr_attr = SIDE_ARRAY_SIZE(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \
                                                .bool_size = sizeof(uint8_t), \
                                                .len_bits = 0, \
index 5e3157f8ab7d77afa0461ee193c7d8c88f7d6516..55b1341e182d490bbce3182484d774c6782f53c1 100644 (file)
@@ -676,7 +676,7 @@ void tracer_print_type_bool(const char *separator,
        v >>= offset_bits;
        if (len_bits < 64)
                v &= (1ULL << len_bits) - 1;
-       tracer_print_type_header(separator, type_bool->attr, type_bool->nr_attr);
+       tracer_print_type_header(separator, side_ptr_get(type_bool->attr), type_bool->nr_attr);
        printf("%s", v ? "true" : "false");
 }
 
This page took 0.043168 seconds and 4 git commands to generate.