};
struct side_arg_dynamic_vec {
- enum side_dynamic_type type;
+ enum side_dynamic_type dynamic_type;
union {
uint8_t side_u8;
uint16_t side_u16;
};
struct side_arg_vec {
- uint32_t type; /* enum side_type */
+ enum side_type type;
union {
uint8_t side_u8;
uint16_t side_u16;
}, \
}
-#define side_arg_dynamic_null(val) { .type = SIDE_DYNAMIC_TYPE_NULL }
+#define side_arg_dynamic_null(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_NULL }
-#define side_arg_dynamic_u8(val) { .type = SIDE_DYNAMIC_TYPE_U8, .u = { .side_u8 = (val) } }
-#define side_arg_dynamic_u16(val) { .type = SIDE_DYNAMIC_TYPE_U16, .u = { .side_u16 = (val) } }
-#define side_arg_dynamic_u32(val) { .type = SIDE_DYNAMIC_TYPE_U32, .u = { .side_u32 = (val) } }
-#define side_arg_dynamic_u64(val) { .type = SIDE_DYNAMIC_TYPE_U64, .u = { .side_u64 = (val) } }
-#define side_arg_dynamic_s8(val) { .type = SIDE_DYNAMIC_TYPE_S8, .u = { .side_s8 = (val) } }
-#define side_arg_dynamic_s16(val) { .type = SIDE_DYNAMIC_TYPE_S16, .u = { .side_s16 = (val) } }
-#define side_arg_dynamic_s32(val) { .type = SIDE_DYNAMIC_TYPE_S32, .u = { .side_s32 = (val) } }
-#define side_arg_dynamic_s64(val) { .type = SIDE_DYNAMIC_TYPE_S64, .u = { .side_s64 = (val) } }
-#define side_arg_dynamic_string(val) { .type = SIDE_DYNAMIC_TYPE_STRING, .u = { .string = (val) } }
+#define side_arg_dynamic_u8(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_U8, .u = { .side_u8 = (val) } }
+#define side_arg_dynamic_u16(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_U16, .u = { .side_u16 = (val) } }
+#define side_arg_dynamic_u32(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_U32, .u = { .side_u32 = (val) } }
+#define side_arg_dynamic_u64(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_U64, .u = { .side_u64 = (val) } }
+#define side_arg_dynamic_s8(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_S8, .u = { .side_s8 = (val) } }
+#define side_arg_dynamic_s16(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_S16, .u = { .side_s16 = (val) } }
+#define side_arg_dynamic_s32(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_S32, .u = { .side_s32 = (val) } }
+#define side_arg_dynamic_s64(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_S64, .u = { .side_s64 = (val) } }
+#define side_arg_dynamic_string(val) { .dynamic_type = SIDE_DYNAMIC_TYPE_STRING, .u = { .string = (val) } }
-#define side_arg_dynamic_vla(_vla) { .type = SIDE_DYNAMIC_TYPE_VLA, .u = { .side_dynamic_vla = (_vla) } }
+#define side_arg_dynamic_vla(_vla) { .dynamic_type = SIDE_DYNAMIC_TYPE_VLA, .u = { .side_dynamic_vla = (_vla) } }
#define side_arg_dynamic_vla_visitor(_dynamic_vla_visitor, _ctx) \
{ \
- .type = SIDE_DYNAMIC_TYPE_VLA_VISITOR, \
+ .dynamic_type = SIDE_DYNAMIC_TYPE_VLA_VISITOR, \
.app_dynamic_visitor_ctx = _ctx, \
.u = { \
.vla_visitor = _dynamic_vla_visitor, \
}, \
}
-#define side_arg_dynamic_struct(_struct) { .type = SIDE_DYNAMIC_TYPE_STRUCT, .u = { .side_dynamic_struct = (_struct) } }
+#define side_arg_dynamic_struct(_struct) { .dynamic_type = SIDE_DYNAMIC_TYPE_STRUCT, .u = { .side_dynamic_struct = (_struct) } }
#define side_arg_dynamic_struct_visitor(_dynamic_struct_visitor, _ctx) \
{ \
- .type = SIDE_DYNAMIC_TYPE_STRUCT_VISITOR, \
+ .dynamic_type = SIDE_DYNAMIC_TYPE_STRUCT_VISITOR, \
.app_dynamic_visitor_ctx = _ctx, \
.u = { \
.struct_visitor = _dynamic_struct_visitor, \
enum side_type side_type;
int i;
- if (elem_type->type != SIDE_TYPE_DYNAMIC) {
- switch (item->type) {
- case SIDE_TYPE_ARRAY_U8:
- if (elem_type->type != SIDE_TYPE_U8)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_U16:
- if (elem_type->type != SIDE_TYPE_U16)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_U32:
- if (elem_type->type != SIDE_TYPE_U32)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_U64:
- if (elem_type->type != SIDE_TYPE_U64)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_S8:
- if (elem_type->type != SIDE_TYPE_S8)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_S16:
- if (elem_type->type != SIDE_TYPE_S16)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_S32:
- if (elem_type->type != SIDE_TYPE_S32)
- goto type_error;
- break;
- case SIDE_TYPE_ARRAY_S64:
- if (elem_type->type != SIDE_TYPE_S64)
- goto type_error;
- break;
- }
- side_type = elem_type->type;
- } else {
- switch (item->type) {
- case SIDE_TYPE_ARRAY_U8:
- side_type = SIDE_TYPE_U8;
- break;
- case SIDE_TYPE_ARRAY_U16:
- side_type = SIDE_TYPE_U16;
- break;
- case SIDE_TYPE_ARRAY_U32:
- side_type = SIDE_TYPE_U32;
- break;
- case SIDE_TYPE_ARRAY_U64:
- side_type = SIDE_TYPE_U64;
- break;
- case SIDE_TYPE_ARRAY_S8:
- side_type = SIDE_TYPE_S8;
- break;
- case SIDE_TYPE_ARRAY_S16:
- side_type = SIDE_TYPE_S16;
- break;
- case SIDE_TYPE_ARRAY_S32:
- side_type = SIDE_TYPE_S32;
- break;
- case SIDE_TYPE_ARRAY_S64:
- side_type = SIDE_TYPE_S64;
- break;
- }
+ switch (item->type) {
+ case SIDE_TYPE_ARRAY_U8:
+ if (elem_type->type != SIDE_TYPE_U8)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_U16:
+ if (elem_type->type != SIDE_TYPE_U16)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_U32:
+ if (elem_type->type != SIDE_TYPE_U32)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_U64:
+ if (elem_type->type != SIDE_TYPE_U64)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_S8:
+ if (elem_type->type != SIDE_TYPE_S8)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_S16:
+ if (elem_type->type != SIDE_TYPE_S16)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_S32:
+ if (elem_type->type != SIDE_TYPE_S32)
+ goto type_error;
+ break;
+ case SIDE_TYPE_ARRAY_S64:
+ if (elem_type->type != SIDE_TYPE_S64)
+ goto type_error;
+ break;
+ default:
+ goto type_error;
}
+ side_type = elem_type->type;
printf("[ ");
for (i = 0; i < side_sav_len; i++) {
static
void tracer_print_dynamic(const struct side_arg_dynamic_vec *item)
{
- switch (item->type) {
+ switch (item->dynamic_type) {
case SIDE_DYNAMIC_TYPE_NULL:
printf("<NULL TYPE>");
break;