From 511ee756cf8aa9259489b4386feb2911bb58c20a Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 30 Nov 2023 16:24:19 -0500 Subject: [PATCH] Remove const on all side_arg Remove const from side_arg and types containing a side_arg so they can be altered by libside for visitor caching. Signed-off-by: Mathieu Desnoyers --- include/side/abi/type-argument.h | 10 +++++----- include/side/instrumentation-c-api.h | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/side/abi/type-argument.h b/include/side/abi/type-argument.h index 06a4b0b..516f442 100644 --- a/include/side/abi/type-argument.h +++ b/include/side/abi/type-argument.h @@ -61,7 +61,7 @@ union side_arg_static { /* Stack-copy compound types */ side_ptr_t(const struct side_arg_vec) side_struct; - side_ptr_t(const struct side_arg_variant) side_variant; + side_ptr_t(struct side_arg_variant) side_variant; side_ptr_t(const struct side_arg_vec) side_array; side_ptr_t(const struct side_arg_vec) side_vla; void *side_vla_app_visitor_ctx; @@ -85,7 +85,7 @@ union side_arg_static { side_check_size(union side_arg_static, 32); struct side_arg_dynamic_vla { - side_ptr_t(const struct side_arg) sav; + side_ptr_t(struct side_arg) sav; side_ptr_t(const struct side_attr) attr; uint32_t len; uint32_t nr_attr; @@ -93,7 +93,7 @@ struct side_arg_dynamic_vla { side_check_size(struct side_arg_dynamic_vla, 40); struct side_arg_dynamic_struct { - side_ptr_t(const struct side_arg_dynamic_field) fields; + side_ptr_t(struct side_arg_dynamic_field) fields; side_ptr_t(const struct side_attr) attr; uint32_t len; uint32_t nr_attr; @@ -168,14 +168,14 @@ struct side_arg_variant { side_check_size(struct side_arg_variant, 128); struct side_arg_vec { - side_ptr_t(const struct side_arg) sav; + side_ptr_t(struct side_arg) sav; uint32_t len; } SIDE_PACKED; side_check_size(struct side_arg_vec, 20); struct side_arg_dynamic_field { side_ptr_t(const char) field_name; - const struct side_arg elem; + struct side_arg elem; } SIDE_PACKED; side_check_size(struct side_arg_dynamic_field, 16 + sizeof(const struct side_arg)); diff --git a/include/side/instrumentation-c-api.h b/include/side/instrumentation-c-api.h index 048dfea..11ead8f 100644 --- a/include/side/instrumentation-c-api.h +++ b/include/side/instrumentation-c-api.h @@ -801,7 +801,7 @@ #define side_arg_struct(_side_type) { .type = SIDE_ENUM_INIT(SIDE_TYPE_STRUCT), .u = { .side_static = { .side_struct = SIDE_PTR_INIT(_side_type) } } } #define side_arg_define_variant(_identifier, _selector_val, _option) \ - const struct side_arg_variant _identifier = { \ + struct side_arg_variant _identifier = { \ .selector = _selector_val, \ .option = _option, \ } @@ -1079,7 +1079,7 @@ } #define side_arg_dynamic_define_vec(_identifier, _sav, _attr...) \ - const struct side_arg _identifier##_vec[] = { _sav }; \ + struct side_arg _identifier##_vec[] = { _sav }; \ const struct side_arg_dynamic_vla _identifier = { \ .sav = SIDE_PTR_INIT(_identifier##_vec), \ .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \ @@ -1088,7 +1088,7 @@ } #define side_arg_dynamic_define_struct(_identifier, _struct_fields, _attr...) \ - const struct side_arg_dynamic_field _identifier##_fields[] = { _struct_fields }; \ + struct side_arg_dynamic_field _identifier##_fields[] = { _struct_fields }; \ const struct side_arg_dynamic_struct _identifier = { \ .fields = SIDE_PTR_INIT(_identifier##_fields), \ .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \ @@ -1097,7 +1097,7 @@ } #define side_arg_define_vec(_identifier, _sav) \ - const struct side_arg _identifier##_vec[] = { _sav }; \ + struct side_arg _identifier##_vec[] = { _sav }; \ const struct side_arg_vec _identifier = { \ .sav = SIDE_PTR_INIT(_identifier##_vec), \ .len = SIDE_ARRAY_SIZE(_identifier##_vec), \ @@ -1122,7 +1122,7 @@ #define side_event_call(_identifier, _sav) \ { \ - const struct side_arg side_sav[] = { _sav }; \ + struct side_arg side_sav[] = { _sav }; \ const struct side_arg_vec side_arg_vec = { \ .sav = SIDE_PTR_INIT(side_sav), \ .len = SIDE_ARRAY_SIZE(side_sav), \ @@ -1136,12 +1136,12 @@ #define side_event_call_variadic(_identifier, _sav, _var_fields, _attr...) \ { \ - const struct side_arg side_sav[] = { _sav }; \ + struct side_arg side_sav[] = { _sav }; \ const struct side_arg_vec side_arg_vec = { \ .sav = SIDE_PTR_INIT(side_sav), \ .len = SIDE_ARRAY_SIZE(side_sav), \ }; \ - const struct side_arg_dynamic_field side_fields[] = { _var_fields }; \ + struct side_arg_dynamic_field side_fields[] = { _var_fields }; \ const struct side_arg_dynamic_struct var_struct = { \ .fields = SIDE_PTR_INIT(side_fields), \ .attr = SIDE_PTR_INIT(SIDE_PARAM_SELECT_ARG1(_, ##_attr, side_attr_list())), \ -- 2.34.1