Skip to content

Revert "Fix MISRA C 2012 Rule 13.3 Violations" #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions include/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ typedef struct xLIST
} \
\
( pxItemToRemove )->pxContainer = NULL; \
( ( pxList )->uxNumberOfItems ) -= ( UBaseType_t ) 1U; \
( pxList->uxNumberOfItems )--; \
} while( 0 )

/*
Expand Down Expand Up @@ -371,17 +371,17 @@ typedef struct xLIST
\
/* Insert a new list item into ( pxList ), but rather than sort the list, \
* makes the new list item the last item to be removed by a call to \
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
( pxNewListItem )->pxNext = pxIndex; \
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
\
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
pxIndex->pxPrevious = ( pxNewListItem ); \
\
/* Remember which list the item is in. */ \
( pxNewListItem )->pxContainer = ( pxList ); \
\
( ( pxList )->uxNumberOfItems ) += ( UBaseType_t ) 1U; \
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
( pxNewListItem )->pxNext = pxIndex; \
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
\
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
pxIndex->pxPrevious = ( pxNewListItem ); \
\
/* Remember which list the item is in. */ \
( pxNewListItem )->pxContainer = ( pxList ); \
\
( ( pxList )->uxNumberOfItems )++; \
} while( 0 )

/*
Expand Down
9 changes: 5 additions & 4 deletions list.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void vListInsertEnd( List_t * const pxList,
/* Remember which list the item is in. */
pxNewListItem->pxContainer = pxList;

( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
( pxList->uxNumberOfItems )++;

traceRETURN_vListInsertEnd();
}
Expand Down Expand Up @@ -205,13 +205,12 @@ void vListInsert( List_t * const pxList,
* item later. */
pxNewListItem->pxContainer = pxList;

( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
( pxList->uxNumberOfItems )++;

traceRETURN_vListInsert();
}
/*-----------------------------------------------------------*/


UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
{
/* The list item knows which list it is in. Obtain the list from the list
Expand All @@ -220,6 +219,8 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )

traceENTER_uxListRemove( pxItemToRemove );



pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;

Expand All @@ -237,7 +238,7 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
}

pxItemToRemove->pxContainer = NULL;
( pxList->uxNumberOfItems ) -= ( UBaseType_t ) 1U;
( pxList->uxNumberOfItems )--;

traceRETURN_uxListRemove( pxList->uxNumberOfItems );

Expand Down
10 changes: 5 additions & 5 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
pxTemp = pxDelayedTaskList; \
pxDelayedTaskList = pxOverflowDelayedTaskList; \
pxOverflowDelayedTaskList = pxTemp; \
xNumOfOverflows += ( BaseType_t ) 1; \
xNumOfOverflows++; \
prvResetNextTaskUnblockTime(); \
} while( 0 )

Expand Down Expand Up @@ -2021,7 +2021,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
* updated. */
taskENTER_CRITICAL();
{
uxCurrentNumberOfTasks += ( UBaseType_t ) 1U;
uxCurrentNumberOfTasks++;

if( pxCurrentTCB == NULL )
{
Expand Down Expand Up @@ -3815,7 +3815,7 @@ void vTaskSuspendAll( void )

/* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
* is used to allow calls to vTaskSuspendAll() to nest. */
uxSchedulerSuspended += ( UBaseType_t ) 1U;
++uxSchedulerSuspended;

/* Enforces ordering for ports and optimised compilers that may otherwise place
* the above increment elsewhere. */
Expand Down Expand Up @@ -3968,7 +3968,7 @@ BaseType_t xTaskResumeAll( void )
* previous call to vTaskSuspendAll(). */
configASSERT( uxSchedulerSuspended != 0U );

uxSchedulerSuspended -= ( UBaseType_t ) 1U;
--uxSchedulerSuspended;
portRELEASE_TASK_LOCK();

if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
Expand Down Expand Up @@ -4893,7 +4893,7 @@ BaseType_t xTaskIncrementTick( void )
}
else
{
xPendedTicks += 1U;
++xPendedTicks;

/* The tick hook gets called at regular intervals, even if the
* scheduler is locked. */
Expand Down