From b6d2b739f3a1561e3a6e111650257bc5d40dc461 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Sat, 1 Dec 2007 20:56:44 +0000 Subject: [PATCH] Ensure warning free compilation under GCC. --- Demo/Common/Minimal/GenQTest.c | 10 ++++++---- Demo/Common/Minimal/QPeek.c | 8 ++++---- Demo/Common/Minimal/blocktim.c | 4 ++++ Demo/Common/Minimal/countsem.c | 4 ++-- Source/include/FreeRTOS.h | 8 ++++---- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Demo/Common/Minimal/GenQTest.c b/Demo/Common/Minimal/GenQTest.c index 1f8eac5d77..906fea42c5 100644 --- a/Demo/Common/Minimal/GenQTest.c +++ b/Demo/Common/Minimal/GenQTest.c @@ -124,7 +124,7 @@ xSemaphoreHandle xMutex; /* Create the demo task and pass it the queue just created. We are passing the queue handle by value so it does not matter that it is declared on the stack here. */ - xTaskCreate( prvSendFrontAndBackTest, "GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL ); + xTaskCreate( prvSendFrontAndBackTest, ( signed portCHAR * )"GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL ); /* Create the mutex used by the prvMutexTest task. */ xMutex = xSemaphoreCreateMutex(); @@ -132,9 +132,9 @@ xSemaphoreHandle xMutex; /* Create the mutex demo tasks and pass it the mutex just created. We are passing the mutex handle by value so it does not matter that it is declared on the stack here. */ - xTaskCreate( prvLowPriorityMutexTask, "MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL ); - xTaskCreate( prvMediumPriorityMutexTask, "MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask ); - xTaskCreate( prvHighPriorityMutexTask, "MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask ); + xTaskCreate( prvLowPriorityMutexTask, ( signed portCHAR * )"MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL ); + xTaskCreate( prvMediumPriorityMutexTask, ( signed portCHAR * )"MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask ); + xTaskCreate( prvHighPriorityMutexTask, ( signed portCHAR * )"MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask ); } /*-----------------------------------------------------------*/ @@ -466,6 +466,8 @@ xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters; static void prvMediumPriorityMutexTask( void *pvParameters ) { + ( void ) pvParameters; + for( ;; ) { /* The medium priority task starts by suspending itself. The low diff --git a/Demo/Common/Minimal/QPeek.c b/Demo/Common/Minimal/QPeek.c index 41e40b3e68..45c5feb86a 100644 --- a/Demo/Common/Minimal/QPeek.c +++ b/Demo/Common/Minimal/QPeek.c @@ -97,10 +97,10 @@ xQueueHandle xQueue; /* Create the demo tasks and pass it the queue just created. We are passing the queue handle by value so it does not matter that it is declared on the stack here. */ - xTaskCreate( prvLowPriorityPeekTask, "PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL ); - xTaskCreate( prvMediumPriorityPeekTask, "PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask ); - xTaskCreate( prvHighPriorityPeekTask, "PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask ); - xTaskCreate( prvHighestPriorityPeekTask, "PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask ); + xTaskCreate( prvLowPriorityPeekTask, ( signed portCHAR * )"PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL ); + xTaskCreate( prvMediumPriorityPeekTask, ( signed portCHAR * )"PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask ); + xTaskCreate( prvHighPriorityPeekTask, ( signed portCHAR * )"PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask ); + xTaskCreate( prvHighestPriorityPeekTask, ( signed portCHAR * )"PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask ); } /*-----------------------------------------------------------*/ diff --git a/Demo/Common/Minimal/blocktim.c b/Demo/Common/Minimal/blocktim.c index 0b369a8619..70166bc3b5 100644 --- a/Demo/Common/Minimal/blocktim.c +++ b/Demo/Common/Minimal/blocktim.c @@ -99,6 +99,8 @@ portBASE_TYPE xItem, xData; portTickType xTimeWhenBlocking; portTickType xTimeToBlock, xBlockedTime; + ( void ) pvParameters; + for( ;; ) { /********************************************************************* @@ -354,6 +356,8 @@ static void vSecondaryBlockTimeTestTask( void *pvParameters ) portTickType xTimeWhenBlocking, xBlockedTime; portBASE_TYPE xData; + ( void ) pvParameters; + for( ;; ) { /********************************************************************* diff --git a/Demo/Common/Minimal/countsem.c b/Demo/Common/Minimal/countsem.c index dab2c0dc21..4d6d1deb4f 100644 --- a/Demo/Common/Minimal/countsem.c +++ b/Demo/Common/Minimal/countsem.c @@ -130,8 +130,8 @@ void vStartCountingSemaphoreTasks( void ) if( ( xParameters[ 0 ].xSemaphore != NULL ) || ( xParameters[ 1 ].xSemaphore != NULL ) ) { /* Create the demo tasks, passing in the semaphore to use as the parameter. */ - xTaskCreate( prvCountingSemaphoreTask, "CNT1", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 0 ] ), tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvCountingSemaphoreTask, "CNT2", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 1 ] ), tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvCountingSemaphoreTask, ( signed portCHAR * ) "CNT1", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 0 ] ), tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvCountingSemaphoreTask, ( signed portCHAR * ) "CNT2", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 1 ] ), tskIDLE_PRIORITY, NULL ); } } /*-----------------------------------------------------------*/ diff --git a/Source/include/FreeRTOS.h b/Source/include/FreeRTOS.h index 35e4426e98..ea8b46ad4e 100644 --- a/Source/include/FreeRTOS.h +++ b/Source/include/FreeRTOS.h @@ -112,14 +112,14 @@ #error Missing definition: configUSE_16_BIT_TICKS should be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. #endif -#ifndef configUSE_MUTEXES - #define configUSE_MUTEXES 0 -#endif - #ifndef configUSE_COUNTING_SEMAPHORES #define configUSE_COUNTING_SEMAPHORES 0 #endif +#ifndef configUSE_MUTEXES + #define configUSE_MUTEXES 0 +#endif + #if ( configUSE_MUTEXES == 1 ) /* xTaskGetCurrentTaskHandle is used by the priority inheritance mechanism within the mutex implementation so must be available if mutexes are used. */