mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 11:09:01 +01:00 
			
		
		
		
	Fix MISRA C 2012 Rule 10.4 Violations (#972)
Fixes for violations of MISRA rule 10.4
This commit is contained in:
		
							parent
							
								
									c19b13cdfc
								
							
						
					
					
						commit
						1065389c4e
					
				@ -92,16 +92,16 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Checks whether an external index is valid or not.
 | 
					 * @brief Checks whether an external index is valid or not.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
    #define IS_EXTERNAL_INDEX_VALID( lIndex ) \
 | 
					    #define IS_EXTERNAL_INDEX_VALID( lIndex )   \
 | 
				
			||||||
    ( ( ( lIndex ) >= INDEX_OFFSET ) &&       \
 | 
					    ( ( ( ( lIndex ) >= INDEX_OFFSET ) &&       \
 | 
				
			||||||
      ( ( lIndex ) < ( configPROTECTED_KERNEL_OBJECT_POOL_SIZE + INDEX_OFFSET ) ) )
 | 
					        ( ( lIndex ) < ( configPROTECTED_KERNEL_OBJECT_POOL_SIZE + INDEX_OFFSET ) ) ) ? pdTRUE : pdFALSE )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Checks whether an internal index is valid or not.
 | 
					 * @brief Checks whether an internal index is valid or not.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
    #define IS_INTERNAL_INDEX_VALID( lIndex ) \
 | 
					    #define IS_INTERNAL_INDEX_VALID( lIndex )   \
 | 
				
			||||||
    ( ( ( lIndex ) >= 0 ) &&                  \
 | 
					    ( ( ( ( lIndex ) >= 0 ) &&                  \
 | 
				
			||||||
      ( ( lIndex ) < ( configPROTECTED_KERNEL_OBJECT_POOL_SIZE ) ) )
 | 
					        ( ( lIndex ) < ( configPROTECTED_KERNEL_OBJECT_POOL_SIZE ) ) ) ? pdTRUE : pdFALSE )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Converts an internal index into external.
 | 
					 * @brief Converts an internal index into external.
 | 
				
			||||||
@ -2197,7 +2197,7 @@
 | 
				
			|||||||
                    if( ( !( ( pvItemToQueue == NULL ) && ( uxQueueItemSize != ( UBaseType_t ) 0U ) ) ) &&
 | 
					                    if( ( !( ( pvItemToQueue == NULL ) && ( uxQueueItemSize != ( UBaseType_t ) 0U ) ) ) &&
 | 
				
			||||||
                        ( !( ( xCopyPosition == queueOVERWRITE ) && ( uxQueueLength != ( UBaseType_t ) 1U ) ) )
 | 
					                        ( !( ( xCopyPosition == queueOVERWRITE ) && ( uxQueueLength != ( UBaseType_t ) 1U ) ) )
 | 
				
			||||||
                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
					                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
				
			||||||
                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) )
 | 
					                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0U ) ) )
 | 
				
			||||||
                        #endif
 | 
					                        #endif
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
@ -2312,7 +2312,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    if( ( !( ( ( pvBuffer ) == NULL ) && ( uxQueueItemSize != ( UBaseType_t ) 0U ) ) )
 | 
					                    if( ( !( ( ( pvBuffer ) == NULL ) && ( uxQueueItemSize != ( UBaseType_t ) 0U ) ) )
 | 
				
			||||||
                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
					                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
				
			||||||
                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) )
 | 
					                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0U ) ) )
 | 
				
			||||||
                        #endif
 | 
					                        #endif
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
@ -2364,7 +2364,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    if( ( !( ( ( pvBuffer ) == NULL ) && ( uxQueueItemSize != ( UBaseType_t ) 0U ) ) )
 | 
					                    if( ( !( ( ( pvBuffer ) == NULL ) && ( uxQueueItemSize != ( UBaseType_t ) 0U ) ) )
 | 
				
			||||||
                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
					                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
				
			||||||
                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) )
 | 
					                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0U ) ) )
 | 
				
			||||||
                        #endif
 | 
					                        #endif
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
@ -2411,9 +2411,9 @@
 | 
				
			|||||||
                {
 | 
					                {
 | 
				
			||||||
                    uxQueueItemSize = uxQueueGetQueueItemSize( xInternalQueueHandle );
 | 
					                    uxQueueItemSize = uxQueueGetQueueItemSize( xInternalQueueHandle );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if( ( uxQueueItemSize == 0 )
 | 
					                    if( ( uxQueueItemSize == 0U )
 | 
				
			||||||
                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
					                        #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
				
			||||||
                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) )
 | 
					                            && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0U ) ) )
 | 
				
			||||||
                        #endif
 | 
					                        #endif
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
@ -3906,10 +3906,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if( xAreParamsReadable == pdTRUE )
 | 
					        if( xAreParamsReadable == pdTRUE )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if( ( ( pxParams->uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 ) &&
 | 
					            if( ( ( pxParams->uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0U ) &&
 | 
				
			||||||
                ( pxParams->uxBitsToWaitFor != 0 )
 | 
					                ( pxParams->uxBitsToWaitFor != 0U )
 | 
				
			||||||
                #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
					                #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
				
			||||||
                    && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( pxParams->xTicksToWait != 0 ) ) )
 | 
					                    && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( pxParams->xTicksToWait != 0U ) ) )
 | 
				
			||||||
                #endif
 | 
					                #endif
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -3951,7 +3951,7 @@
 | 
				
			|||||||
        int32_t lIndex;
 | 
					        int32_t lIndex;
 | 
				
			||||||
        BaseType_t xCallingTaskIsAuthorizedToAccessEventGroup = pdFALSE;
 | 
					        BaseType_t xCallingTaskIsAuthorizedToAccessEventGroup = pdFALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 )
 | 
					        if( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0U )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            lIndex = ( int32_t ) xEventGroup;
 | 
					            lIndex = ( int32_t ) xEventGroup;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -3986,7 +3986,7 @@
 | 
				
			|||||||
        int32_t lIndex;
 | 
					        int32_t lIndex;
 | 
				
			||||||
        BaseType_t xCallingTaskIsAuthorizedToAccessEventGroup = pdFALSE;
 | 
					        BaseType_t xCallingTaskIsAuthorizedToAccessEventGroup = pdFALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 )
 | 
					        if( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0U )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            lIndex = ( int32_t ) xEventGroup;
 | 
					            lIndex = ( int32_t ) xEventGroup;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -4025,10 +4025,10 @@
 | 
				
			|||||||
        int32_t lIndex;
 | 
					        int32_t lIndex;
 | 
				
			||||||
        BaseType_t xCallingTaskIsAuthorizedToAccessEventGroup = pdFALSE;
 | 
					        BaseType_t xCallingTaskIsAuthorizedToAccessEventGroup = pdFALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if( ( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 ) &&
 | 
					        if( ( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0U ) &&
 | 
				
			||||||
            ( uxBitsToWaitFor != 0 )
 | 
					            ( uxBitsToWaitFor != 0U )
 | 
				
			||||||
            #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
					            #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
 | 
				
			||||||
                && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) )
 | 
					                && ( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0U ) ) )
 | 
				
			||||||
            #endif
 | 
					            #endif
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user