summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: ca8045b)
raw | patch | inline | side by side (from parent 1: ca8045b)
author | Prasad Konnur <prasadkonnur@ti.com> | |
Wed, 18 Sep 2019 13:09:16 +0000 (18:39 +0530) | ||
committer | Prasad Konnur <prasadkonnur@ti.com> | |
Wed, 18 Sep 2019 13:09:42 +0000 (18:39 +0530) |
Signed-off-by: Prasad Konnur <prasadkonnur@ti.com>
include/fvid2_utils.h | patch | blob | history | |
src/fvid2_utils.c | patch | blob | history | |
src/trace.c | patch | blob | history |
diff --git a/include/fvid2_utils.h b/include/fvid2_utils.h
index cd1aaf8666de8c5641be9120afcad362ce193cb4..f584a00c1c44b1f1af9dd97722b21d3c40c02c39 100755 (executable)
--- a/include/fvid2_utils.h
+++ b/include/fvid2_utils.h
*
* \return None.
*/
-void Fvid2Utils_memset(void *mem, uint8_t ch, uint32_t byteCount);
+void Fvid2Utils_memset(void *mem, uint8_t ch, size_t byteCount);
/**
* Fvid2Utils_memsetw
*
* \return None
*/
-void Fvid2Utils_memcpy(void *dest, const void *src, uint32_t byteCount);
+void Fvid2Utils_memcpy(void *dest, const void *src, size_t byteCount);
/**
* Fvid2Utils_memcmp
{
if ((uint32_t) FALSE == params->flag[cnt])
{
- tempVal = ((uintptr_t) params->mem) + (params->elemSize * cnt);
+ tempVal = ((uintptr_t) params->mem) + (((uintptr_t) params->elemSize) * ((uintptr_t) cnt));
allocMem = (void *) (tempVal);
params->flag[cnt] = (uint32_t) TRUE;
for (cnt = 0U; cnt < params->numElem; cnt++)
{
- tempVal = ((uintptr_t) params->mem) + (params->elemSize * cnt);
+ tempVal = ((uintptr_t) params->mem) + (((uintptr_t)params->elemSize) * ((uintptr_t)cnt));
if ((void *) (tempVal) == mem)
{
/* Check if the memory is already allocated */
diff --git a/src/fvid2_utils.c b/src/fvid2_utils.c
index a5f47e1d3544f96d87ad8fce372d28ec50484e22..ad316f3ef6d88c293726021271d086328fcad8c2 100644 (file)
--- a/src/fvid2_utils.c
+++ b/src/fvid2_utils.c
*
* \return The destination memory pointer
*/
-void Fvid2Utils_memset(void *mem, uint8_t ch, uint32_t byteCount)
+void Fvid2Utils_memset(void *mem, uint8_t ch, size_t byteCount)
{
/* NULL pointer check */
GT_assert(Fvid2Trace, (NULL_PTR != mem));
*
* \return The destination memory pointer
*/
-void Fvid2Utils_memcpy(void *dest, const void *src, uint32_t byteCount)
+void Fvid2Utils_memcpy(void *dest, const void *src, size_t byteCount)
{
/* NULL pointer check */
GT_assert(Fvid2Trace, (NULL_PTR != dest));
{
Fvid2UtilsLinkListObj *llobj;
int32_t rtnValue = FVID2_SOK;
+ uint32_t tempPriority = priority;
/* NULL pointer check */
GT_assert(Fvid2Trace, (NULL_PTR != handle));
{
GT_assert(Fvid2Trace, FALSE);
}
- priority = llobj->priorityCnt;
+ tempPriority = llobj->priorityCnt;
}
if (FVID2UTILS_LLT_CIRCULAR == llobj->listType)
llobj->headNode,
node,
node->data,
- priority);
+ tempPriority);
}
else if (FVID2UTILS_LLT_DOUBLE == llobj->listType)
{
llobj,
node,
node->data,
- priority,
+ tempPriority,
(uint32_t) TRUE);
if (rtnValue == FVID2_SOK)
{
uint32_t priority)
{
Fvid2Utils_Node *curNode;
+ Fvid2Utils_Node *tempHeadNode = headNode;
/* NULL pointer check */
GT_assert(Fvid2Trace, (NULL_PTR != node));
node->priority = priority;
/* Check if this is the first node. */
- if (NULL != headNode)
+ if (NULL != tempHeadNode)
{
/* Add to the list based on priority */
- curNode = headNode;
+ curNode = tempHeadNode;
do
{
/* Nodes with the same priority are always added to the bottom
* of the existing nodes with same priority. */
if (priority < curNode->priority)
{
- if (curNode == headNode)
+ if (curNode == tempHeadNode)
{
/* Adding to the top of the list */
- headNode = node;
+ tempHeadNode = node;
}
break;
}
curNode = curNode->next;
/* Not supposed to have NULL in circular list */
GT_assert(Fvid2Trace, (NULL_PTR != curNode));
- } while (curNode != headNode);
+ } while (curNode != tempHeadNode);
/* Check if we have come to the end of the list */
/* Add the node before the current node as we have traversed one
else
{
/* First node. Add to as head node */
- headNode = node;
+ tempHeadNode = node;
node->next = node;
node->prev = node;
}
- return (headNode);
+ return (tempHeadNode);
}
/**
static Fvid2Utils_Node *dutilsUnLinkCircularPri(Fvid2Utils_Node *headNode,
Fvid2Utils_Node *node)
{
+ Fvid2Utils_Node *tempHeadNode = headNode;
+
/* NULL pointer check */
- GT_assert(Fvid2Trace, (NULL_PTR != headNode));
+ GT_assert(Fvid2Trace, (NULL_PTR != tempHeadNode));
GT_assert(Fvid2Trace, (NULL_PTR != node));
/* Not supposed to have NULL in circular list */
node->prev->next = node->next;
node->next->prev = node->prev;
- if (node == headNode)
+ if (node == tempHeadNode)
{
/* Unlinking head node */
- if ((headNode == headNode->next) || (headNode == headNode->prev))
+ if ((tempHeadNode == tempHeadNode->next) || (tempHeadNode == tempHeadNode->prev))
{
/* Unlinking last node */
GT_assert(Fvid2Trace,
- ((headNode == headNode->next) &&
- (headNode == headNode->prev)));
- headNode = NULL;
+ ((tempHeadNode == tempHeadNode->next) &&
+ (tempHeadNode == tempHeadNode->prev)));
+ tempHeadNode = NULL;
}
else
{
/* Make next node as head node */
- headNode = node->next;
+ tempHeadNode = node->next;
}
}
node->next = NULL;
node->prev = NULL;
- return (headNode);
+ return (tempHeadNode);
}
/**
diff --git a/src/trace.c b/src/trace.c
index 7a98adf65af0ad2ca95cc57f8607fb74be724f3c..8b37b050e184386176b7df72fdd3cc0d80578bcf 100644 (file)
--- a/src/trace.c
+++ b/src/trace.c
const char *fileName,
int32_t lineNum)
{
- if ((!(condition)) != 0)
+ volatile uint32_t loop = 1U;
+ if (condition == 0U)
{
GT_3trace(
Fvid2Trace, GT_ERR,
" Assertion @ Line: %d in %s: %s : failed !!!\n",
lineNum, fileName, str);
- while (TRUE)
+ while (loop == 1U)
{
;
}