Skip to content

Commit c5a1fee

Browse files
cristiancristea00chinglee-iot
authored andcommitted
Added better pointer declaration readability (FreeRTOS#567)
* Add better pointer declaration readability I revised the declaration of single-line pointers by splitting it into multiple lines. Now, every pointer is declared (and initialized accordingly) on its own line. This refactoring should enhance readability and decrease the probability of error when a new pointer is added/removed or a current one has its initialization value modified. Signed-off-by: Cristian Cristea <[email protected]> * Remove unnecessary whitespace characters and lines It removes whitespace characters at the end of lines (empty or othwerwise) and clear lines at the end of the file (only one remains). It is an automatic operation done by git. Signed-off-by: Cristian Cristea <[email protected]> Signed-off-by: Cristian Cristea <[email protected]>
1 parent b595adf commit c5a1fee

File tree

20 files changed

+92
-55
lines changed

20 files changed

+92
-55
lines changed

event_groups.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
533533
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
534534
const EventBits_t uxBitsToSet )
535535
{
536-
ListItem_t * pxListItem, * pxNext;
536+
ListItem_t * pxListItem;
537+
ListItem_t * pxNext;
537538
ListItem_t const * pxListEnd;
538539
List_t const * pxList;
539540
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;

portable/ARMv8M/secure/heap/secure_heap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s
113113
/**
114114
* @brief Create a couple of list links to mark the start and end of the list.
115115
*/
116-
static BlockLink_t xStart, * pxEnd = NULL;
116+
static BlockLink_t xStart;
117+
static BlockLink_t * pxEnd = NULL;
117118

118119
/**
119120
* @brief Keeps track of the number of free bytes remaining, but says nothing
@@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
245246

246247
void * pvPortMalloc( size_t xWantedSize )
247248
{
248-
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
249+
BlockLink_t * pxBlock;
250+
BlockLink_t * pxPreviousBlock;
251+
BlockLink_t * pxNewBlockLink;
249252
void * pvReturn = NULL;
250253

251254
/* If this is the first call to malloc then the heap will require

portable/GCC/ARM_CM23/secure/secure_heap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s
113113
/**
114114
* @brief Create a couple of list links to mark the start and end of the list.
115115
*/
116-
static BlockLink_t xStart, * pxEnd = NULL;
116+
static BlockLink_t xStart;
117+
static BlockLink_t * pxEnd = NULL;
117118

118119
/**
119120
* @brief Keeps track of the number of free bytes remaining, but says nothing
@@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
245246

246247
void * pvPortMalloc( size_t xWantedSize )
247248
{
248-
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
249+
BlockLink_t * pxBlock;
250+
BlockLink_t * pxPreviousBlock;
251+
BlockLink_t * pxNewBlockLink;
249252
void * pvReturn = NULL;
250253

251254
/* If this is the first call to malloc then the heap will require

portable/GCC/ARM_CM33/secure/secure_heap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s
113113
/**
114114
* @brief Create a couple of list links to mark the start and end of the list.
115115
*/
116-
static BlockLink_t xStart, * pxEnd = NULL;
116+
static BlockLink_t xStart;
117+
static BlockLink_t * pxEnd = NULL;
117118

118119
/**
119120
* @brief Keeps track of the number of free bytes remaining, but says nothing
@@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
245246

246247
void * pvPortMalloc( size_t xWantedSize )
247248
{
248-
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
249+
BlockLink_t * pxBlock;
250+
BlockLink_t * pxPreviousBlock;
251+
BlockLink_t * pxNewBlockLink;
249252
void * pvReturn = NULL;
250253

251254
/* If this is the first call to malloc then the heap will require

portable/GCC/ARM_CM55/secure/secure_heap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s
113113
/**
114114
* @brief Create a couple of list links to mark the start and end of the list.
115115
*/
116-
static BlockLink_t xStart, * pxEnd = NULL;
116+
static BlockLink_t xStart;
117+
static BlockLink_t * pxEnd = NULL;
117118

118119
/**
119120
* @brief Keeps track of the number of free bytes remaining, but says nothing
@@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
245246

246247
void * pvPortMalloc( size_t xWantedSize )
247248
{
248-
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
249+
BlockLink_t * pxBlock;
250+
BlockLink_t * pxPreviousBlock;
251+
BlockLink_t * pxNewBlockLink;
249252
void * pvReturn = NULL;
250253

251254
/* If this is the first call to malloc then the heap will require

portable/GCC/ARM_CM85/secure/secure_heap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s
113113
/**
114114
* @brief Create a couple of list links to mark the start and end of the list.
115115
*/
116-
static BlockLink_t xStart, * pxEnd = NULL;
116+
static BlockLink_t xStart;
117+
static BlockLink_t * pxEnd = NULL;
117118

118119
/**
119120
* @brief Keeps track of the number of free bytes remaining, but says nothing
@@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
245246

246247
void * pvPortMalloc( size_t xWantedSize )
247248
{
248-
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
249+
BlockLink_t * pxBlock;
250+
BlockLink_t * pxPreviousBlock;
251+
BlockLink_t * pxNewBlockLink;
249252
void * pvReturn = NULL;
250253

251254
/* If this is the first call to malloc then the heap will require

portable/GCC/MicroBlaze/port.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static void prvSetupTimerInterrupt( void );
8888
*/
8989
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
9090
{
91-
extern void *_SDA2_BASE_, *_SDA_BASE_;
91+
extern void * _SDA2_BASE_;
92+
extern void * _SDA_BASE_;
9293
const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;
9394
const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_;
9495

@@ -327,8 +328,3 @@ uint32_t ulCSR;
327328
XTmrCtr_mSetControlStatusReg( XPAR_OPB_TIMER_1_BASEADDR, portCOUNTER_0, ulCSR );
328329
}
329330
/*-----------------------------------------------------------*/
330-
331-
332-
333-
334-

portable/GCC/MicroBlazeV8/port.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ the scheduler being commenced interrupts should not be enabled, so the critical
4848
nesting variable is initialised to a non-zero value. */
4949
#define portINITIAL_NESTING_VALUE ( 0xff )
5050

51-
/* The bit within the MSR register that enabled/disables interrupts and
51+
/* The bit within the MSR register that enabled/disables interrupts and
5252
exceptions respectively. */
5353
#define portMSR_IE ( 0x02U )
5454
#define portMSR_EE ( 0x100U )
@@ -106,7 +106,8 @@ static XIntc xInterruptControllerInstance;
106106
*/
107107
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
108108
{
109-
extern void *_SDA2_BASE_, *_SDA_BASE_;
109+
extern void * _SDA2_BASE_;
110+
extern void * _SDA_BASE_;
110111
const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;
111112
const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_;
112113

@@ -130,7 +131,7 @@ const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_;
130131
disabled. Each task will enable interrupts automatically when it enters
131132
the running state for the first time. */
132133
*pxTopOfStack = mfmsr() & ~portMSR_IE;
133-
134+
134135
#if( MICROBLAZE_EXCEPTIONS_ENABLED == 1 )
135136
{
136137
/* Ensure exceptions are enabled for the task. */
@@ -449,5 +450,3 @@ int32_t lStatus;
449450
return lStatus;
450451
}
451452
/*-----------------------------------------------------------*/
452-
453-

portable/GCC/MicroBlazeV9/port.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, StackType_t *pxEn
111111
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
112112
#endif
113113
{
114-
extern void *_SDA2_BASE_, *_SDA_BASE_;
114+
extern void * _SDA2_BASE_;
115+
extern void * _SDA_BASE_;
115116
const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;
116117
const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_;
117118
extern void _start1( void );
@@ -487,5 +488,3 @@ int32_t lStatus;
487488
return lStatus;
488489
}
489490
/*-----------------------------------------------------------*/
490-
491-

portable/IAR/ARM_CM23/secure/secure_heap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( s
113113
/**
114114
* @brief Create a couple of list links to mark the start and end of the list.
115115
*/
116-
static BlockLink_t xStart, * pxEnd = NULL;
116+
static BlockLink_t xStart;
117+
static BlockLink_t * pxEnd = NULL;
117118

118119
/**
119120
* @brief Keeps track of the number of free bytes remaining, but says nothing
@@ -245,7 +246,9 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert )
245246

246247
void * pvPortMalloc( size_t xWantedSize )
247248
{
248-
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
249+
BlockLink_t * pxBlock;
250+
BlockLink_t * pxPreviousBlock;
251+
BlockLink_t * pxNewBlockLink;
249252
void * pvReturn = NULL;
250253

251254
/* If this is the first call to malloc then the heap will require

0 commit comments

Comments
 (0)