Skip to content

Commit

Permalink
Uncrustify: triggered by comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 11, 2023
1 parent 325a308 commit d500500
Show file tree
Hide file tree
Showing 17 changed files with 144 additions and 142 deletions.
4 changes: 2 additions & 2 deletions ff_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static BaseType_t FF_ShortNameExists( FF_IOManager_t * pxIOManager,
if( ( pxFindParams->lFreeEntry < 0 ) && ( ++freeCount == entriesNeeded ) )
{
/* Remember the beginning entry in the sequential sequence. */
pxFindParams->lFreeEntry = ( pxDirEntry->usCurrentItem - ( int32_t )( entriesNeeded - 1 ) );
pxFindParams->lFreeEntry = ( pxDirEntry->usCurrentItem - ( int32_t ) ( entriesNeeded - 1 ) );
}

continue;
Expand Down Expand Up @@ -1143,7 +1143,7 @@ static FF_Error_t FF_Traverse( FF_IOManager_t * pxIOManager,
/* Check if we're past the last cluster ( ulChainLength is also valid for root sectors ). */
if( ( ulClusterNum + 1 ) > pxContext->ulChainLength )
{
xError = FF_createERR(FF_ERR_DIR_END_OF_DIR, FF_TRAVERSE); /* End of Dir was reached! */
xError = FF_createERR( FF_ERR_DIR_END_OF_DIR, FF_TRAVERSE ); /* End of Dir was reached! */
}
else if( ( pxIOManager->xPartition.ucType != FF_T_FAT32 ) &&
( pxContext->ulDirCluster == pxIOManager->xPartition.ulRootDirCluster ) )
Expand Down
4 changes: 2 additions & 2 deletions ff_fat.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ FF_Buffer_t * prvGetFromFATBuffers( FF_IOManager_t * pxIOManager,

if( FF_isERR( xError ) )
{
xError = FF_CreateError(FF_GETERROR( xError ), FF_GETFATENTRY);
xError = FF_CreateError( FF_GETERROR( xError ), FF_GETFATENTRY );
}
else
{
Expand Down Expand Up @@ -1130,7 +1130,7 @@ uint32_t FF_FindFreeCluster( FF_IOManager_t * pxIOManager,
uint32_t ulFATOffset;

ulEntriesPerSector = ( uint32_t ) ( pxIOManager->usSectorSize / xEntrySize );
ulFATOffset = ( uint32_t ) ( ulCluster * xEntrySize );
ulFATOffset = ( uint32_t ) ( ulCluster * xEntrySize );

/* Start from a sector where the first free entry is expected,
* and iterate through every FAT sector. */
Expand Down
16 changes: 8 additions & 8 deletions ff_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,11 +1134,11 @@ int32_t FF_BytesLeft( FF_FILE * pxFile )

if( pxFile == NULL )
{
xReturn = FF_createERR(FF_ERR_NULL_POINTER, FF_BYTESLEFT);
xReturn = FF_createERR( FF_ERR_NULL_POINTER, FF_BYTESLEFT );
}
else if( ( pxFile->ucMode & FF_MODE_READ ) == 0 )
{
xReturn = FF_createERR(FF_ERR_FILE_NOT_OPENED_IN_READ_MODE, FF_BYTESLEFT);
xReturn = FF_createERR( FF_ERR_FILE_NOT_OPENED_IN_READ_MODE, FF_BYTESLEFT );
}
else if( pxFile->ulFilePointer >= pxFile->ulFileSize )
{
Expand All @@ -1149,7 +1149,7 @@ int32_t FF_BytesLeft( FF_FILE * pxFile )
xReturn = pxFile->ulFileSize - pxFile->ulFilePointer;
}

return (int32_t) xReturn;
return ( int32_t ) xReturn;
} /* FF_BytesLeft() */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1737,7 +1737,7 @@ static uint32_t FF_ReadPartial( FF_FILE * pxFile,
* @param pxFile FF_FILE object that was created by FF_Open().
* @param ulElementSize The size of an element to read.
* @param ulCount The number of elements to read.
* @param pucBuffer A pointer to a buffer of adequate size to be filled with the requested data.
* @param pucBuffer A pointer to a buffer of adequate size to be filled with the requested data.
*
* @return Number of bytes read.
*
Expand Down Expand Up @@ -1990,7 +1990,7 @@ int32_t FF_GetC( FF_FILE * pxFile )

if( pxFile == NULL )
{
xResult = FF_createERR(FF_ERR_NULL_POINTER, FF_GETC); /* Ensure this is a signed error. */
xResult = FF_createERR( FF_ERR_NULL_POINTER, FF_GETC ); /* Ensure this is a signed error. */
}
else if( ( pxFile->ucMode & FF_MODE_READ ) == 0 )
{
Expand Down Expand Up @@ -2079,7 +2079,7 @@ int32_t FF_GetLine( FF_FILE * pxFile,
{
/* Although FF_GetC() returns an End Of File,
* the last few characters will be returned first. */
iChar = ( int32_t )xIndex;
iChar = ( int32_t ) xIndex;
}

break;
Expand Down Expand Up @@ -2482,8 +2482,8 @@ int32_t FF_PutC( FF_FILE * pxFile,
FF_Error_t xResult;

if( pxFile == NULL )
{ /* Ensure we don't have a Null file pointer on a Public interface. */
xResult = FF_createERR(FF_ERR_NULL_POINTER, FF_PUTC);
{ /* Ensure we don't have a Null file pointer on a Public interface. */
xResult = FF_createERR( FF_ERR_NULL_POINTER, FF_PUTC );
}
else if( ( pxFile->ucMode & FF_MODE_WRITE ) == 0 )
{
Expand Down
10 changes: 5 additions & 5 deletions ff_format.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static FF_Error_t prvFormatWriteBPB( struct xFormatSet * pxSet,

FF_putChar( pxSet->pucSectorBuffer, OFS_BPB_SecPerClus_8, ( uint32_t ) pxSet->ulSectorsPerCluster ); /* 0x00D / Only 1, 2, 4, 8, 16, 32, 64, 128 */
FF_PRINTF( "FF_Format: SecCluster %u DatSec %u DataClus %u pxSet->ulClusterBeginLBA %lu\n",
(unsigned) pxSet->ulSectorsPerCluster, (unsigned) pxSet->ulUsableDataSectors, (unsigned) pxSet->ulUsableDataClusters, pxSet->ulClusterBeginLBA );
( unsigned ) pxSet->ulSectorsPerCluster, ( unsigned ) pxSet->ulUsableDataSectors, ( unsigned ) pxSet->ulUsableDataClusters, pxSet->ulClusterBeginLBA );

/* This field is the new 32-bit total count of sectors on the volume. */
/* This count includes the count of all sectors in all four regions of the volume */
Expand Down Expand Up @@ -462,7 +462,7 @@ static FF_Error_t prvFormatInitialiseFAT( struct xFormatSet * pxSet,
xReturn = FF_BlockWrite( pxSet->pxIOManager, ( uint32_t ) lFatBeginLBA + pxSet->ulSectorsPerFAT, 1, pxSet->pucSectorBuffer, pdFALSE );
}

FF_PRINTF( "FF_Format: Clearing entire FAT (2 x %u sectors):\n", (unsigned) pxSet->ulSectorsPerFAT );
FF_PRINTF( "FF_Format: Clearing entire FAT (2 x %u sectors):\n", ( unsigned ) pxSet->ulSectorsPerFAT );
{
int32_t addr;

Expand Down Expand Up @@ -637,8 +637,8 @@ FF_Error_t FF_FormatDisk( FF_Disk_t * pxDisk,
}

FF_PRINTF( "FF_Format: Secs %u Rsvd %u Hidden %u Root %u Data %u\n",
(unsigned) xSet.ulSectorCount, (unsigned) xSet.ulFATReservedSectors, (unsigned) xSet.ulHiddenSectors,
(unsigned) xSet.iFAT16RootSectors, (unsigned) xSet.ulSectorCount - xSet.ulNonDataSectors );
( unsigned ) xSet.ulSectorCount, ( unsigned ) xSet.ulFATReservedSectors, ( unsigned ) xSet.ulHiddenSectors,
( unsigned ) xSet.iFAT16RootSectors, ( unsigned ) xSet.ulSectorCount - xSet.ulNonDataSectors );

/*****************************/

Expand Down Expand Up @@ -1008,7 +1008,7 @@ FF_Error_t FF_Partition( FF_Disk_t * pxDisk,

if( ulSummedSizes > 100 )
{
return FF_createERR ( FF_ERR_IOMAN_BAD_MEMSIZE, FF_FORMATPARTITION );
return FF_createERR( FF_ERR_IOMAN_BAD_MEMSIZE, FF_FORMATPARTITION );
}

ulSummedSizes = 100;
Expand Down
54 changes: 27 additions & 27 deletions ff_ioman.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static BaseType_t prvHasActiveHandles( FF_IOManager_t * pxIOManager );
* To be checked when a NULL pointer is returned.
*
* @return Returns a pointer to an FF_IOManager_t type object. NULL on xError, check the contents of
pError
* pError
**/
FF_IOManager_t * FF_CreateIOManager( FF_CreationParameters_t * pxParameters,
FF_Error_t * pError )
Expand Down Expand Up @@ -191,7 +191,7 @@ FF_IOManager_t * FF_CreateIOManager( FF_CreationParameters_t * pxParameters,
if( pxIOManager->pvSemaphoreOpen == NULL )
{
/* Tell the user that there was not enough mmory. */
xError = FF_createERR( FF_ERR_NOT_ENOUGH_MEMORY, FF_CREATEIOMAN);
xError = FF_createERR( FF_ERR_NOT_ENOUGH_MEMORY, FF_CREATEIOMAN );
}
else
#endif /* ffconfigPROTECT_FF_FOPEN_WITH_SEMAPHORE */
Expand Down Expand Up @@ -647,7 +647,7 @@ int32_t FF_BlockWrite( FF_IOManager_t * pxIOManager,
* In that case this test will be skipped. */
if( ( ulSectorLBA + ulNumSectors ) > ( pxIOManager->xPartition.ulTotalSectors + pxIOManager->xPartition.ulBeginLBA ) )
{
slRetVal = FF_createERR( FF_ERR_IOMAN_OUT_OF_BOUNDS_WRITE , FF_BLOCKWRITE );
slRetVal = FF_createERR( FF_ERR_IOMAN_OUT_OF_BOUNDS_WRITE, FF_BLOCKWRITE );
}
}

Expand Down Expand Up @@ -766,7 +766,7 @@ static FF_Error_t prvDetermineFatType( FF_IOManager_t * pxIOManager )
#if ( ffconfigFAT_CHECK != 0 )
if( ( ulFirstWord & 0x3FF ) != 0x3F8 )
{
xError = FF_createERR( FF_ERR_IOMAN_NOT_FAT_FORMATTED, FF_DETERMINEFATTYPE);
xError = FF_createERR( FF_ERR_IOMAN_NOT_FAT_FORMATTED, FF_DETERMINEFATTYPE );
}
else
#endif /* ffconfigFAT_CHECK */
Expand Down Expand Up @@ -1116,7 +1116,7 @@ FF_Error_t FF_PartitionSearch( FF_IOManager_t * pxIOManager,
FF_getChar( ucDataBuffer, FF_FAT_MBR_SIGNATURE + 1 ) );

/* No MBR and no PBR then no partition found. */
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT ,FF_PARTITIONSEARCH );
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_PARTITIONSEARCH );
break;
}
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ FF_Error_t FF_PartitionSearch( FF_IOManager_t * pxIOManager,
}
else
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_PARTITIONSEARCH);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_PARTITIONSEARCH );
break;
}
}
Expand Down Expand Up @@ -1198,7 +1198,7 @@ FF_Error_t FF_PartitionSearch( FF_IOManager_t * pxIOManager,
if( !prvIsValidMedia( media ) )
{
FF_PRINTF( "FF_Part: Looks like PBR but media %02X\n", media );
xError = FF_createERR( FF_ERR_IOMAN_NO_MOUNTABLE_PARTITION, FF_PARTITIONSEARCH);
xError = FF_createERR( FF_ERR_IOMAN_NO_MOUNTABLE_PARTITION, FF_PARTITIONSEARCH );
goto done;
}

Expand Down Expand Up @@ -1266,15 +1266,15 @@ static FF_Error_t FF_GetEfiPartitionEntry( FF_IOManager_t * pxIOManager,
{
if( ulPartitionNumber >= 128 )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_PARTITION_NUM, FF_GETEFIPARTITIONENTRY);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_PARTITION_NUM, FF_GETEFIPARTITIONENTRY );
break;
}

pxBuffer = FF_GetBuffer( pxIOManager, pxPartition->ulBeginLBA, FF_MODE_READ );

if( pxBuffer == NULL )
{
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_GETEFIPARTITIONENTRY);
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_GETEFIPARTITIONENTRY );
break;
}

Expand All @@ -1286,7 +1286,7 @@ static FF_Error_t FF_GetEfiPartitionEntry( FF_IOManager_t * pxIOManager,

if( FF_isERR( xError ) == pdFALSE )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_GETEFIPARTITIONENTRY);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_GETEFIPARTITIONENTRY );
}

break;
Expand Down Expand Up @@ -1317,7 +1317,7 @@ static FF_Error_t FF_GetEfiPartitionEntry( FF_IOManager_t * pxIOManager,
/* Check CRC */
if( ulGPTHeadCRC != ulGPTCrcCheck )
{
xError = FF_createERR( FF_ERR_IOMAN_GPT_HEADER_CORRUPT, FF_GETEFIPARTITIONENTRY);
xError = FF_createERR( FF_ERR_IOMAN_GPT_HEADER_CORRUPT, FF_GETEFIPARTITIONENTRY );
break;
}

Expand All @@ -1329,7 +1329,7 @@ static FF_Error_t FF_GetEfiPartitionEntry( FF_IOManager_t * pxIOManager,
{
if( pxBuffer == NULL )
{
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_GETEFIPARTITIONENTRY);
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_GETEFIPARTITIONENTRY );
break;
}

Expand All @@ -1342,7 +1342,7 @@ static FF_Error_t FF_GetEfiPartitionEntry( FF_IOManager_t * pxIOManager,
{
if( pxPartition->ulBeginLBA == 0ul )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_PARTITION_NUM, FF_GETEFIPARTITIONENTRY);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_PARTITION_NUM, FF_GETEFIPARTITIONENTRY );
}
}
}
Expand Down Expand Up @@ -1397,7 +1397,7 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,
{
if( pxIOManager == NULL )
{
xError = FF_createERR( FF_ERR_NULL_POINTER, FF_MOUNT);
xError = FF_createERR( FF_ERR_NULL_POINTER, FF_MOUNT );
break;
}

Expand Down Expand Up @@ -1441,13 +1441,13 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,

if( xPartitionCount == 0 )
{
xError = FF_createERR( FF_ERR_IOMAN_NO_MOUNTABLE_PARTITION, FF_MOUNT);
xError = FF_createERR( FF_ERR_IOMAN_NO_MOUNTABLE_PARTITION, FF_MOUNT );
break;
}

if( xPartitionNumber >= xPartitionCount )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_PARTITION_NUM, FF_MOUNT);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_PARTITION_NUM, FF_MOUNT );
break;
}

