mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Explicit casting added to the 'check for time out' function to ensure integer promotion does not occur.
This commit is contained in:
parent
af6c245366
commit
87eb48c97c
|
@ -1693,7 +1693,7 @@ portBASE_TYPE xReturn;
|
||||||
else /* We are not blocking indefinitely, perform the checks below. */
|
else /* We are not blocking indefinitely, perform the checks below. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( xTickCount >= pxTimeOut->xTimeOnEntering ) )
|
if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( ( portTickType ) xTickCount >= ( portTickType ) pxTimeOut->xTimeOnEntering ) )
|
||||||
{
|
{
|
||||||
/* The tick count is greater than the time at which vTaskSetTimeout()
|
/* The tick count is greater than the time at which vTaskSetTimeout()
|
||||||
was called, but has also overflowed since vTaskSetTimeOut() was called.
|
was called, but has also overflowed since vTaskSetTimeOut() was called.
|
||||||
|
@ -1701,10 +1701,10 @@ portBASE_TYPE xReturn;
|
||||||
passed since vTaskSetTimeout() was called. */
|
passed since vTaskSetTimeout() was called. */
|
||||||
xReturn = pdTRUE;
|
xReturn = pdTRUE;
|
||||||
}
|
}
|
||||||
else if( ( xTickCount - pxTimeOut->xTimeOnEntering ) < *pxTicksToWait )
|
else if( ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) < ( portTickType ) *pxTicksToWait )
|
||||||
{
|
{
|
||||||
/* Not a genuine timeout. Adjust parameters for time remaining. */
|
/* Not a genuine timeout. Adjust parameters for time remaining. */
|
||||||
*pxTicksToWait -= ( xTickCount - pxTimeOut->xTimeOnEntering );
|
*pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );
|
||||||
vTaskSetTimeOutState( pxTimeOut );
|
vTaskSetTimeOutState( pxTimeOut );
|
||||||
xReturn = pdFALSE;
|
xReturn = pdFALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue