From dd1859c3eff326abcc55fe42bcadb2b44da6fae2 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 4 Nov 2022 21:31:53 -0400 Subject: [PATCH] Use "_sg_" as prefix to type rather than suffix Signed-off-by: Mathieu Desnoyers --- include/side/trace.h | 14 +++++++------- src/test.c | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/side/trace.h b/include/side/trace.h index aaa31b3..bb07f68 100644 --- a/include/side/trace.h +++ b/include/side/trace.h @@ -888,7 +888,7 @@ struct side_tracer_dynamic_vla_visitor_ctx { #define side_field_sg_float_be(_name, _offset, _float_size_bits, _attr) \ _side_field(_name, side_type_sg_float_be(_offset, _float_size_bits, _attr)) -#define side_type_struct_sg(_struct_sg, _offset) \ +#define side_type_sg_struct(_struct_sg, _offset) \ { \ .type = SIDE_TYPE_SG_STRUCT, \ .u = { \ @@ -900,8 +900,8 @@ struct side_tracer_dynamic_vla_visitor_ctx { }, \ }, \ } -#define side_field_struct_sg(_name, _struct_sg, _offset) \ - _side_field(_name, side_type_struct_sg(SIDE_PARAM(_struct_sg), _offset)) +#define side_field_sg_struct(_name, _struct_sg, _offset) \ + _side_field(_name, side_type_sg_struct(SIDE_PARAM(_struct_sg), _offset)) #define side_type_array(_elem_type, _length, _attr) \ { \ @@ -981,10 +981,10 @@ struct side_tracer_dynamic_vla_visitor_ctx { #define side_arg_float_binary128(_val) { .type = SIDE_TYPE_FLOAT_BINARY128, .u = { .side_static = { .float_value = { .side_float_binary128 = (_val) } } } } #define side_arg_struct(_side_type) { .type = SIDE_TYPE_STRUCT, .u = { .side_static = { .side_struct = (_side_type) } } } -#define side_arg_struct_sg(_ptr) { .type = SIDE_TYPE_SG_STRUCT, .u = { .side_static = { .side_struct_sg_ptr = (_ptr) } } } -#define side_arg_unsigned_integer_sg(_ptr) { .type = SIDE_TYPE_SG_UNSIGNED_INT, .u = { .side_static = { .side_integer_sg_ptr = (_ptr) } } } -#define side_arg_signed_integer_sg(_ptr) { .type = SIDE_TYPE_SG_SIGNED_INT, .u = { .side_static = { .side_integer_sg_ptr = (_ptr) } } } -#define side_arg_float_sg(_ptr) { .type = SIDE_TYPE_SG_FLOAT, .u = { .side_static = { .side_float_sg_ptr = (_ptr) } } } +#define side_arg_sg_struct(_ptr) { .type = SIDE_TYPE_SG_STRUCT, .u = { .side_static = { .side_struct_sg_ptr = (_ptr) } } } +#define side_arg_sg_unsigned_integer(_ptr) { .type = SIDE_TYPE_SG_UNSIGNED_INT, .u = { .side_static = { .side_integer_sg_ptr = (_ptr) } } } +#define side_arg_sg_signed_integer(_ptr) { .type = SIDE_TYPE_SG_SIGNED_INT, .u = { .side_static = { .side_integer_sg_ptr = (_ptr) } } } +#define side_arg_sg_float(_ptr) { .type = SIDE_TYPE_SG_FLOAT, .u = { .side_static = { .side_float_sg_ptr = (_ptr) } } } #define side_arg_array(_side_type) { .type = SIDE_TYPE_ARRAY, .u = { .side_static = { .side_array = (_side_type) } } } #define side_arg_vla(_side_type) { .type = SIDE_TYPE_VLA, .u = { .side_static = { .side_vla = (_side_type) } } } #define side_arg_vla_visitor(_ctx) { .type = SIDE_TYPE_VLA_VISITOR, .u = { .side_static = { .side_vla_app_visitor_ctx = (_ctx) } } } diff --git a/src/test.c b/src/test.c index c0f0b86..a95d780 100644 --- a/src/test.c +++ b/src/test.c @@ -1519,7 +1519,7 @@ static side_define_struct(mystructsgdef, side_static_event(my_provider_event_structsg, "myprovider", "myeventstructsg", SIDE_LOGLEVEL_DEBUG, side_field_list( - side_field_struct_sg("structsg", &mystructsgdef, 0), + side_field_sg_struct("structsg", &mystructsgdef, 0), side_field_sg_signed_integer("intsg", 0, 32, 0, 32, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))), #if __HAVE_FLOAT32 @@ -1553,10 +1553,10 @@ void test_struct_sg(void) #endif side_event_call(my_provider_event_structsg, side_arg_list( - side_arg_struct_sg(&mystruct), - side_arg_signed_integer_sg(&val), + side_arg_sg_struct(&mystruct), + side_arg_sg_signed_integer(&val), #if __HAVE_FLOAT32 - side_arg_float_sg(&f32), + side_arg_sg_float(&f32), #endif ) ); @@ -1591,7 +1591,7 @@ static side_define_struct(mystructsgnest1, side_field_sg_unsigned_integer("b", offsetof(struct testnest1, b), side_struct_field_sizeof_bit(struct testnest1, b), 0, side_struct_field_sizeof_bit(struct testnest1, b), side_attr_list()), - side_field_struct_sg("nest2", &mystructsgnest2, + side_field_sg_struct("nest2", &mystructsgnest2, offsetof(struct testnest1, nest)), ), side_attr_list() @@ -1602,7 +1602,7 @@ static side_define_struct(mystructsgnest0, side_field_sg_unsigned_integer("a", offsetof(struct testnest0, a), side_struct_field_sizeof_bit(struct testnest0, a), 0, side_struct_field_sizeof_bit(struct testnest0, a), side_attr_list()), - side_field_struct_sg("nest1", &mystructsgnest1, + side_field_sg_struct("nest1", &mystructsgnest1, offsetof(struct testnest0, nest)), ), side_attr_list() @@ -1611,7 +1611,7 @@ static side_define_struct(mystructsgnest0, side_static_event(my_provider_event_structsg_nest, "myprovider", "myeventstructsgnest", SIDE_LOGLEVEL_DEBUG, side_field_list( - side_field_struct_sg("nest0", &mystructsgnest0, 0), + side_field_sg_struct("nest0", &mystructsgnest0, 0), ), side_attr_list() ); @@ -1633,7 +1633,7 @@ void test_struct_sg_nest(void) }; side_event_call(my_provider_event_structsg_nest, side_arg_list( - side_arg_struct_sg(&mystruct), + side_arg_sg_struct(&mystruct), ) ); } @@ -1679,7 +1679,7 @@ static side_define_struct(mystructsgfloat, side_static_event(my_provider_event_structsgfloat, "myprovider", "myeventstructsgfloat", SIDE_LOGLEVEL_DEBUG, side_field_list( - side_field_struct_sg("structsgfloat", &mystructsgfloat, 0), + side_field_sg_struct("structsgfloat", &mystructsgfloat, 0), ), side_attr_list() ); @@ -1704,7 +1704,7 @@ void test_struct_sg_float(void) }; side_event_call(my_provider_event_structsgfloat, side_arg_list( - side_arg_struct_sg(&mystruct), + side_arg_sg_struct(&mystruct), ) ); } -- 2.34.1