Use side_ptr_t for side_type_null attr pointer
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Sep 2023 06:16:49 +0000 (07:16 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Sep 2023 06:16:49 +0000 (07:16 +0100)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/side/trace.h
src/tracer.c

index d63a95e32717d9f1f71fc94476f0955cd889c31e..ac9545628428c60408a193ba229eae3bccf7df2e 100644 (file)
@@ -283,7 +283,7 @@ struct side_attr {
 
 /* Type descriptions */
 struct side_type_null {
-       const struct side_attr *attr;
+       side_ptr_t(const struct side_attr) attr;
        uint32_t nr_attr;
 } SIDE_PACKED;
 
@@ -806,7 +806,7 @@ struct side_event_description {
                .type = SIDE_TYPE_NULL, \
                .u = { \
                        .side_null = { \
-                               .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())), \
                        }, \
                }, \
@@ -1498,7 +1498,7 @@ struct side_event_description {
                .u = { \
                        .side_dynamic = { \
                                .side_null = { \
-                                       .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())), \
                                }, \
                        }, \
index dac746426df971a9f3b09d112ab8d4c5de4764d5..5e3157f8ab7d77afa0461ee193c7d8c88f7d6516 100644 (file)
@@ -904,7 +904,8 @@ void tracer_print_type(const struct side_type *type_desc, const struct side_arg
        switch (type) {
                /* Stack-copy basic types */
        case SIDE_TYPE_NULL:
-               tracer_print_type_header(":", type_desc->u.side_null.attr, type_desc->u.side_null.nr_attr);
+               tracer_print_type_header(":", side_ptr_get(type_desc->u.side_null.attr),
+                       type_desc->u.side_null.nr_attr);
                printf("<NULL TYPE>");
                break;
 
@@ -1657,7 +1658,8 @@ void tracer_print_dynamic(const struct side_arg *item)
        switch (item->type) {
                /* Dynamic basic types */
        case SIDE_TYPE_DYNAMIC_NULL:
-               tracer_print_type_header("::", item->u.side_dynamic.side_null.attr, item->u.side_dynamic.side_null.nr_attr);
+               tracer_print_type_header("::", side_ptr_get(item->u.side_dynamic.side_null.attr),
+                       item->u.side_dynamic.side_null.nr_attr);
                printf("<NULL TYPE>");
                break;
        case SIDE_TYPE_DYNAMIC_BOOL:
This page took 0.025659 seconds and 4 git commands to generate.