list -> clist to avoid naming conflict.

This commit is contained in:
Gatsby Van
2024-01-21 14:43:36 +08:00
parent 162e291533
commit 61a3c49ce8
6 changed files with 38 additions and 38 deletions
+14 -14
View File
@@ -20,7 +20,7 @@
#include "linklayer814.h"
#include "linklayer814_types.h"
#include "../error.h"
#include "../util/list.h"
#include "../util/clist.h"
/***************** Macros (Inline Functions) Definitions *********************/
/**************************** Type Definitions *******************************/
/************************** Variable Definitions *****************************/
@@ -80,7 +80,7 @@ int32_t L2_CreateSchedEventPool(L2_SCHD_POOL **schdPool)
DBG_ERROR("Failed to allocated memory for schdPool.\n");
return EALLOC;
}
(*schdPool)->schdList = list_new();
(*schdPool)->schdList = clist_new();
if ((*schdPool)->schdList == NULL)
{
DBG_ERROR("Failed to allocated memory for schdPool->schdList.\n");
@@ -106,7 +106,7 @@ int32_t L2_CreateSchedEventPool(L2_SCHD_POOL **schdPool)
void L2_ClearSchedEventPool(L2_SCHD_POOL *schdPool)
{
ASSERT(schdPool != NULL);
list_clear(schdPool->schdList);
clist_clear(schdPool->schdList);
schdPool->envCnt = 0;
}
@@ -125,7 +125,7 @@ void L2_DestroySchedEventPool(L2_SCHD_POOL *schdPool)
{
return;
}
list_destroy(schdPool->schdList);
clist_destroy(schdPool->schdList);
free(schdPool);
}
@@ -155,7 +155,7 @@ L2_SCHD_EVENT *L2_CreatNewSchdEvent(L2_SCHD_POOL *schdPool, L2_EVENT_TYPE event,
DBG_ERROR("Failed to allocate schedule event.\n");
return NULL;
}
list_node_t *node = list_node_new(schdEvent);
clist_node_t *node = clist_node_new(schdEvent);
if (node == NULL)
{
DBG_ERROR("Failed to allocate schedule event list node.\n");
@@ -170,7 +170,7 @@ L2_SCHD_EVENT *L2_CreatNewSchdEvent(L2_SCHD_POOL *schdPool, L2_EVENT_TYPE event,
schdEvent->isVolatile = isVolatile;
schdEvent->schdSlot = L2_SLOTNO_NONE;
schdEvent->schdFrame = L2_FRAMENO_NONE;
list_rpush(schdPool->schdList, node);
clist_rpush(schdPool->schdList, node);
return schdEvent;
}
@@ -189,7 +189,7 @@ L2_SCHD_EVENT *L2_GetEventById(L2_SCHD_POOL *schdPool, uint32_t id)
{
ASSERT(schdPool != NULL);
util_schdevent.eventId = id;
list_node_t *node = list_find(schdPool->schdList, &util_schdevent);
clist_node_t *node = clist_find(schdPool->schdList, &util_schdevent);
if (node != NULL)
{
DBG_WARNING("Event with id=%d, dose not exist.\n", id);
@@ -214,13 +214,13 @@ int32_t L2_DeleteSchdEventById(L2_SCHD_POOL *schdPool, uint32_t id)
{
ASSERT(schdPool != NULL);
util_schdevent.eventId = id;
list_node_t *node = list_find(schdPool->schdList, &util_schdevent);
clist_node_t *node = clist_find(schdPool->schdList, &util_schdevent);
if (node != NULL)
{
DBG_ERROR("Event with id=%d, dose not exist.\n", id);
return EIGNORE;
}
list_remove(schdPool->schdList, node);
clist_remove(schdPool->schdList, node);
return SUCCESS;
}
@@ -343,16 +343,16 @@ int32_t L2_RescheduleEventAfter(L2_INST *instPtr, L2_SCHD_EVENT *schdEvent, uint
void L2_EventPoolHandler(L2_INST *instPtr)
{
ASSERT(instPtr != NULL);
list_node_t *node;
clist_node_t *node;
L2_SCHD_EVENT *event;
L2_SCHD_POOL *pool = instPtr->schdEventPool;
list_iterator_t *iter = list_iterator_new(pool->schdList, LIST_HEAD);
clist_iterator_t *iter = clist_iterator_new(pool->schdList, LIST_HEAD);
if (iter == NULL)
{
DBG_ERROR("Failed to initialize schedule event pool iteration.\n");
return;
}
while ((node = list_iterator_next(iter)))
while ((node = clist_iterator_next(iter)))
{
event = (L2_SCHD_EVENT *)node->val;
if (L2_isEventScheduled(event))
@@ -364,7 +364,7 @@ void L2_EventPoolHandler(L2_INST *instPtr)
if (event->isVolatile == true)
{
DBG_INFO("Deleting scheduled event [%d], since it is volatile.\n", event->eventId);
list_remove(pool->schdList, node);
clist_remove(pool->schdList, node);
}
else
{
@@ -373,7 +373,7 @@ void L2_EventPoolHandler(L2_INST *instPtr)
}
}
}
list_iterator_destroy(iter);
clist_iterator_destroy(iter);
}
/*****************************************************************************/