Refs #316. Resolved PC-Lint warning messages in the critical section utility functions port for Linux.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@318 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2017-07-28 17:19:21 +00:00
parent d858aaa856
commit 28f9bc71a3
2 changed files with 14 additions and 6 deletions

View File

@ -207,3 +207,5 @@ size-options.lnt // This .lnt file should be generated (preferrably
-esym(1055,*__builtin*)
-esym(718,*__builtin*) // The compiler does not need these ...
-esym(746,*__builtin*) // declared and it knows their prototypes.

View File

@ -61,7 +61,7 @@ void UtilCriticalSectionInit(void)
if (!criticalSectionInitialized)
{
/* Initialize the critical section object. */
pthread_mutex_init(&mtxCritSect, NULL);
(void)pthread_mutex_init(&mtxCritSect, NULL);
/* Reset nesting counter. */
criticalSectionNesting = 0;
/* Set initialized flag. */
@ -87,7 +87,7 @@ void UtilCriticalSectionTerminate(void)
/* Reset nesting counter. */
criticalSectionNesting = 0;
/* Delete the critical section object. */
pthread_mutex_destroy(&mtxCritSect);
(void)pthread_mutex_destroy(&mtxCritSect);
}
} /*** end of UtilCriticalSectionTerminate ***/
@ -109,12 +109,12 @@ void UtilCriticalSectionEnter(void)
/* Enter the critical section if not already entered. */
if (criticalSectionNesting == 0)
{
pthread_mutex_lock(&mtxCritSect);
(void)pthread_mutex_lock(&mtxCritSect);
}
/* Increment nesting counter. */
criticalSectionNesting++;
criticalSectionNesting++; /*lint !e456 */
}
} /*** end of UtilCriticalSectionEnter ***/
} /*** end of UtilCriticalSectionEnter ***/ /*lint !e456 !e454 */
/************************************************************************************//**
@ -140,12 +140,18 @@ void UtilCriticalSectionExit(void)
/* Leave the critical section. */
if (criticalSectionNesting == 0)
{
pthread_mutex_unlock (&mtxCritSect);
(void)pthread_mutex_unlock (&mtxCritSect); /*lint !e455 */
}
}
}
} /*** end of UtilCriticalSectionExit ***/
/*lint -esym(793, pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling)
* suppress info message regarding 31 significant character limit for these library
* functions.
*/
/*********************************** end of critutil.c *********************************/