Expand All @@ -1470,7 +1470,7 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,

if( pxBuffer == NULL )
{
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_MOUNT);
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_MOUNT );
break;
}

Expand All @@ -1483,7 +1483,7 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,

if( FF_isERR( xError ) == pdFALSE )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_MOUNT);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_MOUNT );
}

break;
Expand Down Expand Up @@ -1529,7 +1529,7 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,

if( pxPartition->usBlkSize == 0 )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_MOUNT);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_MOUNT );
break;
}

Expand All @@ -1552,7 +1552,7 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,
*/
if( pxPartition->ulSectorsPerCluster == 0 )
{
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_MOUNT);
xError = FF_createERR( FF_ERR_IOMAN_INVALID_FORMAT, FF_MOUNT );
break;
}

Expand Down Expand Up @@ -1673,7 +1673,7 @@ FF_Error_t FF_Unmount( FF_Disk_t * pxDisk )

if( pxDisk->pxIOManager == NULL )
{
xError = FF_createERR( FF_ERR_NULL_POINTER, FF_UNMOUNT);
xError = FF_createERR( FF_ERR_NULL_POINTER, FF_UNMOUNT );
}
else if( pxDisk->pxIOManager->xPartition.ucPartitionMounted == 0 )
{
Expand All @@ -1687,12 +1687,12 @@ FF_Error_t FF_Unmount( FF_Disk_t * pxDisk )
if( prvHasActiveHandles( pxIOManager ) != 0 )
{
/* Active handles found on the cache. */
xError = FF_createERR( FF_ERR_IOMAN_ACTIVE_HANDLES, FF_UNMOUNT);
xError = FF_createERR( FF_ERR_IOMAN_ACTIVE_HANDLES, FF_UNMOUNT );
}
else if( pxIOManager->FirstFile != NULL )
{
/* Open files in this partition. */
xError = FF_createERR( FF_ERR_IOMAN_ACTIVE_HANDLES, FF_UNMOUNT);
xError = FF_createERR( FF_ERR_IOMAN_ACTIVE_HANDLES, FF_UNMOUNT );
}
else
{
Expand All @@ -1717,7 +1717,7 @@ FF_Error_t FF_Unmount( FF_Disk_t * pxDisk )

if( !pxBuffer )
{
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_UNMOUNT);
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_UNMOUNT );
break;
}

