]> git.sur5r.net Git - freertos/blobdiff - Source/tasks.c
Remove unnecessary use of portLONG, portCHAR and portSHORT.
[freertos] / Source / tasks.c
index 306e60fa4e156e332ff29a80c43d4568019db43f..1005895cf97a06cb33d4e90162921654ae7a45c4 100644 (file)
@@ -84,7 +84,7 @@ typedef struct tskTaskControlBlock
        xListItem                               xEventListItem;         /*< List item used to place the TCB in event lists. */\r
        unsigned portBASE_TYPE  uxPriority;                     /*< The priority of the task where 0 is the lowest priority. */\r
        portSTACK_TYPE                  *pxStack;                       /*< Points to the start of the stack. */\r
-       signed portCHAR                 pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created.  Facilitates debugging only. */\r
+       signed char                             pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created.  Facilitates debugging only. */\r
 \r
        #if ( portSTACK_GROWTH > 0 )\r
                portSTACK_TYPE *pxEndOfStack;                   /*< Used for stack overflow checking on architectures where the stack grows up from low memory. */\r
@@ -107,7 +107,7 @@ typedef struct tskTaskControlBlock
        #endif\r
 \r
        #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
-               unsigned portLONG ulRunTimeCounter;             /*< Used for calculating how much CPU time each task is utilising. */\r
+               unsigned long ulRunTimeCounter;         /*< Used for calculating how much CPU time each task is utilising. */\r
        #endif\r
 \r
 } tskTCB;\r
@@ -160,9 +160,9 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber                                          = ( unsigned po
 \r
 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
 \r
-       PRIVILEGED_DATA static portCHAR pcStatsString[ 50 ] ;\r
-       PRIVILEGED_DATA static unsigned portLONG ulTaskSwitchedInTime = 0UL;    /*< Holds the value of a timer/counter the last time a task was switched in. */\r
-       static void prvGenerateRunTimeStatsForTasksInList( const signed portCHAR *pcWriteBuffer, xList *pxList, unsigned portLONG ulTotalRunTime ) PRIVILEGED_FUNCTION;\r
+       PRIVILEGED_DATA static char pcStatsString[ 50 ] ;\r
+       PRIVILEGED_DATA static unsigned long ulTaskSwitchedInTime = 0UL;        /*< Holds the value of a timer/counter the last time a task was switched in. */\r
+       static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTime ) PRIVILEGED_FUNCTION;\r
 \r
 #endif\r
 \r
@@ -177,23 +177,23 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber                                                = ( unsigned po
 /*\r
  * Macros used by vListTask to indicate which state a task is in.\r
  */\r
-#define tskBLOCKED_CHAR                ( ( signed portCHAR ) 'B' )\r
-#define tskREADY_CHAR          ( ( signed portCHAR ) 'R' )\r
-#define tskDELETED_CHAR                ( ( signed portCHAR ) 'D' )\r
-#define tskSUSPENDED_CHAR      ( ( signed portCHAR ) 'S' )\r
+#define tskBLOCKED_CHAR                ( ( signed char ) 'B' )\r
+#define tskREADY_CHAR          ( ( signed char ) 'R' )\r
+#define tskDELETED_CHAR                ( ( signed char ) 'D' )\r
+#define tskSUSPENDED_CHAR      ( ( signed char ) 'S' )\r
 \r
 /*\r
  * Macros and private variables used by the trace facility.\r
  */\r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
 \r
-       #define tskSIZE_OF_EACH_TRACE_LINE                      ( ( unsigned portLONG ) ( sizeof( unsigned portLONG ) + sizeof( unsigned portLONG ) ) )\r
-       PRIVILEGED_DATA static volatile signed portCHAR * volatile pcTraceBuffer;\r
-       PRIVILEGED_DATA static signed portCHAR *pcTraceBufferStart;\r
-       PRIVILEGED_DATA static signed portCHAR *pcTraceBufferEnd;\r
+       #define tskSIZE_OF_EACH_TRACE_LINE                      ( ( unsigned long ) ( sizeof( unsigned long ) + sizeof( unsigned long ) ) )\r
+       PRIVILEGED_DATA static volatile signed char * volatile pcTraceBuffer;\r
+       PRIVILEGED_DATA static signed char *pcTraceBufferStart;\r
+       PRIVILEGED_DATA static signed char *pcTraceBufferEnd;\r
        PRIVILEGED_DATA static signed portBASE_TYPE xTracing = pdFALSE;\r
        static unsigned portBASE_TYPE uxPreviousTask = 255;\r
-       PRIVILEGED_DATA static portCHAR pcStatusString[ 50 ];\r
+       PRIVILEGED_DATA static char pcStatusString[ 50 ];\r
 \r
 #endif\r
 \r
@@ -216,10 +216,10 @@ PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber                                                = ( unsigned po
                                if( ( pcTraceBuffer + tskSIZE_OF_EACH_TRACE_LINE ) < pcTraceBufferEnd )                         \\r
                                {                                                                                                                                                                       \\r
                                        uxPreviousTask = pxCurrentTCB->uxTCBNumber;                                                                             \\r
-                                       *( unsigned portLONG * ) pcTraceBuffer = ( unsigned portLONG ) xTickCount;              \\r
-                                       pcTraceBuffer += sizeof( unsigned portLONG );                                                                   \\r
-                                       *( unsigned portLONG * ) pcTraceBuffer = ( unsigned portLONG ) uxPreviousTask;  \\r
-                                       pcTraceBuffer += sizeof( unsigned portLONG );                                                                   \\r
+                                       *( unsigned long * ) pcTraceBuffer = ( unsigned long ) xTickCount;              \\r
+                                       pcTraceBuffer += sizeof( unsigned long );                                                                       \\r
+                                       *( unsigned long * ) pcTraceBuffer = ( unsigned long ) uxPreviousTask;  \\r
+                                       pcTraceBuffer += sizeof( unsigned long );                                                                       \\r
                                }                                                                                                                                                                       \\r
                                else                                                                                                                                                            \\r
                                {                                                                                                                                                                       \\r
@@ -297,7 +297,7 @@ register tskTCB *pxTCB;                                                                                                                                                                                             \
  * Utility to ready a TCB for a given task.  Mainly just copies the parameters\r
  * into the TCB structure.\r
  */\r
-static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed portCHAR * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned portSHORT usStackDepth ) PRIVILEGED_FUNCTION;\r
+static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed char * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Utility to ready all the lists used by the scheduler.  This is called\r
@@ -342,7 +342,7 @@ static void prvCheckTasksWaitingTermination( void ) PRIVILEGED_FUNCTION;
  * Allocates memory from the heap for a TCB and associated stack.  Checks the\r
  * allocation was successful.\r
  */\r
-static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTACK_TYPE *puxStackBuffer ) PRIVILEGED_FUNCTION;\r
+static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Called from vTaskList.  vListTasks details all the tasks currently under\r
@@ -355,7 +355,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC
  */\r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
 \r
-       static void prvListTaskWithinSingleList( const signed portCHAR *pcWriteBuffer, xList *pxList, signed portCHAR cStatus ) PRIVILEGED_FUNCTION;\r
+       static void prvListTaskWithinSingleList( const signed char *pcWriteBuffer, xList *pxList, signed char cStatus ) PRIVILEGED_FUNCTION;\r
 \r
 #endif\r
 \r
@@ -366,7 +366,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC
  */\r
 #if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )\r
 \r
-       static unsigned portSHORT usTaskCheckFreeStackSpace( const unsigned portCHAR * pucStackByte ) PRIVILEGED_FUNCTION;\r
+       static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte ) PRIVILEGED_FUNCTION;\r
 \r
 #endif\r
 \r
@@ -379,7 +379,7 @@ static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTAC
  * TASK CREATION API documented in task.h\r
  *----------------------------------------------------------*/\r
 \r
-signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions )\r
+signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions )\r
 {\r
 signed portBASE_TYPE xReturn;\r
 tskTCB * pxNewTCB;\r
@@ -411,7 +411,7 @@ portBASE_TYPE xRunPrivileged;
                #if( portSTACK_GROWTH < 0 )\r
                {\r
                        pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 );\r
-                       pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( unsigned portLONG ) pxTopOfStack ) & ( ( unsigned portLONG ) ~portBYTE_ALIGNMENT_MASK  ) );\r
+                       pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( unsigned long ) pxTopOfStack ) & ( ( unsigned long ) ~portBYTE_ALIGNMENT_MASK  ) );\r
                }\r
                #else\r
                {\r
@@ -1017,7 +1017,7 @@ void vTaskStartScheduler( void )
 portBASE_TYPE xReturn;\r
 \r
        /* Add the idle task at the lowest priority. */\r
-       xReturn = xTaskCreate( prvIdleTask, ( signed portCHAR * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), ( xTaskHandle * ) NULL );\r
+       xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), ( xTaskHandle * ) NULL );\r
 \r
        if( xReturn == pdPASS )\r
        {\r
@@ -1180,7 +1180,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
 \r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
 \r
-       void vTaskList( signed portCHAR *pcWriteBuffer )\r
+       void vTaskList( signed char *pcWriteBuffer )\r
        {\r
        unsigned portBASE_TYPE uxQueue;\r
 \r
@@ -1192,8 +1192,8 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
                        /* Run through all the lists that could potentially contain a TCB and\r
                        report the task name, state and stack high water mark. */\r
 \r
-                       pcWriteBuffer[ 0 ] = ( signed portCHAR ) 0x00;\r
-                       strcat( ( portCHAR * ) pcWriteBuffer, ( const portCHAR * ) "\r\n" );\r
+                       pcWriteBuffer[ 0 ] = ( signed char ) 0x00;\r
+                       strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" );\r
 \r
                        uxQueue = uxTopUsedPriority + 1;\r
 \r
@@ -1205,7 +1205,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
                                {\r
                                        prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), tskREADY_CHAR );\r
                                }\r
-                       }while( uxQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY );\r
+                       }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );\r
 \r
                        if( !listLIST_IS_EMPTY( pxDelayedTaskList ) )\r
                        {\r
@@ -1243,10 +1243,10 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
 \r
 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
 \r
-       void vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer )\r
+       void vTaskGetRunTimeStats( signed char *pcWriteBuffer )\r
        {\r
        unsigned portBASE_TYPE uxQueue;\r
-       unsigned portLONG ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();\r
+       unsigned long ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();\r
 \r
                /* This is a VERY costly function that should be used for debug only.\r
                It leaves interrupts disabled for a LONG time. */\r
@@ -1257,8 +1257,8 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
                        generating a table of run timer percentages in the provided\r
                        buffer. */\r
 \r
-                       pcWriteBuffer[ 0 ] = ( signed portCHAR ) 0x00;\r
-                       strcat( ( portCHAR * ) pcWriteBuffer, ( const portCHAR * ) "\r\n" );\r
+                       pcWriteBuffer[ 0 ] = ( signed char ) 0x00;\r
+                       strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" );\r
 \r
                        uxQueue = uxTopUsedPriority + 1;\r
 \r
@@ -1270,7 +1270,7 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
                                {\r
                                        prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), ulTotalRunTime );\r
                                }\r
-                       }while( uxQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY );\r
+                       }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );\r
 \r
                        if( !listLIST_IS_EMPTY( pxDelayedTaskList ) )\r
                        {\r
@@ -1308,11 +1308,11 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
 \r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
 \r
-       void vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize )\r
+       void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize )\r
        {\r
                portENTER_CRITICAL();\r
                {\r
-                       pcTraceBuffer = ( signed portCHAR * )pcBuffer;\r
+                       pcTraceBuffer = ( signed char * )pcBuffer;\r
                        pcTraceBufferStart = pcBuffer;\r
                        pcTraceBufferEnd = pcBuffer + ( ulBufferSize - tskSIZE_OF_EACH_TRACE_LINE );\r
                        xTracing = pdTRUE;\r
@@ -1325,15 +1325,15 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
 \r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
 \r
-       unsigned portLONG ulTaskEndTrace( void )\r
+       unsigned long ulTaskEndTrace( void )\r
        {\r
-       unsigned portLONG ulBufferLength;\r
+       unsigned long ulBufferLength;\r
 \r
                portENTER_CRITICAL();\r
                        xTracing = pdFALSE;\r
                portEXIT_CRITICAL();\r
 \r
-               ulBufferLength = ( unsigned portLONG ) ( pcTraceBuffer - pcTraceBufferStart );\r
+               ulBufferLength = ( unsigned long ) ( pcTraceBuffer - pcTraceBufferStart );\r
 \r
                return ulBufferLength;\r
        }\r
@@ -1408,10 +1408,10 @@ void vTaskIncrementTick( void )
 \r
        void vTaskCleanUpResources( void )\r
        {\r
-       unsigned portSHORT usQueue;\r
+       unsigned short usQueue;\r
        volatile tskTCB *pxTCB;\r
 \r
-               usQueue = ( unsigned portSHORT ) uxTopUsedPriority + ( unsigned portSHORT ) 1;\r
+               usQueue = ( unsigned short ) uxTopUsedPriority + ( unsigned short ) 1;\r
 \r
                /* Remove any TCB's from the ready queues. */\r
                do\r
@@ -1425,7 +1425,7 @@ void vTaskIncrementTick( void )
 \r
                                prvDeleteTCB( ( tskTCB * ) pxTCB );\r
                        }\r
-               }while( usQueue > ( unsigned portSHORT ) tskIDLE_PRIORITY );\r
+               }while( usQueue > ( unsigned short ) tskIDLE_PRIORITY );\r
 \r
                /* Remove any TCB's from the delayed queue. */\r
                while( !listLIST_IS_EMPTY( &xDelayedTaskList1 ) )\r
@@ -1558,7 +1558,7 @@ void vTaskSwitchContext( void )
 \r
        #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
        {\r
-               unsigned portLONG ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE();\r
+               unsigned long ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE();\r
 \r
                        /* Add the amount of time the task has been running to the accumulated\r
                        time so far.  The time the task started running was stored in\r
@@ -1836,16 +1836,16 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
 \r
 \r
 \r
-static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed portCHAR * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned portSHORT usStackDepth )\r
+static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed char * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned short usStackDepth )\r
 {\r
        /* Store the function name in the TCB. */\r
        #if configMAX_TASK_NAME_LEN > 1\r
        {\r
                /* Don't bring strncpy into the build unnecessarily. */\r
-               strncpy( ( char * ) pxTCB->pcTaskName, ( const char * ) pcName, ( unsigned portSHORT ) configMAX_TASK_NAME_LEN );\r
+               strncpy( ( char * ) pxTCB->pcTaskName, ( const char * ) pcName, ( unsigned short ) configMAX_TASK_NAME_LEN );\r
        }\r
        #endif\r
-       pxTCB->pcTaskName[ ( unsigned portSHORT ) configMAX_TASK_NAME_LEN - ( unsigned portSHORT ) 1 ] = '\0';\r
+       pxTCB->pcTaskName[ ( unsigned short ) configMAX_TASK_NAME_LEN - ( unsigned short ) 1 ] = '\0';\r
 \r
        /* This is used as an array index so must ensure it's not too large.  First\r
        remove the privilege bit if one is present. */\r
@@ -1989,7 +1989,7 @@ static void prvCheckTasksWaitingTermination( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static tskTCB *prvAllocateTCBAndStack( unsigned portSHORT usStackDepth, portSTACK_TYPE *puxStackBuffer )\r
+static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer )\r
 {\r
 tskTCB *pxNewTCB;\r
 \r
@@ -2023,19 +2023,19 @@ tskTCB *pxNewTCB;
 \r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
 \r
-       static void prvListTaskWithinSingleList( const signed portCHAR *pcWriteBuffer, xList *pxList, signed portCHAR cStatus )\r
+       static void prvListTaskWithinSingleList( const signed char *pcWriteBuffer, xList *pxList, signed char cStatus )\r
        {\r
        volatile tskTCB *pxNextTCB, *pxFirstTCB;\r
-       unsigned portSHORT usStackRemaining;\r
+       unsigned short usStackRemaining;\r
 \r
                /* Write the details of all the TCB's in pxList into the buffer. */\r
                listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );\r
                do\r
                {\r
                        listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );\r
-                       usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned portCHAR * ) pxNextTCB->pxStack );\r
-                       sprintf( pcStatusString, ( portCHAR * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );\r
-                       strcat( ( portCHAR * ) pcWriteBuffer, ( portCHAR * ) pcStatusString );\r
+                       usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );\r
+                       sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );\r
+                       strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );\r
 \r
                } while( pxNextTCB != pxFirstTCB );\r
        }\r
