From f7e1e0130fb198fa2d4d62b8990d2ab205985b3f Mon Sep 17 00:00:00 2001 From: hansr Date: Sun, 12 Oct 2014 12:38:06 +0200 Subject: Remove workarounds for non-ANSI-C compatible compilers (Part 1) --- test/example.c | 12 +++--------- test/minigzip.c | 23 ++--------------------- 2 files changed, 5 insertions(+), 30 deletions(-) (limited to 'test') diff --git a/test/example.c b/test/example.c index 138a699bd5..e9353da1b5 100644 --- a/test/example.c +++ b/test/example.c @@ -8,16 +8,10 @@ #include "zlib.h" #include -#ifdef STDC -# include -# include -#endif +#include +#include -#if defined(VMS) || defined(RISCOS) -# define TESTFILE "foo-gz" -#else -# define TESTFILE "foo.gz" -#endif +#define TESTFILE "foo.gz" #define CHECK_ERR(err, msg) { \ if (err != Z_OK) { \ diff --git a/test/minigzip.c b/test/minigzip.c index a3640bfab2..f92aad7280 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -17,10 +17,8 @@ #include "zlib.h" #include -#ifdef STDC -# include -# include -#endif +#include +#include #ifdef USE_MMAP # include @@ -462,12 +460,7 @@ void file_compress(file, mode) exit(1); } -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX); -#else - strcpy(outfile, file); - strcat(outfile, GZ_SUFFIX); -#endif in = fopen(file, "rb"); if (in == NULL) { @@ -502,11 +495,7 @@ void file_uncompress(file) exit(1); } -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) snprintf(buf, sizeof(buf), "%s", file); -#else - strcpy(buf, file); -#endif if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { infile = file; @@ -515,11 +504,7 @@ void file_uncompress(file) } else { outfile = file; infile = buf; -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX); -#else - strcat(infile, GZ_SUFFIX); -#endif } in = gzopen(infile, "rb"); if (in == NULL) { @@ -557,11 +542,7 @@ int main(argc, argv) gzFile file; char *bname, outmode[20]; -#if !defined(NO_snprintf) && !defined(NO_vsnprintf) snprintf(outmode, sizeof(outmode), "%s", "wb6 "); -#else - strcpy(outmode, "wb6 "); -#endif prog = argv[0]; bname = strrchr(argv[0], '/'); -- cgit 0.0.5-2-1-g0f52