Correct potential compiler warning when configUSE_MUTEXES is set to 0.

Add comments.
pull/1/head
Richard Barry 11 years ago
parent a60ce58731
commit 99229b597b

@ -1103,7 +1103,7 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvPar
* *
* @return The name assigned to the timer specified by the xTimer parameter. * @return The name assigned to the timer specified by the xTimer parameter.
*/ */
const char * pcTimerGetTimerName( TimerHandle_t xTimer ); const char * pcTimerGetTimerName( TimerHandle_t xTimer ); /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
/* /*
* Functions beyond this part are not part of the public API and are intended * Functions beyond this part are not part of the public API and are intended

@ -461,7 +461,7 @@ QueueHandle_t xReturn = NULL;
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();
return pxReturn; return pxReturn;
} } /*lint !e818 xSemaphore cannot be a pointer to const because it is a typedef. */
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -1122,7 +1122,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
{ {
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{ {
/* The task waiting has a higher priority so /* The task waiting has a higher priority so
record that a context switch is required. */ record that a context switch is required. */
if( pxHigherPriorityTaskWoken != NULL ) if( pxHigherPriorityTaskWoken != NULL )
{ {
@ -1247,7 +1247,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
} }
#endif #endif /* configUSE_MUTEXES */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE )
{ {
@ -1695,7 +1695,7 @@ BaseType_t xReturn = pdFALSE;
static void prvCopyDataFromQueue( Queue_t * const pxQueue, void * const pvBuffer ) static void prvCopyDataFromQueue( Queue_t * const pxQueue, void * const pvBuffer )
{ {
if( pxQueue->uxItemSize != 0 ) if( pxQueue->uxItemSize != ( UBaseType_t ) 0 )
{ {
pxQueue->u.pcReadFrom += pxQueue->uxItemSize; pxQueue->u.pcReadFrom += pxQueue->uxItemSize;
if( pxQueue->u.pcReadFrom >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */ if( pxQueue->u.pcReadFrom >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */

@ -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 /* A port optimised version is provided, call it only if the TCB being reset
is being referenced from a ready list. If it is referenced from a delayed is being referenced from a ready list. If it is referenced from a delayed
or suspended list then it won't be in a ready list. */ or suspended list then it won't be in a ready list. */
#define taskRESET_READY_PRIORITY( uxPriority ) \ #define taskRESET_READY_PRIORITY( uxPriority ) \
{ \ { \
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == 0 ) \ if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == ( UBaseType_t ) 0 ) \
{ \ { \
portRESET_READY_PRIORITY( ( uxPriority ), ( uxTopReadyPriority ) ); \ portRESET_READY_PRIORITY( ( uxPriority ), ( uxTopReadyPriority ) ); \
} \ } \
} }
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */ #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
@ -1000,7 +1000,7 @@ TCB_t * pxNewTCB;
} }
return eReturn; return eReturn;
} } /*lint !e818 xTask cannot be a pointer to const because it is a typedef. */
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -1728,7 +1728,7 @@ UBaseType_t uxTaskGetNumberOfTasks( void )
#if ( INCLUDE_pcTaskGetTaskName == 1 ) #if ( INCLUDE_pcTaskGetTaskName == 1 )
char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
{ {
TCB_t *pxTCB; TCB_t *pxTCB;
@ -3039,13 +3039,13 @@ TCB_t *pxNewTCB;
{ {
uint32_t ulCount = 0U; uint32_t ulCount = 0U;
while( *pucStackByte == tskSTACK_FILL_BYTE ) while( *pucStackByte == ( uint8_t ) tskSTACK_FILL_BYTE )
{ {
pucStackByte -= portSTACK_GROWTH; pucStackByte -= portSTACK_GROWTH;
ulCount++; ulCount++;
} }
ulCount /= ( uint32_t ) sizeof( StackType_t ); ulCount /= ( uint32_t ) sizeof( StackType_t ); /*lint !e961 Casting is not redundant on smaller architectures. */
return ( uint16_t ) ulCount; return ( uint16_t ) ulCount;
} }
@ -3252,7 +3252,7 @@ TCB_t *pxTCB;
if( pxTCB->uxPriority != pxTCB->uxBasePriority ) if( pxTCB->uxPriority != pxTCB->uxBasePriority )
{ {
/* Only disinherit if no other mutexes are held. */ /* Only disinherit if no other mutexes are held. */
if( pxTCB->uxMutexesHeld == 0 ) if( pxTCB->uxMutexesHeld == ( UBaseType_t ) 0 )
{ {
/* The holding task must be the running task to be able to give /* The holding task must be the running task to be able to give
the mutex back. Remove the holding task from the ready list. */ the mutex back. Remove the holding task from the ready list. */
@ -3587,9 +3587,9 @@ TickType_t uxReturn;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void *pvTaskIncrementMutexHeldCount( void ) #if ( configUSE_MUTEXES == 1 )
{
#if ( configUSE_MUTEXES == 1 ) void *pvTaskIncrementMutexHeldCount( void )
{ {
/* If xSemaphoreCreateMutex() is called before any tasks have been created /* If xSemaphoreCreateMutex() is called before any tasks have been created
then pxCurrentTCB will be NULL. */ then pxCurrentTCB will be NULL. */
@ -3600,8 +3600,9 @@ void *pvTaskIncrementMutexHeldCount( void )
return pxCurrentTCB; return pxCurrentTCB;
} }
#endif
} #endif /* configUSE_MUTEXES */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#ifdef FREERTOS_MODULE_TEST #ifdef FREERTOS_MODULE_TEST

@ -591,7 +591,7 @@ TickType_t xTimeNow;
{ {
/* Negative commands are pended function calls rather than timer /* Negative commands are pended function calls rather than timer
commands. */ commands. */
if( xMessage.xMessageID < 0 ) if( xMessage.xMessageID < ( BaseType_t ) 0 )
{ {
const CallbackParameters_t * const pxCallback = &( xMessage.u.xCallbackParameters ); const CallbackParameters_t * const pxCallback = &( xMessage.u.xCallbackParameters );
@ -843,7 +843,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2; xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;
xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken ); xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn ); tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
return xReturn; return xReturn;
@ -869,7 +869,7 @@ Timer_t * const pxTimer = ( Timer_t * ) xTimer;
xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait ); xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );
tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn ); tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
return xReturn; return xReturn;
} }

Loading…
Cancel
Save