Cleanup comments, add function to set FIO_ctx_t.nbFilesProcessed

dev
senhuang42 2020-09-01 12:52:18 -04:00
parent a03917c751
commit 3a7d625d6b
3 changed files with 11 additions and 6 deletions

View File

@ -322,7 +322,7 @@ struct FIO_prefs_s {
}; };
/*-************************************* /*-*************************************
* Parameters: FIO_prefs_t * Parameters: FIO_ctx_t
***************************************/ ***************************************/
/* typedef'd to FIO_ctx_t within fileio.h */ /* typedef'd to FIO_ctx_t within fileio.h */
@ -532,11 +532,16 @@ void FIO_setContentSize(FIO_prefs_t* const prefs, int value)
/* FIO_ctx_t functions */ /* FIO_ctx_t functions */
void FIO_setNbFiles(FIO_ctx_t* const fCtx, int value) void FIO_setNbFilesTotal(FIO_ctx_t* const fCtx, int value)
{ {
fCtx->nbFilesTotal = value; fCtx->nbFilesTotal = value;
} }
void FIO_setNbFilesProcessed(FIO_ctx_t* const fCtx, int value)
{
fCtx->nbFilesProcessed = value;
}
void FIO_setCurrFileIdx(FIO_ctx_t* const fCtx, int value) void FIO_setCurrFileIdx(FIO_ctx_t* const fCtx, int value)
{ {
fCtx->currFileIdx = value; fCtx->currFileIdx = value;
@ -2421,7 +2426,7 @@ static int FIO_decompressFrames(dRess_t ress, FILE* srcFile,
DISPLAYLEVEL(2, "%-20s: %llu bytes \n", srcFileName, filesize); DISPLAYLEVEL(2, "%-20s: %llu bytes \n", srcFileName, filesize);
} }
if (fCtx->nbFilesTotal > 1) { if (fCtx->nbFilesTotal > 1) {
fCtx->totalBytesOutput += filesize; fCtx->totalBytesOutput += (size_t)filesize;
} }
} }

View File

@ -54,7 +54,6 @@ extern "C" {
***************************************/ ***************************************/
typedef enum { FIO_zstdCompression, FIO_gzipCompression, FIO_xzCompression, FIO_lzmaCompression, FIO_lz4Compression } FIO_compressionType_t; typedef enum { FIO_zstdCompression, FIO_gzipCompression, FIO_xzCompression, FIO_lzmaCompression, FIO_lz4Compression } FIO_compressionType_t;
/* Immutable struct containing preferences for file I/O */
typedef struct FIO_prefs_s FIO_prefs_t; typedef struct FIO_prefs_s FIO_prefs_t;
FIO_prefs_t* FIO_createPreferences(void); FIO_prefs_t* FIO_createPreferences(void);
@ -106,7 +105,8 @@ void FIO_setPatchFromMode(FIO_prefs_t* const prefs, int value);
void FIO_setContentSize(FIO_prefs_t* const prefs, int value); void FIO_setContentSize(FIO_prefs_t* const prefs, int value);
/* FIO_ctx_t functions */ /* FIO_ctx_t functions */
void FIO_setNbFiles(FIO_ctx_t* const fCtx, int value); void FIO_setNbFilesTotal(FIO_ctx_t* const fCtx, int value);
void FIO_setNbFilesProcessed(FIO_ctx_t* const fCtx, int value);
void FIO_setCurrFileIdx(FIO_ctx_t* const fCtx, int value); void FIO_setCurrFileIdx(FIO_ctx_t* const fCtx, int value);
void FIO_setTotalBytesInput(FIO_ctx_t* const fCtx, size_t value); void FIO_setTotalBytesInput(FIO_ctx_t* const fCtx, size_t value);
void FIO_setTotalBytesOutput(FIO_ctx_t* const fCtx, size_t value); void FIO_setTotalBytesOutput(FIO_ctx_t* const fCtx, size_t value);

View File

@ -1261,7 +1261,7 @@ int main(int const argCount, const char* argv[])
if (!strcmp(filenames->fileNames[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (g_displayLevel==2)) g_displayLevel=1; if (!strcmp(filenames->fileNames[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (g_displayLevel==2)) g_displayLevel=1;
/* IO Stream/File */ /* IO Stream/File */
FIO_setNbFiles(fCtx, (int)filenames->tableSize); FIO_setNbFilesTotal(fCtx, (int)filenames->tableSize);
FIO_setNotificationLevel(g_displayLevel); FIO_setNotificationLevel(g_displayLevel);
FIO_setPatchFromMode(prefs, patchFromDictFileName != NULL); FIO_setPatchFromMode(prefs, patchFromDictFileName != NULL);
if (memLimit == 0) { if (memLimit == 0) {