Problem with ILibLinkedList code, generated by IntelDevice builder

Problem with ILibLinkedList code, generated by IntelDevice builder

Hi all

I have been developing a UPnP device, using the Intel UPnP device builder 'Build: 1.0.1868.18043'. In the developed code I am making use of the linked list support in ILibParsers.h. However I am not getting expected results if I remove the last element of the linked list. Attempting to add subsequent elements to the tail of the linked list then fail.

Below is the source to void ILibLinkedList_Remove(void *LinkedList_Node) as generated by device builder

void ILibLinkedList_Remove(void *LinkedList_Node) {

struct ILibLinkedListNode_Root *r = ((struct ILibLinkedListNode*)LinkedList_Node)->Root;

struct ILibLinkedListNode *n = (struct ILibLinkedListNode*) LinkedList_Node;

if(n->Previous!=NULL)

{

n->Previous->Next = n->Next;

}

if(n->Next!=NULL)

{

n->Next->Previous = n->Previous;

}

if(r->Head==n)

{

r->Head = n->Next;

}

if(r->Tail==n)

{

r->Tail = n->Next;

}

--r->count;

free(n);

}

The error appears to be in the check to see if this is the last element in the list. I believe it should be

if(r->Tail==n)

{

r->Tail = n->Previous;

}

Do people agree?

The same issue is also present in

void ILibLinkedList_Remove_ByData(void *LinkedList, void *data)

2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Hi,

This issue has already been resolved in version 2718 of the tools.

发表评论

登录添加评论。还不是成员?立即加入