]> git.sur5r.net Git - freertos/commitdiff
Correct potential compiler warning when configUSE_MUTEXES is set to 0. V8.1.1
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 30 Aug 2014 20:18:18 +0000 (20:18 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 30 Aug 2014 20:18:18 +0000 (20:18 +0000)
Add comments.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2297 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

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

index 95f0201428086c256f66107e4e5c512787f36b01..8e70fc8bc3045bc24609f5743c5ffb25641ff1a9 100644 (file)
@@ -1103,7 +1103,7 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvPar
  *\r
  * @return The name assigned to the timer specified by the xTimer parameter.\r
  */\r
-const char * pcTimerGetTimerName( TimerHandle_t xTimer );\r
+const char * pcTimerGetTimerName( TimerHandle_t xTimer ); /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 \r
 /*\r
  * Functions beyond this part are not part of the public API and are intended\r
index c4c131a87f30db1876b998cb55b0e97be56ec6fe..e82a22685b915eb63fe0f1e65a72de2509cf1a19 100644 (file)
@@ -461,7 +461,7 @@ QueueHandle_t xReturn = NULL;
                taskEXIT_CRITICAL();\r
 \r
                return pxReturn;\r
-       }\r
+       } /*lint !e818 xSemaphore cannot be a pointer to const because it is a typedef. */\r
 \r
 #endif\r
 /*-----------------------------------------------------------*/\r
@@ -1122,7 +1122,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                                {\r
                                                        if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
                                                        {\r
-                                                               /* The task waiting has a higher priority so \r
+                                                               /* The task waiting has a higher priority so\r
                                                                record that a context switch is required. */\r
                                                                if( pxHigherPriorityTaskWoken != NULL )\r
                                                                {\r
@@ -1247,7 +1247,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                                        mtCOVERAGE_TEST_MARKER();\r
                                                }\r
                                        }\r
-                                       #endif\r
+                                       #endif /* configUSE_MUTEXES */\r
 \r
                                        if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE )\r
                                        {\r
@@ -1695,7 +1695,7 @@ BaseType_t xReturn = pdFALSE;
 \r
 static void prvCopyDataFromQueue( Queue_t * const pxQueue, void * const pvBuffer )\r
 {\r
-       if( pxQueue->uxItemSize != 0 )\r
+       if( pxQueue->uxItemSize != ( UBaseType_t ) 0 )\r
        {\r
                pxQueue->u.pcReadFrom += pxQueue->uxItemSize;\r
                if( pxQueue->u.pcReadFrom >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */\r
index a9abc098023d721a612ecf8a698c4bb1fba385d1..4e2f8a7fcc45c72b0bcc803c38a508bb7883fe1b 100644 (file)
@@ -328,12 +328,12 @@ PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended  = ( UBaseType_t
        /* A port optimised version is provided, call it only if the TCB being reset\r
        is being referenced from a ready list.  If it is referenced from a delayed\r
        or suspended list then it won't be in a ready list. */\r
-       #define taskRESET_READY_PRIORITY( uxPriority )                                                                                                  \\r
-       {                                                                                                                                                                                               \\r
-               if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == 0 )                          \\r
-               {                                                                                                                                                                                       \\r
-                       portRESET_READY_PRIORITY( ( uxPriority ), ( uxTopReadyPriority ) );                                             \\r
-               }                                                                                                                                                                                       \\r
+       #define taskRESET_READY_PRIORITY( uxPriority )                                                                                                          \\r
+       {                                                                                                                                                                                                       \\r
+               if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == ( UBaseType_t ) 0 )  \\r
+               {                                                                                                                                                                                               \\r
+                       portRESET_READY_PRIORITY( ( uxPriority ), ( uxTopReadyPriority ) );                                                     \\r
+               }                                                                                                                                                                                               \\r
        }\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
@@ -1000,7 +1000,7 @@ TCB_t * pxNewTCB;
                }\r
 \r
                return eReturn;\r
-       }\r
+       } /*lint !e818 xTask cannot be a pointer to const because it is a typedef. */\r
 \r
 #endif /* INCLUDE_eTaskGetState */\r
 /*-----------------------------------------------------------*/\r
@@ -1728,7 +1728,7 @@ UBaseType_t uxTaskGetNumberOfTasks( void )
 \r
 #if ( INCLUDE_pcTaskGetTaskName == 1 )\r
 \r
-       char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery )\r
+       char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
        {\r
        TCB_t *pxTCB;\r
 \r
@@ -3039,13 +3039,13 @@ TCB_t *pxNewTCB;
        {\r
        uint32_t ulCount = 0U;\r
 \r
-               while( *pucStackByte == tskSTACK_FILL_BYTE )\r
+               while( *pucStackByte == ( uint8_t ) tskSTACK_FILL_BYTE )\r
                {\r
                        pucStackByte -= portSTACK_GROWTH;\r
                        ulCount++;\r
                }\r
 \r
-               ulCount /= ( uint32_t ) sizeof( StackType_t );\r
+               ulCount /= ( uint32_t ) sizeof( StackType_t ); /*lint !e961 Casting is not redundant on smaller architectures. */\r
 \r
                return ( uint16_t ) ulCount;\r
        }\r
@@ -3252,7 +3252,7 @@ TCB_t *pxTCB;
                        if( pxTCB->uxPriority != pxTCB->uxBasePriority )\r
                        {\r
                                /* Only disinherit if no other mutexes are held. */\r
-                               if( pxTCB->uxMutexesHeld == 0 )\r
+                               if( pxTCB->uxMutexesHeld == ( UBaseType_t ) 0 )\r
                                {\r
                                        /* The holding task must be the running task to be able to give\r
                                        the mutex back.  Remove the holding task from the ready list. */\r
@@ -3587,9 +3587,9 @@ TickType_t uxReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void *pvTaskIncrementMutexHeldCount( void )\r
-{\r
-       #if ( configUSE_MUTEXES == 1 )\r
+#if ( configUSE_MUTEXES == 1 )\r
+\r
+       void *pvTaskIncrementMutexHeldCount( void )\r
        {\r
                /* If xSemaphoreCreateMutex() is called before any tasks have been created\r
                then pxCurrentTCB will be NULL. */\r
@@ -3600,8 +3600,9 @@ void *pvTaskIncrementMutexHeldCount( void )
 \r
                return pxCurrentTCB;\r
        }\r
-       #endif\r
-}\r
+\r
+#endif /* configUSE_MUTEXES */\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 #ifdef FREERTOS_MODULE_TEST\r
index 029cda4ee72e9c1da51e13639f2f234f40ec1806..9ce9acb24bda44b7e93827c1a5d50e9c3cec448b 100644 (file)
@@ -591,7 +591,7 @@ TickType_t xTimeNow;
                {\r
                        /* Negative commands are pended function calls rather than timer\r
                        commands. */\r
-                       if( xMessage.xMessageID < 0 )\r
+                       if( xMessage.xMessageID < ( BaseType_t ) 0 )\r
                        {\r
                                const CallbackParameters_t * const pxCallback = &( xMessage.u.xCallbackParameters );\r
 \r
@@ -843,7 +843,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
                xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;\r
 \r
                xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );\r
-               \r
+\r
                tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn );\r
 \r
                return xReturn;\r
@@ -869,7 +869,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
                xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );\r
 \r
                tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn );\r
-               \r
+\r
                return xReturn;\r
        }\r
 \r