From 28f9bc71a3a653af4ab511bb74c81c93f9ac5ef8 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Fri, 28 Jul 2017 17:19:21 +0000 Subject: [PATCH] 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 --- Host/Source/LibOpenBLT/lint/gnu/co-gcc.lnt | 2 ++ Host/Source/LibOpenBLT/port/linux/critutil.c | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Host/Source/LibOpenBLT/lint/gnu/co-gcc.lnt b/Host/Source/LibOpenBLT/lint/gnu/co-gcc.lnt index 16e677f0..a98c43d2 100644 --- a/Host/Source/LibOpenBLT/lint/gnu/co-gcc.lnt +++ b/Host/Source/LibOpenBLT/lint/gnu/co-gcc.lnt @@ -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. + + diff --git a/Host/Source/LibOpenBLT/port/linux/critutil.c b/Host/Source/LibOpenBLT/port/linux/critutil.c index 705432ab..0fa6723c 100644 --- a/Host/Source/LibOpenBLT/port/linux/critutil.c +++ b/Host/Source/LibOpenBLT/port/linux/critutil.c @@ -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 *********************************/