const char* dictFileName, int compressionLevel,
ZSTD_compressionParameters comprParams)
{
- int error = 0, status = 0;
+ int error = 0, status;
cRess_t ress = FIO_createCResources(prefs, dictFileName,
FIO_getLargestFileSize(inFileNamesTable, fCtx->nbFilesTotal),
compressionLevel, comprParams);
} else {
for (; fCtx->currFileIdx < fCtx->nbFilesTotal; ++fCtx->currFileIdx) {
status = FIO_compressFilename_srcFile(prefs, fCtx, ress, outFileName, inFileNamesTable[fCtx->currFileIdx], compressionLevel);
- fCtx->nbFilesProcessed = status ? fCtx->nbFilesProcessed : fCtx->nbFilesProcessed + 1;
+ if (!status) fCtx->nbFilesProcessed++;
error |= status;
}
if (fclose(ress.dstFile))
dstFileName = FIO_determineCompressedName(srcFileName, outDirName, suffix); /* cannot fail */
}
status = FIO_compressFilename_srcFile(prefs, fCtx, ress, dstFileName, srcFileName, compressionLevel);
- fCtx->nbFilesProcessed = status ? fCtx->nbFilesProcessed : fCtx->nbFilesProcessed + 1;
+ if (!status) fCtx->nbFilesProcessed++;
error |= status;
}
FIO_checkFilenameCollisions(inFileNamesTable , fCtx->nbFilesTotal);
}
- if (fCtx->nbFilesProcessed > 1) {
- if (fCtx->totalBytesInput != 0) {
- DISPLAYLEVEL(2, "%d files compressed : %.2f%% (%6zu => %6zu bytes)\n", fCtx->nbFilesProcessed,
+ if (fCtx->nbFilesProcessed >= 1 && fCtx->nbFilesTotal > 1 && fCtx->totalBytesInput != 0)
+ DISPLAYLEVEL(2, "%d files compressed : %.2f%% (%6zu => %6zu bytes)\n", fCtx->nbFilesProcessed,
(double)fCtx->totalBytesOutput/((double)fCtx->totalBytesInput)*100,
fCtx->totalBytesInput, fCtx->totalBytesOutput);
- } else {
- DISPLAYLEVEL(2, "%d files compressed : (%6zu => %6zu bytes)\n", fCtx->nbFilesProcessed,
- fCtx->totalBytesInput, fCtx->totalBytesOutput);
- }
- }
FIO_freeCResources(ress);
return error;
const char* outDirName, const char* outFileName,
const char* dictFileName)
{
- int error = 0, status = 0;
+ int error = 0, status;
dRess_t ress = FIO_createDResources(prefs, dictFileName);
if (outFileName) {
}
for (; fCtx->currFileIdx < fCtx->nbFilesTotal; fCtx->currFileIdx++) {
status = FIO_decompressSrcFile(prefs, fCtx, ress, outFileName, srcNamesTable[fCtx->currFileIdx]);
- fCtx->nbFilesProcessed = status ? fCtx->nbFilesProcessed : fCtx->nbFilesProcessed + 1;
+ if (!status) fCtx->nbFilesProcessed++;
error |= status;
}
if ((!prefs->testMode) && (fclose(ress.dstFile)))
}
if (dstFileName == NULL) { error=1; continue; }
status = FIO_decompressSrcFile(prefs, fCtx, ress, dstFileName, srcFileName);
- fCtx->nbFilesProcessed = status ? fCtx->nbFilesProcessed : fCtx->nbFilesProcessed + 1;
+ if (!status) fCtx->nbFilesProcessed++;
error |= status;
}
if (outDirName)
FIO_checkFilenameCollisions(srcNamesTable , fCtx->nbFilesTotal);
}
- if (fCtx->nbFilesProcessed > 1)
+ if (fCtx->nbFilesProcessed >= 1 && fCtx->nbFilesTotal > 1 && fCtx->totalBytesInput != 0)
DISPLAYLEVEL(2, "%d files decompressed : %6zu bytes total \n", fCtx->nbFilesProcessed, fCtx->totalBytesOutput);
FIO_freeDResources(ress);