Skip to content

Commit

Permalink
Small Type and Qualifier Fixes (#67)
Browse files Browse the repository at this point in the history
Otherwise the condition is always true for 64-bit architectures.

GCC warned me about this when compiling AARCH64 (-Wtype-limits).
  • Loading branch information
StefanBalt authored Apr 29, 2024
1 parent d43050a commit f834aee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ff_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2884,9 +2884,9 @@ FF_Error_t FF_ExtendDirectory( FF_IOManager_t * pxIOManager,

/* *INDENT-OFF* */
#if ( ffconfigUNICODE_UTF16_SUPPORT != 0 )
BaseType_t FF_IsNameCompliant( FF_T_WCHAR * pcName )
BaseType_t FF_IsNameCompliant( const FF_T_WCHAR * pcName )
#else
BaseType_t FF_IsNameCompliant( char * pcName )
BaseType_t FF_IsNameCompliant( const char * pcName )
#endif
/* *INDENT-ON* */
{
Expand Down
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
4 changes: 2 additions & 2 deletions include/ff_dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ int8_t FF_PushEntry( FF_IOManager_t * pxIOManager,
* contains any legal characters only.
*/
#if ( ffconfigUNICODE_UTF16_SUPPORT != 0 )
BaseType_t FF_IsNameCompliant( FF_T_WCHAR * pcName );
BaseType_t FF_IsNameCompliant( const FF_T_WCHAR * pcName );
#else
BaseType_t FF_IsNameCompliant( char * pcName );
BaseType_t FF_IsNameCompliant( const char * pcName );
#endif

static portINLINE BaseType_t FF_isEndOfDir( const uint8_t * pucEntryBuffer )
Expand Down

0 comments on commit f834aee

Please sign in to comment.