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:
kar-rahul-aws 2023-09-04 22:51:58 +05:30 committed by GitHub
parent 1aaa318f1c
commit 231278eded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View file

@ -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 );