hello i am trying to sort a linked list
when i sort it it works on visual studio but when i move it to linux the linked list does not get sorted for some reason.
my sorts gets a pointer to a pointer of the list and this is my sort code:
i call the function like this:
SortQueue(&pprocessQueue, ProcessPrIdCompare);
and here is my function
the function uses EnqueueInOrder which puts every link in his place.
void SortQueue(Queue **pqueue, CompareFunction CompareElements)
{
Queue *ptemp = CreateQueue( (*pqueue)->CopyElement,
(*pqueue)->FreeElement,
CompareElements,
(*pqueue)->PrintElement );
(*pqueue)->CompareElements = CompareElements;
while (!(IsEmpty(*pqueue) == SUCCESS))
EnqueueInOrder(ptemp, DequeueLink(*pqueue));
while (!(IsEmpty(ptemp) == SUCCESS))
EnqueueInOrder(*pqueue, DequeueLink(ptemp));
FreeQueue(ptemp);
}
1 more thing i am using gcc to compile.