Fixed a lot of bugs with action lists.

FossilOrigin-Name: 8508ea2ae3a0a1d1ec2ac76ddf1c7813f802c656f4ffb1b463769347405ae85a
This commit is contained in:
7u83@mail.ru
2015-05-01 11:55:02 +00:00
parent 25cd668ca7
commit 4423c1d79e
5 changed files with 21 additions and 8 deletions

View File

@ -154,10 +154,10 @@ static int cw_action_out_cmp(const void *elem1, const void *elem2)
}
else{
if (!e1->item_id) {
r = strcmp("", e2->item_id);
r = strcmp(CW_ITEM_NONE, e2->item_id);
}
else if (!e2->item_id){
r = strcmp(e1->item_id,"");
r = strcmp(e1->item_id,CW_ITEM_NONE);
}
else{
r = strcmp(e1->item_id, e2->item_id);
@ -185,7 +185,7 @@ static int cw_action_out_cmp(const void *elem1, const void *elem2)
void *cw_actionlist_add(struct avltree *t, void *a, size_t s)
{
void *r = mavl_replace_data(t, a, sizeof(struct cw_action_in));
void *r = mavl_replace_data(t, a, s); //sizeof(struct cw_action_in));
if (r) {
return r;
}
@ -199,6 +199,7 @@ void *cw_actionlist_add(struct avltree *t, void *a, size_t s)
}
#include "dbg.h" // Tube
/**
* Create an action list for outgoing message lements
@ -212,6 +213,7 @@ cw_actionlist_out_t cw_actionlist_out_create()
cw_action_out_t *cw_actionlist_out_add(cw_actionlist_out_t t, struct cw_action_out * a)
{
DBGX("Adding out action: %d %d %p ",a->msg_id,a->elem_id,a->item_id);
return cw_actionlist_add(t, a, sizeof(struct cw_action_out));
}