]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
executables use new util.h and platform.h
authorPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 21 Dec 2016 08:06:14 +0000 (09:06 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 21 Dec 2016 08:06:14 +0000 (09:06 +0100)
programs/bench.c
programs/datagen.c
programs/dibio.c
programs/fileio.c
tests/datagencli.c
tests/fullbench.c
tests/fuzzer.c
tests/paramgrill.c
tests/zbufftest.c
tests/zstreamtest.c
zlibWrapper/examples/zwrapbench.c

index a4b57efcb4a2676e5b29c7e9bb35b2b20d400e95..2b7436a4f3b204c2dc1ad574f98528111df8f367 100644 (file)
@@ -18,7 +18,6 @@
 #include <stdio.h>       /* fprintf, fopen, ftello64 */
 #include <time.h>        /* clock_t, clock, CLOCKS_PER_SEC */
 
-#include "mem.h"
 #define ZSTD_STATIC_LINKING_ONLY
 #include "zstd.h"
 #include "datagen.h"     /* RDG_genBuffer */
index 1af5a38a58582e86480b7c0b13af530ed75ef50a..da5124cfc379571badee0e413bfb4cfa6f988560 100644 (file)
 /*-************************************
 *  Dependencies
 **************************************/
+#include "util.h"      /* U32 */
 #include <stdlib.h>    /* malloc, free */
 #include <stdio.h>     /* FILE, fwrite, fprintf */
 #include <string.h>    /* memcpy */
-#include "mem.h"       /* U32 */
-
-
-/*-************************************
-*  OS-specific Includes
-**************************************/
-#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
-#  include <fcntl.h>   /* _O_BINARY */
-#  include <io.h>      /* _setmode, _isatty */
-#  define SET_BINARY_MODE(file) {int unused = _setmode(_fileno(file), _O_BINARY); (void)unused; }
-#else
-#  define SET_BINARY_MODE(file)
-#endif
 
 
 /*-************************************
index 152ea4d09e7d11abb838d181daed4fffcfe5176c..1c22949f1988a1962b7945e8eb57a214e115d87a 100644 (file)
@@ -20,7 +20,6 @@
 #include <time.h>           /* clock_t, clock, CLOCKS_PER_SEC */
 #include <errno.h>          /* errno */
 
-#include "mem.h"            /* read */
 #include "error_private.h"
 #include "dibio.h"
 
index 325a17a591db824ea44818aa1797582253118759..58fe7e355d1966e36297b0249e23a145cef73d1a 100644 (file)
@@ -30,7 +30,6 @@
 #include <time.h>       /* clock */
 #include <errno.h>      /* errno */
 
-#include "mem.h"
 #include "fileio.h"
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */
 #include "zstd.h"
 #endif
 
 
-/*-*************************************
-*  OS-specific Includes
-***************************************/
-#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
-#  include <fcntl.h>    /* _O_BINARY */
-#  include <io.h>       /* _setmode, _isatty */
-#  define SET_BINARY_MODE(file) { if (_setmode(_fileno(file), _O_BINARY) == -1) perror("Cannot set _O_BINARY"); }
-#else
-#  include <unistd.h>   /* isatty */
-#  define SET_BINARY_MODE(file)
-#endif
-
-
 /*-*************************************
 *  Constants
 ***************************************/
index 2b3d3b5117237abef141e9e73a934af4aa9759aa..c4bf489344ec5ab45f112a9af64658ca005a18dd 100644 (file)
@@ -12,9 +12,9 @@
 *  Dependencies
 **************************************/
 #include "platform.h"  /* Compiler options */
+#include "util.h"      /* U32 */
 #include <stdio.h>     /* fprintf, stderr */
 #include "datagen.h"   /* RDG_generate */
-#include "mem.h"       /* U32, U64 */
 
 
 /*-************************************
index e5547d08922930631eeb979d58a1fb19006c9738..439de5c7699d6ada743cac8b17a7053c82e8a118 100644 (file)
 *  Includes
 **************************************/
 #include "platform.h"    /* Compiler options */
-#include "util.h"        /* UTIL_GetFileSize */
+#include "util.h"        /* U32 */
 #include <stdlib.h>      /* malloc */
 #include <stdio.h>       /* fprintf, fopen, ftello64 */
 #include <time.h>        /* clock_t, clock, CLOCKS_PER_SEC */
 
-#include "mem.h"
 #ifndef ZSTD_DLL_IMPORT
     #include "zstd_internal.h"   /* ZSTD_blockHeaderSize, blockType_e, KB, MB */
     #define ZSTD_STATIC_LINKING_ONLY  /* ZSTD_compressBegin, ZSTD_compressContinue, etc. */
index 86d4c6bebb359f04b8e45a4978fc7d248d3c8952..9088e24832cd058a8de82f0cace22413e35b0758 100644 (file)
@@ -12,8 +12,6 @@
 *  Compiler specific
 **************************************/
 #ifdef _MSC_VER    /* Visual Studio */
-#  define _CRT_SECURE_NO_WARNINGS     /* fgets */
-#  pragma warning(disable : 4127)     /* disable: C4127: conditional expression is constant */
 #  pragma warning(disable : 4204)     /* disable: C4204: non-constant aggregate initializer */
 #endif
 
@@ -21,6 +19,8 @@
 /*-************************************
 *  Includes
 **************************************/
+#include "platform.h"     /* Compiler options */
+#include "util.h"         /* U32 */
 #include <stdlib.h>       /* free */
 #include <stdio.h>        /* fgets, sscanf */
 #include <string.h>       /* strcmp */
@@ -30,7 +30,6 @@
 #include "zstd_errors.h"  /* ZSTD_getErrorCode */
 #include "zdict.h"        /* ZDICT_trainFromBuffer */
 #include "datagen.h"      /* RDG_genBuffer */
-#include "mem.h"
 #define XXH_STATIC_LINKING_ONLY
 #include "xxhash.h"       /* XXH64 */
 
index 19658fddb84a5447b6a0961d5277bcdd8ba988a4..0825b37a6a55eb18e739597b7c9e3ffdd4f4425c 100644 (file)
 *  Dependencies
 **************************************/
 #include "platform.h"  /* Compiler options */
-#include "util.h"      /* UTIL_GetFileSize */
+#include "util.h"      /* UTIL_getFileSize */
 #include <stdlib.h>    /* malloc */
 #include <stdio.h>     /* fprintf, fopen, ftello64 */
 #include <string.h>    /* strcmp */
 #include <math.h>      /* log */
 #include <time.h>      /* clock_t */
 
-#include "mem.h"
+#include "mem.h"       /* MEM_32bits() */
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_parameters, ZSTD_estimateCCtxSize */
 #include "zstd.h"
 #include "datagen.h"
index 14b73923311d1bf64753de28024cbed7d19031bd..87cf80b5e729d57b5aded460d19044cfaabcc149 100644 (file)
@@ -12,8 +12,6 @@
 *  Compiler specific
 **************************************/
 #ifdef _MSC_VER    /* Visual Studio */
-#  define _CRT_SECURE_NO_WARNINGS     /* fgets */
-#  pragma warning(disable : 4127)     /* disable: C4127: conditional expression is constant */
 #  pragma warning(disable : 4146)     /* disable: C4146: minus unsigned expression */
 #endif
 
 /*-************************************
 *  Includes
 **************************************/
+#include "platform.h"     /* Compiler options */
 #include <stdlib.h>       /* free */
 #include <stdio.h>        /* fgets, sscanf */
 #include <time.h>         /* clock_t, clock() */
 #include <string.h>       /* strcmp */
-#include "mem.h"
+#include "mem.h"          /* MEM_writeLE32 */
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_maxCLevel */
 #include "zstd.h"         /* ZSTD_compressBound */
 #define ZBUFF_STATIC_LINKING_ONLY  /* ZBUFF_createCCtx_advanced */
index ce619308572cc40af5410b430fa5978691f2ab58..9da0010bebfb031f359993b211231ed8c6846487 100644 (file)
@@ -12,8 +12,6 @@
 *  Compiler specific
 **************************************/
 #ifdef _MSC_VER    /* Visual Studio */
-#  define _CRT_SECURE_NO_WARNINGS     /* fgets */
-#  pragma warning(disable : 4127)     /* disable: C4127: conditional expression is constant */
 #  pragma warning(disable : 4146)     /* disable: C4146: minus unsigned expression */
 #endif
 
 /*-************************************
 *  Includes
 **************************************/
+#include "platform.h"     /* Compiler options */
 #include <stdlib.h>       /* free */
 #include <stdio.h>        /* fgets, sscanf */
 #include <time.h>         /* clock_t, clock() */
 #include <string.h>       /* strcmp */
-#include "mem.h"
+#include "mem.h"          /* MEM_writeLE32 */
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_maxCLevel, ZSTD_customMem */
 #include "zstd.h"         /* ZSTD_compressBound */
 #include "zstd_errors.h"  /* ZSTD_error_srcSize_wrong */
index c3968dba30f1cfaa6547373053ec4d47c6547d42..8999657fa58156a71efad4245059c2b513d66072 100644 (file)
 *  Includes
 ***************************************/
 #include "platform.h"    /* Compiler options */
-#include "util.h"        /* UTIL_GetFileSize, UTIL_sleep */
+#include "util.h"        /* U32, UTIL_GetFileSize, UTIL_sleep */
 #include <stdlib.h>      /* malloc, free */
 #include <string.h>      /* memset */
 #include <stdio.h>       /* fprintf, fopen, ftello64 */
 #include <time.h>        /* clock_t, clock, CLOCKS_PER_SEC */
 #include <ctype.h>       /* toupper */
 
-#include "mem.h"
 #define ZSTD_STATIC_LINKING_ONLY
 #include "zstd.h"
 #include "datagen.h"     /* RDG_genBuffer */