From: Mathieu Desnoyers Date: Wed, 9 Nov 2022 01:38:20 +0000 (-0500) Subject: Fix g++ build X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=358281a17a91451aed649d6be6c1fd4890c4cfc0;p=libside.git Fix g++ build Signed-off-by: Mathieu Desnoyers --- diff --git a/include/side/trace.h b/include/side/trace.h index 4284d8c..d7c3d98 100644 --- a/include/side/trace.h +++ b/include/side/trace.h @@ -1181,6 +1181,7 @@ struct side_event_description { .side_gather = { \ .u = { \ .side_vla = { \ + .length_type = _length_type_gather, \ .offset = _offset, \ .access_mode = _access_mode, \ .type = { \ @@ -1188,7 +1189,6 @@ struct side_event_description { .attr = _attr, \ .nr_attr = SIDE_ARRAY_SIZE(SIDE_PARAM(_attr)), \ }, \ - .length_type = _length_type_gather, \ }, \ }, \ }, \ @@ -1209,7 +1209,7 @@ struct side_event_description { /* Stack-copy field arguments */ #define side_arg_null(_val) { .type = SIDE_TYPE_NULL } -#define side_arg_bool(_val) { .type = SIDE_TYPE_BOOL, .u = { .side_static = { .bool_value.side_bool8 = !!(_val) } } } +#define side_arg_bool(_val) { .type = SIDE_TYPE_BOOL, .u = { .side_static = { .bool_value = { .side_bool8 = !!(_val) } } } } #define side_arg_byte(_val) { .type = SIDE_TYPE_BYTE, .u = { .side_static = { .byte_value = (_val) } } } #define side_arg_string(_val) { .type = SIDE_TYPE_STRING, .u = { .side_static = { .string_value = (uintptr_t) (_val) } } } diff --git a/src/test.c b/src/test.c index 1f2bea4..c395aef 100644 --- a/src/test.c +++ b/src/test.c @@ -1919,7 +1919,8 @@ static void test_gather_vla_flex(void) { side_event_cond(my_provider_event_gathervlaflex) { - struct testgathervlaflex *mystruct = malloc(sizeof(*mystruct) + VLAFLEXLEN + sizeof(uint64_t)); + struct testgathervlaflex *mystruct = + (struct testgathervlaflex *) malloc(sizeof(*mystruct) + VLAFLEXLEN + sizeof(uint64_t)); mystruct->len = VLAFLEXLEN; mystruct->otherfield = 0; diff --git a/src/tracer.c b/src/tracer.c index 80867b8..62225e4 100644 --- a/src/tracer.c +++ b/src/tracer.c @@ -1062,7 +1062,8 @@ uint32_t tracer_gather_size(enum side_type_gather_access_mode access_mode, uint3 static uint64_t tracer_load_gather_integer_type(const struct side_type_gather *type_gather, const void *_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_integer.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_integer.access_mode; uint32_t integer_size_bytes = type_gather->u.side_integer.type.integer_size; const char *ptr = (const char *) _ptr; union side_integer_value value; @@ -1086,7 +1087,8 @@ uint64_t tracer_load_gather_integer_type(const struct side_type_gather *type_gat static uint32_t tracer_print_gather_bool_type(const struct side_type_gather *type_gather, const void *_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_bool.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_bool.access_mode; uint32_t bool_size_bytes = type_gather->u.side_bool.type.bool_size; const char *ptr = (const char *) _ptr; union side_bool_value value; @@ -1110,7 +1112,8 @@ uint32_t tracer_print_gather_bool_type(const struct side_type_gather *type_gathe static uint32_t tracer_print_gather_byte_type(const struct side_type_gather *type_gather, const void *_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_byte.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_byte.access_mode; const char *ptr = (const char *) _ptr; uint8_t value; @@ -1126,7 +1129,8 @@ static uint32_t tracer_print_gather_integer_type(const struct side_type_gather *type_gather, const void *_ptr, enum tracer_display_base default_base) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_integer.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_integer.access_mode; uint32_t integer_size_bytes = type_gather->u.side_integer.type.integer_size; const char *ptr = (const char *) _ptr; union side_integer_value value; @@ -1150,7 +1154,8 @@ uint32_t tracer_print_gather_integer_type(const struct side_type_gather *type_ga static uint32_t tracer_print_gather_float_type(const struct side_type_gather *type_gather, const void *_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_float.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_float.access_mode; uint32_t float_size_bytes = type_gather->u.side_float.type.float_size; const char *ptr = (const char *) _ptr; union side_float_value value; @@ -1221,7 +1226,8 @@ void tracer_print_gather_field(const struct side_event_field *field, const void static uint32_t tracer_print_gather_struct(const struct side_type_gather *type_gather, const void *_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_struct.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_struct.access_mode; const char *ptr = (const char *) _ptr; uint32_t i; @@ -1240,7 +1246,8 @@ uint32_t tracer_print_gather_struct(const struct side_type_gather *type_gather, static uint32_t tracer_print_gather_array(const struct side_type_gather *type_gather, const void *_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_array.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_array.access_mode; const char *ptr = (const char *) _ptr, *orig_ptr; uint32_t i; @@ -1269,7 +1276,8 @@ static uint32_t tracer_print_gather_vla(const struct side_type_gather *type_gather, const void *_ptr, const void *_length_ptr) { - enum side_type_gather_access_mode access_mode = type_gather->u.side_vla.access_mode; + enum side_type_gather_access_mode access_mode = + (enum side_type_gather_access_mode) type_gather->u.side_vla.access_mode; const char *ptr = (const char *) _ptr, *orig_ptr; const char *length_ptr = (const char *) _length_ptr; uint32_t i, length;