mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 01:58:32 -04:00
Fix cast alignment warning in heap_4.c and heap_5.c (#771)
* Fix cast alignment warning --------- Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
This commit is contained in:
parent
1aaa318f1c
commit
231278eded
2 changed files with 6 additions and 9 deletions
|
@ -138,9 +138,9 @@
|
|||
|
||||
#else /* if ( configENABLE_HEAP_PROTECTOR == 1 ) */
|
||||
|
||||
#define heapPROTECT_BLOCK_POINTER( pxBlock ) ( pxBlock )
|
||||
#define heapPROTECT_BLOCK_POINTER( pxBlock ) ( pxBlock )
|
||||
|
||||
#define heapVALIDATE_BLOCK_POINTER( pxBlock ) ( pxBlock )
|
||||
#define heapVALIDATE_BLOCK_POINTER( pxBlock )
|
||||
|
||||
#endif /* configENABLE_HEAP_PROTECTOR */
|
||||
|
||||
|
@ -562,7 +562,7 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) /* PRIVI
|
|||
if( ( xAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
|
||||
{
|
||||
xAddress += ( portBYTE_ALIGNMENT - 1 );
|
||||
xAddress &= ~portBYTE_ALIGNMENT_MASK;
|
||||
xAddress &= ~( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK;
|
||||
|
||||
/* Adjust the size for the bytes lost to alignment. */
|
||||
xTotalRegionSize -= ( size_t ) ( xAddress - ( portPOINTER_SIZE_TYPE ) pxHeapRegion->pucStartAddress );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue