From 724260b6641973472eb6f98183b4c82e91b0f650 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Sat, 30 Jul 2022 10:32:50 +0200 Subject: [PATCH] Insert default types into types_tree --- src/cw/msgset.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cw/msgset.c b/src/cw/msgset.c index 7ffc2903..2834bf5b 100644 --- a/src/cw/msgset.c +++ b/src/cw/msgset.c @@ -114,6 +114,7 @@ void cw_msgset_destroy(struct cw_MsgSet *set) */ struct cw_MsgSet *cw_msgset_create() { + const cw_Type_t **ti; /* allocate memory for a message_set */ struct cw_MsgSet *set = malloc(sizeof(struct cw_MsgSet)); @@ -149,13 +150,15 @@ struct cw_MsgSet *cw_msgset_create() } set->types_tree = cw_ktv_create_types_tree(); - - printf("TYPES TREE %p\n",set->types_tree); - if (set->types_tree == NULL){ cw_msgset_destroy(set); return NULL; } + /* insert default types */ + for (ti=CW_KTV_STD_TYPES;*ti;ti++){ + mavl_insert_ptr(set->types_tree,*ti); + } + set->state_machine = mavl_create(cmp_machinestate,NULL,sizeof(cw_StateMachineState_t)); if (set->state_machine == NULL)