From: senhuang42 Date: Tue, 1 Sep 2020 16:52:18 +0000 (-0400) Subject: Cleanup comments, add function to set FIO_ctx_t.nbFilesProcessed X-Git-Tag: v1.4.7~77^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a7d625d6ba679a058bf223188628fa83b1982ca;p=thirdparty%2Fzstd.git Cleanup comments, add function to set FIO_ctx_t.nbFilesProcessed --- diff --git a/programs/fileio.c b/programs/fileio.c index 43fe3ead8..53d06671c 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -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 */ @@ -532,11 +532,16 @@ void FIO_setContentSize(FIO_prefs_t* const prefs, int value) /* 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; } +void FIO_setNbFilesProcessed(FIO_ctx_t* const fCtx, int value) +{ + fCtx->nbFilesProcessed = value; +} + void FIO_setCurrFileIdx(FIO_ctx_t* const fCtx, int 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); } if (fCtx->nbFilesTotal > 1) { - fCtx->totalBytesOutput += filesize; + fCtx->totalBytesOutput += (size_t)filesize; } } diff --git a/programs/fileio.h b/programs/fileio.h index ae0e2c754..f4008a444 100644 --- a/programs/fileio.h +++ b/programs/fileio.h @@ -54,7 +54,6 @@ extern "C" { ***************************************/ 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; 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); /* 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_setTotalBytesInput(FIO_ctx_t* const fCtx, size_t value); void FIO_setTotalBytesOutput(FIO_ctx_t* const fCtx, size_t value); diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 7ca07b21b..da6c24de2 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -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; /* IO Stream/File */ - FIO_setNbFiles(fCtx, (int)filenames->tableSize); + FIO_setNbFilesTotal(fCtx, (int)filenames->tableSize); FIO_setNotificationLevel(g_displayLevel); FIO_setPatchFromMode(prefs, patchFromDictFileName != NULL); if (memLimit == 0) {