Software Archive
Read-only legacy content
17061 Discussions

Problem with ILibLinkedList code, generated by IntelDevice builder

armman
Beginner
384 Views

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)

0 Kudos
1 Reply
BRYAN_R_Intel
Employee
384 Views

Hi,

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

0 Kudos
Reply