mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 10:42:33 -05: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
					
				
					 1 changed files with 13 additions and 13 deletions
				
			
		| 
						 | 
					@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue