Skip to content

Commit

Permalink
Add explicit cast to uint32_t
Browse files Browse the repository at this point in the history
Otherwise the condition is always true for 64-bit architectures.
  • Loading branch information
StefanBalt committed Apr 25, 2024
1 parent d43050a commit 1a47b70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ff_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ uint32_t FF_FindEndOfChain( FF_IOManager_t * pxIOManager,
{
/* Traverse FAT for (2^32-1) items/clusters,
* or until end-of-chain is encountered. */
ulFatEntry = FF_TraverseFAT( pxIOManager, ulStart, ( uint32_t ) ~0UL, &xError );
ulFatEntry = FF_TraverseFAT( pxIOManager, ulStart, ~( ( uint32_t ) 0U ) , &xError );
}
else
{
Expand Down Expand Up @@ -1496,7 +1496,7 @@ uint32_t FF_CountFreeClusters( FF_IOManager_t * pxIOManager,
{
ulFreeClusters = FF_getLong( pxBuffer->pucBuffer, 488 );

if( ulFreeClusters != ~0ul )
if( ulFreeClusters != ~( ( uint32_t ) 0U ) )
{
xInfoKnown = pdTRUE;
}
Expand Down

0 comments on commit 1a47b70

Please sign in to comment.