@@ -2045,10 +2045,10 @@ tskTCB *pxNewTCB;
 \r
 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
 \r
-       static void prvGenerateRunTimeStatsForTasksInList( const signed portCHAR *pcWriteBuffer, xList *pxList, unsigned portLONG ulTotalRunTime )\r
+       static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTime )\r
        {\r
        volatile tskTCB *pxNextTCB, *pxFirstTCB;\r
-       unsigned portLONG ulStatsAsPercentage;\r
+       unsigned long ulStatsAsPercentage;\r
 \r
                /* Write the run time stats of all the TCB's in pxList into the buffer. */\r
                listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );\r
@@ -2064,7 +2064,7 @@ tskTCB *pxNewTCB;
                                if( pxNextTCB->ulRunTimeCounter == 0 )\r
                                {\r
                                        /* The task has used no CPU time at all. */\r
-                                       sprintf( pcStatsString, ( portCHAR * ) "%s\t\t0\t\t0%%\r\n", pxNextTCB->pcTaskName );\r
+                                       sprintf( pcStatsString, ( char * ) "%s\t\t0\t\t0%%\r\n", pxNextTCB->pcTaskName );\r
                                }\r
                                else\r
                                {\r
@@ -2074,17 +2074,17 @@ tskTCB *pxNewTCB;
 \r
                                        if( ulStatsAsPercentage > 0UL )\r
                                        {\r
-                                               sprintf( pcStatsString, ( portCHAR * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );\r
+                                               sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );\r
                                        }\r
                                        else\r
                                        {\r
                                                /* If the percentage is zero here then the task has\r
                                                consumed less than 1% of the total run time. */\r
-                                               sprintf( pcStatsString, ( portCHAR * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter );\r
+                                               sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter );\r
                                        }\r
                                }\r
 \r
-                               strcat( ( portCHAR * ) pcWriteBuffer, ( portCHAR * ) pcStatsString );\r
+                               strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatsString );\r
                        }\r
 \r
                } while( pxNextTCB != pxFirstTCB );\r
@@ -2095,9 +2095,9 @@ tskTCB *pxNewTCB;
 \r
 #if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )\r
 \r
-       static unsigned portSHORT usTaskCheckFreeStackSpace( const unsigned portCHAR * pucStackByte )\r
+       static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte )\r
        {\r
-       register unsigned portSHORT usCount = 0;\r
+       register unsigned short usCount = 0;\r
 \r
                while( *pucStackByte == tskSTACK_FILL_BYTE )\r
                {\r
@@ -2118,18 +2118,18 @@ tskTCB *pxNewTCB;
        unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask )\r
        {\r
        tskTCB *pxTCB;\r
-       unsigned portCHAR *pcEndOfStack;\r
+       unsigned char *pcEndOfStack;\r
        unsigned portBASE_TYPE uxReturn;\r
 \r
                pxTCB = prvGetTCBFromHandle( xTask );\r
 \r
                #if portSTACK_GROWTH < 0\r
                {\r
-                       pcEndOfStack = ( unsigned portCHAR * ) pxTCB->pxStack;\r
+                       pcEndOfStack = ( unsigned char * ) pxTCB->pxStack;\r
                }\r
                #else\r
                {\r
-                       pcEndOfStack = ( unsigned portCHAR * ) pxTCB->pxEndOfStack;\r
+                       pcEndOfStack = ( unsigned char * ) pxTCB->pxEndOfStack;\r
                }\r
                #endif\r
 \r