From: Yann Collet Date: Tue, 15 Dec 2015 10:25:12 +0000 (+0100) Subject: minor fixes X-Git-Tag: v0.4.5^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a3ab588c750404048a6f3dff732bfeb0d100510;p=thirdparty%2Fzstd.git minor fixes --- diff --git a/programs/fileio.c b/programs/fileio.c index 81635b934..05bdb21ee 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -270,7 +270,7 @@ unsigned long long FIO_compressFilename(const char* output_filename, const char* int seekResult; if (dictSize > 1 GB) EXM_THROW(21, "Dictionary file %s is too large", dictFileName); /* avoid extreme cases */ DISPLAYLEVEL(2,"Dictionary %s is too large : using last %u bytes only \n", dictFileName, MAX_DICT_SIZE); - seekResult = fseek(dictHandle, (size_t)(dictSize-MAX_DICT_SIZE), SEEK_SET); /* use end of file */ + seekResult = fseek(dictHandle, (long int)(dictSize-MAX_DICT_SIZE), SEEK_SET); /* use end of file */ if (seekResult != 0) EXM_THROW(21, "Error seeking into dictionary file %s", dictFileName); dictSize = MAX_DICT_SIZE; } @@ -417,7 +417,7 @@ unsigned long long FIO_decompressFilename(const char* output_filename, const cha int seekResult; if (dictSize > 1 GB) EXM_THROW(21, "Dictionary file %s is too large", dictFileName); /* avoid extreme cases */ DISPLAYLEVEL(2,"Dictionary %s is too large : using last %u bytes only \n", dictFileName, MAX_DICT_SIZE); - seekResult = fseek(dictHandle, dictSize-MAX_DICT_SIZE, SEEK_SET); /* use end of file */ + seekResult = fseek(dictHandle, (long int)(dictSize-MAX_DICT_SIZE), SEEK_SET); /* use end of file */ if (seekResult != 0) EXM_THROW(21, "Error seeking into dictionary file %s", dictFileName); dictSize = MAX_DICT_SIZE; } diff --git a/programs/zstdcli.c b/programs/zstdcli.c index e04e40fd0..b8c131065 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -43,23 +43,25 @@ #include /* fprintf, getchar */ #include /* exit, calloc, free */ #include /* strcmp, strlen */ -#include "bench.h" /* BMK_benchFiles, BMK_SetNbIterations */ #include "fileio.h" +#ifndef ZSTD_NOBENCH +# include "bench.h" /* BMK_benchFiles, BMK_SetNbIterations */ +#endif /************************************** * OS-specific Includes **************************************/ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) -# include // _O_BINARY -# include // _setmode, _isatty +# include /* _O_BINARY */ +# include /* _setmode, _isatty */ # ifdef __MINGW32__ /* int _fileno(FILE *stream); // seems no longer useful // MINGW somehow forgets to include this windows declaration into */ # endif # define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY) # define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream)) #else -# include // isatty +# include /* isatty */ # define SET_BINARY_MODE(file) # define IS_CONSOLE(stdStream) isatty(fileno(stdStream)) #endif