]> git.sur5r.net Git - freertos/commitdiff
Clean up lint errors.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 16 Aug 2016 13:44:30 +0000 (13:44 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 16 Aug 2016 13:44:30 +0000 (13:44 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2468 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/include/task.h
FreeRTOS/Source/include/timers.h
FreeRTOS/Source/queue.c
FreeRTOS/Source/tasks.c
FreeRTOS/Source/timers.c

index 73b740b248a30053e963a4272a167957aac7c1fb..dd7cd03223dfb056e5c934a15e760414dc7baf8c 100644 (file)
@@ -358,11 +358,11 @@ is used in assert() statements. */
  */\r
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
        BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,\r
-                                                       const char * const pcName,\r
+                                                       const char * const pcName,      /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                        const uint16_t usStackDepth,\r
                                                        void * const pvParameters,\r
                                                        UBaseType_t uxPriority,\r
-                                                       TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                       TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;\r
 #endif\r
 \r
 /**\r
@@ -474,12 +474,12 @@ is used in assert() statements. */
  */\r
 #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
        TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,\r
-                                                                       const char * const pcName,\r
+                                                                       const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                        const uint32_t ulStackDepth,\r
                                                                        void * const pvParameters,\r
                                                                        UBaseType_t uxPriority,\r
                                                                        StackType_t * const puxStackBuffer,\r
-                                                                       StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                       StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;\r
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 /**\r
index fda71ca0d31f5a96cada196be22818d930414109..5c7ac15715bd8cc685b6feac436f1dc6ba7f3070 100644 (file)
@@ -266,11 +266,11 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
  * @endverbatim\r
  */\r
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
-       TimerHandle_t xTimerCreate(     const char * const pcTimerName,\r
+       TimerHandle_t xTimerCreate(     const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                const TickType_t xTimerPeriodInTicks,\r
                                                                const UBaseType_t uxAutoReload,\r
                                                                void * const pvTimerID,\r
-                                                               TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                               TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;\r
 #endif\r
 \r
 /**\r
@@ -396,12 +396,12 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
  * @endverbatim\r
  */\r
 #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
-       TimerHandle_t xTimerCreateStatic(       const char * const pcTimerName,\r
+       TimerHandle_t xTimerCreateStatic(       const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                                const TickType_t xTimerPeriodInTicks,\r
                                                                                const UBaseType_t uxAutoReload,\r
                                                                                void * const pvTimerID,\r
                                                                                TimerCallbackFunction_t pxCallbackFunction,\r
-                                                                               StaticTimer_t *pxTimerBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                               StaticTimer_t *pxTimerBuffer ) PRIVILEGED_FUNCTION;\r
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 /**\r
index e8ae0d307d2f26ccc6d77efe4c37057632218ca2..824c263e1dd5db278598c916d24060085c7b206c 100644 (file)
@@ -1153,7 +1153,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                        can be assumed there is no mutex holder and no need to determine if\r
                        priority disinheritance is needed.  Simply increase the count of\r
                        messages (semaphores) available. */\r
-                       pxQueue->uxMessagesWaiting = uxMessagesWaiting + 1;\r
+                       pxQueue->uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1;\r
 \r
                        /* The event list is not altered if the queue is locked.  This will\r
                        be done when the queue is unlocked later. */\r
@@ -1300,7 +1300,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                        traceQUEUE_RECEIVE( pxQueue );\r
 \r
                                        /* Actually removing data, not just peeking. */\r
-                                       pxQueue->uxMessagesWaiting = uxMessagesWaiting - 1;\r
+                                       pxQueue->uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1;\r
 \r
                                        #if ( configUSE_MUTEXES == 1 )\r
                                        {\r
@@ -1494,7 +1494,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                        traceQUEUE_RECEIVE_FROM_ISR( pxQueue );\r
 \r
                        prvCopyDataFromQueue( pxQueue, pvBuffer );\r
-                       pxQueue->uxMessagesWaiting = uxMessagesWaiting - 1;\r
+                       pxQueue->uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1;\r
 \r
                        /* If the queue is locked the event list will not be modified.\r
                        Instead update the lock count so the task that unlocks the queue\r
@@ -1793,7 +1793,7 @@ UBaseType_t uxMessagesWaiting;
                }\r
        }\r
 \r
-       pxQueue->uxMessagesWaiting = uxMessagesWaiting + 1;\r
+       pxQueue->uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1;\r
 \r
        return xReturn;\r
 }\r
@@ -2342,7 +2342,7 @@ BaseType_t xReturn;
                }\r
 \r
                return pcReturn;\r
-       }\r
+       } /*lint !e818 xQueue cannot be a pointer to const because it is a typedef. */\r
 \r
 #endif /* configQUEUE_REGISTRY_SIZE */\r
 /*-----------------------------------------------------------*/\r
@@ -2421,7 +2421,7 @@ BaseType_t xReturn;
        {\r
        QueueSetHandle_t pxQueue;\r
 \r
-               pxQueue = xQueueGenericCreate( uxEventQueueLength, sizeof( Queue_t * ), queueQUEUE_TYPE_SET );\r
+               pxQueue = xQueueGenericCreate( uxEventQueueLength, ( UBaseType_t ) sizeof( Queue_t * ), queueQUEUE_TYPE_SET );\r
 \r
                return pxQueue;\r
        }\r
index f101e258eb422d23e5f9bfa0dbb3782e3b7b3cd2..8243567eb732342cc69948acff3a2bc1d24fe59f 100644 (file)
@@ -352,7 +352,7 @@ typedef struct tskTaskControlBlock
 \r
        /* See the comments above the definition of\r
        tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */\r
-       #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
+       #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
                uint8_t ucStaticallyAllocated;          /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */\r
        #endif\r
 \r
@@ -565,13 +565,13 @@ static void prvResetNextTaskUnblockTime( void );
  * dynamically to fill in the structure's members.\r
  */\r
 static void prvInitialiseNewTask(      TaskFunction_t pxTaskCode,\r
-                                                                       const char * const pcName,\r
+                                                                       const char * const pcName,              /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                        const uint32_t ulStackDepth,\r
                                                                        void * const pvParameters,\r
                                                                        UBaseType_t uxPriority,\r
                                                                        TaskHandle_t * const pxCreatedTask,\r
                                                                        TCB_t *pxNewTCB,\r
-                                                                       const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                       const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Called after a new task has been created and initialised to place the task\r
@@ -584,12 +584,12 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) PRIVILEGED_FUNCTION;
 #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
 \r
        TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,\r
-                                                                       const char * const pcName,\r
+                                                                       const char * const pcName,              /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                        const uint32_t ulStackDepth,\r
                                                                        void * const pvParameters,\r
                                                                        UBaseType_t uxPriority,\r
                                                                        StackType_t * const puxStackBuffer,\r
-                                                                       StaticTask_t * const pxTaskBuffer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                       StaticTask_t * const pxTaskBuffer )\r
        {\r
        TCB_t *pxNewTCB;\r
        TaskHandle_t xReturn;\r
@@ -604,7 +604,7 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) PRIVILEGED_FUNCTION;
                        pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */\r
                        pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;\r
 \r
-                       #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
+                       #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
                        {\r
                                /* Tasks can be created statically or dynamically, so note this\r
                                task was created statically in case the task is later deleted. */\r
@@ -674,11 +674,11 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) PRIVILEGED_FUNCTION;
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
 \r
        BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,\r
-                                                       const char * const pcName,\r
+                                                       const char * const pcName,              /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                        const uint16_t usStackDepth,\r
                                                        void * const pvParameters,\r
                                                        UBaseType_t uxPriority,\r
-                                                       TaskHandle_t * const pxCreatedTask ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                       TaskHandle_t * const pxCreatedTask )\r
        {\r
        TCB_t *pxNewTCB;\r
        BaseType_t xReturn;\r
@@ -741,7 +741,7 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) PRIVILEGED_FUNCTION;
 \r
                if( pxNewTCB != NULL )\r
                {\r
-                       #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
+                       #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
                        {\r
                                /* Tasks can be created statically or dynamically, so note this\r
                                task was created dynamically in case it is later deleted. */\r
@@ -765,13 +765,13 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) PRIVILEGED_FUNCTION;
 /*-----------------------------------------------------------*/\r
 \r
 static void prvInitialiseNewTask(      TaskFunction_t pxTaskCode,\r
-                                                                       const char * const pcName,\r
+                                                                       const char * const pcName,              /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                        const uint32_t ulStackDepth,\r
                                                                        void * const pvParameters,\r
                                                                        UBaseType_t uxPriority,\r
                                                                        TaskHandle_t * const pxCreatedTask,\r
                                                                        TCB_t *pxNewTCB,\r
-                                                                       const MemoryRegion_t * const xRegions ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                       const MemoryRegion_t * const xRegions )\r
 {\r
 StackType_t *pxTopOfStack;\r
 UBaseType_t x;\r
@@ -1672,7 +1672,7 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB )
                        {\r
                                /* Is it in the suspended list because it is in the     Suspended\r
                                state, or because is is blocked with no timeout? */\r
-                               if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) != pdFALSE )\r
+                               if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) != pdFALSE ) /*lint !e961.  The cast is only redundant when NULL is used. */\r
                                {\r
                                        xReturn = pdTRUE;\r
                                }\r
@@ -1840,7 +1840,7 @@ BaseType_t xReturn;
                xIdleTaskHandle = xTaskCreateStatic(    prvIdleTask,\r
                                                                                                "IDLE",\r
                                                                                                ulIdleTaskStackSize,\r
-                                                                                               ( void * ) NULL,\r
+                                                                                               ( void * ) NULL, /*lint !e961.  The cast is not redundant for all compilers. */\r
                                                                                                ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ),\r
                                                                                                pxIdleTaskStackBuffer,\r
                                                                                                pxIdleTaskTCBBuffer ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */\r
@@ -2513,13 +2513,13 @@ BaseType_t xSwitchRequired = pdFALSE;
        {\r
                /* Minor optimisation.  The tick count cannot change in this\r
                block. */\r
-               const TickType_t xConstTickCount = xTickCount + 1;\r
+               const TickType_t xConstTickCount = xTickCount + ( TickType_t ) 1;\r
 \r
                /* Increment the RTOS tick, switching the delayed and overflowed\r
                delayed lists if it wraps to 0. */\r
                xTickCount = xConstTickCount;\r
 \r
-               if( xConstTickCount == ( TickType_t ) 0U )\r
+               if( xConstTickCount == ( TickType_t ) 0U ) /*lint !e774 'if' does not always evaluate to false as it is looking for an overflow. */\r
                {\r
                        taskSWITCH_DELAYED_LISTS();\r
                }\r
@@ -3592,7 +3592,7 @@ static void prvCheckTasksWaitingTermination( void )
                        vPortFree( pxTCB->pxStack );\r
                        vPortFree( pxTCB );\r
                }\r
-               #elif( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )\r
+               #elif( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
                {\r
                        /* The task could have been allocated statically or dynamically, so\r
                        check what was statically allocated before trying to free the\r
@@ -4232,7 +4232,7 @@ TickType_t uxReturn;
                                }\r
                                else\r
                                {\r
-                                       pxCurrentTCB->ulNotifiedValue = ulReturn - 1;\r
+                                       pxCurrentTCB->ulNotifiedValue = ulReturn - ( uint32_t ) 1;\r
                                }\r
                        }\r
                        else\r
index e49587f5115dbbe2e23a7ecfb53752783fb98911..c020036632ef3304ab234993c526c4995ef6c2e6 100644 (file)
@@ -248,12 +248,12 @@ static void prvProcessTimerOrBlockTask( const TickType_t xNextExpireTime, BaseTy
  * Called after a Timer_t structure has been allocated either statically or\r
  * dynamically to fill in the structure's members.\r
  */\r
-static void prvInitialiseNewTimer(     const char * const pcTimerName,\r
+static void prvInitialiseNewTimer(     const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                        const TickType_t xTimerPeriodInTicks,\r
                                                                        const UBaseType_t uxAutoReload,\r
                                                                        void * const pvTimerID,\r
                                                                        TimerCallbackFunction_t pxCallbackFunction,\r
-                                                                       Timer_t *pxNewTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                       Timer_t *pxNewTimer ) PRIVILEGED_FUNCTION;\r
 /*-----------------------------------------------------------*/\r
 \r
 BaseType_t xTimerCreateTimerTask( void )\r
@@ -311,11 +311,11 @@ BaseType_t xReturn = pdFAIL;
 \r
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
 \r
-       TimerHandle_t xTimerCreate(     const char * const pcTimerName,\r
+       TimerHandle_t xTimerCreate(     const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                const TickType_t xTimerPeriodInTicks,\r
                                                                const UBaseType_t uxAutoReload,\r
                                                                void * const pvTimerID,\r
-                                                               TimerCallbackFunction_t pxCallbackFunction ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                               TimerCallbackFunction_t pxCallbackFunction )\r
        {\r
        Timer_t *pxNewTimer;\r
 \r
@@ -343,12 +343,12 @@ BaseType_t xReturn = pdFAIL;
 \r
 #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
 \r
-       TimerHandle_t xTimerCreateStatic(       const char * const pcTimerName,\r
+       TimerHandle_t xTimerCreateStatic(       const char * const pcTimerName,         /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                                const TickType_t xTimerPeriodInTicks,\r
                                                                                const UBaseType_t uxAutoReload,\r
                                                                                void * const pvTimerID,\r
                                                                                TimerCallbackFunction_t pxCallbackFunction,\r
-                                                                               StaticTimer_t *pxTimerBuffer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                               StaticTimer_t *pxTimerBuffer )\r
        {\r
        Timer_t *pxNewTimer;\r
 \r
@@ -385,12 +385,12 @@ BaseType_t xReturn = pdFAIL;
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvInitialiseNewTimer(     const char * const pcTimerName,\r
+static void prvInitialiseNewTimer(     const char * const pcTimerName,                 /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
                                                                        const TickType_t xTimerPeriodInTicks,\r
                                                                        const UBaseType_t uxAutoReload,\r
                                                                        void * const pvTimerID,\r
                                                                        TimerCallbackFunction_t pxCallbackFunction,\r
-                                                                       Timer_t *pxNewTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+                                                                       Timer_t *pxNewTimer )\r
 {\r
        /* 0 is not a valid value for xTimerPeriodInTicks. */\r
        configASSERT( ( xTimerPeriodInTicks > 0 ) );\r
@@ -760,7 +760,7 @@ TickType_t xTimeNow;
                        software timer. */\r
                        pxTimer = xMessage.u.xTimerParameters.pxTimer;\r
 \r
-                       if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE )\r
+                       if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE ) /*lint !e961. The cast is only redundant when NULL is passed into the macro. */\r
                        {\r
                                /* The timer is in a list, remove it. */\r
                                ( void ) uxListRemove( &( pxTimer->xTimerListItem ) );\r
@@ -945,10 +945,10 @@ static void prvCheckForValidListAndQueue( void )
                        {\r
                                /* The timer queue is allocated statically in case\r
                                configSUPPORT_DYNAMIC_ALLOCATION is 0. */\r
-                               static StaticQueue_t xStaticTimerQueue;\r
-                               static uint8_t ucStaticTimerQueueStorage[ configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ];\r
+                               static StaticQueue_t xStaticTimerQueue; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */\r
+                               static uint8_t ucStaticTimerQueueStorage[ ( size_t ) configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ]; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */\r
 \r
-                               xTimerQueue = xQueueCreateStatic( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, sizeof( DaemonTaskMessage_t ), &( ucStaticTimerQueueStorage[ 0 ] ), &xStaticTimerQueue );\r
+                               xTimerQueue = xQueueCreateStatic( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ), &( ucStaticTimerQueueStorage[ 0 ] ), &xStaticTimerQueue );\r
                        }\r
                        #else\r
                        {\r
@@ -991,7 +991,7 @@ Timer_t *pxTimer = ( Timer_t * ) xTimer;
                /* Checking to see if it is in the NULL list in effect checks to see if\r
                it is referenced from either the current or the overflow timer lists in\r
                one go, but the logic has to be reversed, hence the '!'. */\r
-               xTimerIsInActiveList = ( BaseType_t ) !( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) );\r
+               xTimerIsInActiveList = ( BaseType_t ) !( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) ); /*lint !e961. Cast is only redundant when NULL is passed into the macro. */\r
        }\r
        taskEXIT_CRITICAL();\r
 \r