]> git.sur5r.net Git - freertos/blobdiff - Source/tasks.c
Explicit casting added to the 'check for time out' function to ensure integer promoti...
[freertos] / Source / tasks.c
index 8016a54b294bb11771323c13f2adb31c3d7bfc29..f59a0ea03a20726e94b0b6025fd2c489fdaee574 100644 (file)
@@ -3,14 +3,14 @@
 \r
        This file is part of the FreeRTOS distribution.\r
 \r
-       FreeRTOS is free software; you can redistribute it and/or modify it     under \r
-       the terms of the GNU General Public License (version 2) as published by the \r
+       FreeRTOS is free software; you can redistribute it and/or modify it     under\r
+       the terms of the GNU General Public License (version 2) as published by the\r
        Free Software Foundation and modified by the FreeRTOS exception.\r
        **NOTE** The exception to the GPL is included to allow you to distribute a\r
-       combined work that includes FreeRTOS without being obliged to provide the \r
-       source code for proprietary components outside of the FreeRTOS kernel.  \r
-       Alternative commercial license and support terms are also available upon \r
-       request.  See the licensing section of http://www.FreeRTOS.org for full \r
+       combined work that includes FreeRTOS without being obliged to provide the\r
+       source code for proprietary components outside of the FreeRTOS kernel.\r
+       Alternative commercial license and support terms are also available upon\r
+       request.  See the licensing section of http://www.FreeRTOS.org for full\r
        license details.\r
 \r
        FreeRTOS is distributed in the hope that it will be useful,     but WITHOUT\r
@@ -387,7 +387,7 @@ tskTCB * pxNewTCB;
                required by the port. */\r
                #if portSTACK_GROWTH < 0\r
                {\r
-                       pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 ) - ( ( usStackDepth - 1 ) % portBYTE_ALIGNMENT );                        \r
+                       pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - 1 ) - ( ( usStackDepth - 1 ) % portBYTE_ALIGNMENT );\r
                }\r
                #else\r
                {\r
@@ -528,8 +528,8 @@ tskTCB * pxNewTCB;
                        /* Increment the uxTaskNumberVariable also so kernel aware debuggers\r
                        can detect that the task lists need re-generating. */\r
                        uxTaskNumber++;\r
-                       \r
-                       traceTASK_DELETE( pxTCB );                      \r
+\r
+                       traceTASK_DELETE( pxTCB );\r
                }\r
                taskEXIT_CRITICAL();\r
 \r
@@ -1469,7 +1469,7 @@ void vTaskIncrementTick( void )
                portENTER_CRITICAL();\r
                        xReturn = xTCB->pxTaskTag;\r
                portEXIT_CRITICAL();\r
-               \r
+\r
                return xReturn;\r
        }\r
 \r
@@ -1693,7 +1693,7 @@ portBASE_TYPE xReturn;
                        else /* We are not blocking indefinitely, perform the checks below. */\r
                #endif\r
 \r
-               if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( xTickCount >= pxTimeOut->xTimeOnEntering ) )\r
+               if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( ( portTickType ) xTickCount >= ( portTickType ) pxTimeOut->xTimeOnEntering ) )\r
                {\r
                        /* The tick count is greater than the time at which vTaskSetTimeout()\r
                        was called, but has also overflowed since vTaskSetTimeOut() was called.\r
@@ -1701,10 +1701,10 @@ portBASE_TYPE xReturn;
                        passed since vTaskSetTimeout() was called. */\r
                        xReturn = pdTRUE;\r
                }\r
-               else if( ( xTickCount - pxTimeOut->xTimeOnEntering ) < *pxTicksToWait )\r
+               else if( ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) < ( portTickType ) *pxTicksToWait )\r
                {\r
                        /* Not a genuine timeout. Adjust parameters for time remaining. */\r
-                       *pxTicksToWait -= ( xTickCount - pxTimeOut->xTimeOnEntering );\r
+                       *pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );\r
                        vTaskSetTimeOutState( pxTimeOut );\r
                        xReturn = pdFALSE;\r
                }\r