diff options
| author | hansr <hk-git@circlestorm.org> | 2014-10-12 12:38:06 +0200 |
|---|---|---|
| committer | hansr <hk-git@circlestorm.org> | 2014-10-12 12:38:06 +0200 |
| commit | f7e1e0130fb198fa2d4d62b8990d2ab205985b3f (patch) | |
| tree | 56b60d978ce22cea80c52be7962d6be5e8c0fef9 /test | |
| parent | f5c5de68590f559ceee1f26bca0eb2f4b26a21cd (diff) | |
| download | Project-Tick-f7e1e0130fb198fa2d4d62b8990d2ab205985b3f.tar.gz Project-Tick-f7e1e0130fb198fa2d4d62b8990d2ab205985b3f.zip | |
Remove workarounds for non-ANSI-C compatible compilers (Part 1)
Diffstat (limited to 'test')
| -rw-r--r-- | test/example.c | 12 | ||||
| -rw-r--r-- | test/minigzip.c | 23 |
2 files changed, 5 insertions, 30 deletions
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 <stdio.h> -#ifdef STDC -# include <string.h> -# include <stdlib.h> -#endif +#include <string.h> +#include <stdlib.h> -#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 <stdio.h> -#ifdef STDC -# include <string.h> -# include <stdlib.h> -#endif +#include <string.h> +#include <stdlib.h> #ifdef USE_MMAP # include <sys/types.h> @@ -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], '/'); |
