-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small Type and Qualifier Fixes #67
Conversation
I also added a second commit where I add the const qualifiert to the FF_IsNameCompliant() argument. This fixes a -Wdiscarded-qualifiers warning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @StefanBalt for these changes. I guess it saves a couple of warnings.
I approve it if you can remove the ul
suffix.
ff_fat.c
Outdated
@@ -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 ) ~0ul ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to avoid the use of the ambiguous 'ul' suffix and write the following:
- if( ulFreeClusters != ( uint32_t ) ~0ul )
+ if( ulFreeClusters != ~( ( uint32_t ) 0U ) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the U suffix does not have any effect now but I guess it is FreeRTOS style
Otherwise the condition is always true for 64-bit architectures.
The argument is read-only.
Otherwise the condition is always true for 64-bit architectures.
GCC warned me about this when compiling AARCH64 (-Wtype-limits).