Expand Down Expand Up @@ -1808,7 +1808,7 @@ FF_Error_t FF_IncreaseFreeClusters( FF_IOManager_t * pxIOManager,

if( pxBuffer == NULL )
{
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_INCREASEFREECLUSTERS);
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_INCREASEFREECLUSTERS );
}
else
{
Expand Down Expand Up @@ -1882,7 +1882,7 @@ FF_Error_t FF_DecreaseFreeClusters( FF_IOManager_t * pxIOManager,

if( pxBuffer == NULL )
{
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_DECREASEFREECLUSTERS);
xError = FF_createERR( FF_ERR_DEVICE_DRIVER_FAILED, FF_DECREASEFREECLUSTERS );
}
else
{
Expand Down Expand Up @@ -1916,7 +1916,7 @@ FF_Error_t FF_DecreaseFreeClusters( FF_IOManager_t * pxIOManager,
* @param pxIOManager FF_IOManager_t Object returned from FF_CreateIOManager()
*
* @return The blocksize of the partition. A value less than 0 when an error occurs.
* Any negative value can be cast to the FF_Error_t type.
* Any negative value can be cast to the FF_Error_t type.
**/
int32_t FF_GetPartitionBlockSize( FF_IOManager_t * pxIOManager )
{
Expand Down
2 changes: 1 addition & 1 deletion ff_string.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@

if( xLength == 0 )
{
xLength = (BaseType_t) strlen( str1 );
xLength = ( BaseType_t ) strlen( str1 );

if( xLength != ( BaseType_t ) strlen( str2 ) )
{
Expand Down
4 changes: 2 additions & 2 deletions ff_time.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
pxTimeBuf->tm_mon = iMonth;

/* Month days are counted as 1..31 */
pxTimeBuf->tm_mday = ( int )ulDayNumber + 1;
pxTimeBuf->tm_mday = ( int ) ulDayNumber + 1;

return pxTimeBuf;
}
Expand Down Expand Up @@ -282,7 +282,7 @@

/* Add days past before this year: */
ulDays +=
+ ( time_t ) ( iYear * 365 ) /* Every normal year. */
+( time_t ) ( iYear * 365 ) /* Every normal year. */
+ ( time_t ) ( iYear / 4 ) /* Plus a day for every leap year. */
- ( time_t ) ( iYear / 100 ) /* Minus the centuries. */
+ ( time_t ) ( iYear / 400 ) /* Except every fourth century. */
Expand Down
Loading

0 comments on commit d500500

Please sign in to comment.