diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2016-12-22 10:58:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-22 10:58:29 (GMT) |
commit | b41f9bb132e8207999e89d01925e202da98b7649 (patch) | |
tree | 4632c6d377ee39fe9bc5011191824360fe7b3990 /tests/fuzzer.c | |
parent | 7eb16d97d238e2b98f1e6453ed6ad64058cb99c1 (diff) | |
parent | fea95c156761ee10d32a4f12105ebd90c67d4f47 (diff) | |
download | lz4-b41f9bb132e8207999e89d01925e202da98b7649.zip lz4-b41f9bb132e8207999e89d01925e202da98b7649.tar.gz lz4-b41f9bb132e8207999e89d01925e202da98b7649.tar.bz2 |
Merge pull request #292 from inikep/dev
improved POSIX
Diffstat (limited to 'tests/fuzzer.c')
-rw-r--r-- | tests/fuzzer.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 260208a..ff02e0c 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -27,7 +27,6 @@ * Compiler options **************************************/ #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 */ # pragma warning(disable : 4310) /* disable: C4310: constant char value > 127 */ @@ -37,6 +36,8 @@ /*-************************************ * Dependencies **************************************/ +#include "platform.h" /* _CRT_SECURE_NO_WARNINGS */ +#include "util.h" /* U32 */ #include <stdlib.h> #include <stdio.h> /* fgets, sscanf */ #include <string.h> /* strcmp */ @@ -49,19 +50,7 @@ /*-************************************ * Basic Types **************************************/ -#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) -# include <stdint.h> -typedef uint8_t BYTE; -typedef uint16_t U16; -typedef uint32_t U32; -typedef int32_t S32; -typedef uint64_t U64; -#else -typedef unsigned char BYTE; -typedef unsigned short U16; -typedef unsigned int U32; -typedef signed int S32; -typedef unsigned long long U64; +#if !defined(__cplusplus) && !(defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) typedef size_t uintptr_t; /* true on most systems, except OpenVMS-64 (which doesn't need address overflow test) */ #endif @@ -1000,7 +989,7 @@ int main(int argc, const char** argv) int nbTests = NB_ATTEMPTS; int testNb = 0; int proba = FUZ_COMPRESSIBILITY_DEFAULT; - int pause = 0; + int use_pause = 0; const char* programName = argv[0]; U32 duration = 0; @@ -1012,7 +1001,7 @@ int main(int argc, const char** argv) // Decode command (note : aggregated commands are allowed) if (argument[0]=='-') { - if (!strcmp(argument, "--no-prompt")) { pause=0; seedset=1; g_displayLevel=1; continue; } + if (!strcmp(argument, "--no-prompt")) { use_pause=0; seedset=1; g_displayLevel=1; continue; } argument++; while (*argument!=0) { @@ -1028,7 +1017,7 @@ int main(int argc, const char** argv) case 'p': /* pause at the end */ argument++; - pause=1; + use_pause=1; break; case 'i': @@ -1118,7 +1107,7 @@ int main(int argc, const char** argv) if (nbTests<=0) nbTests=1; { int const result = FUZ_test(seed, nbTests, testNb, ((double)proba) / 100, duration); - if (pause) { + if (use_pause) { DISPLAY("press enter ... \n"); (void)getchar(); } |