summaryrefslogtreecommitdiff
path: root/deps/zlib/test
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2017-01-20 11:01:40 -0800
committerSam Roberts <vieuxtech@gmail.com>2017-02-20 08:45:48 -0800
commitdfa8abe1b500b86ffb3951736c209e57d83ed3ed (patch)
tree462f78ca30dee5776c09642559dedc7ee5f1d3b2 /deps/zlib/test
parent4e6efc1dec0eb924b68d74648b661433119306fe (diff)
downloadandroid-node-v8-dfa8abe1b500b86ffb3951736c209e57d83ed3ed.tar.gz
android-node-v8-dfa8abe1b500b86ffb3951736c209e57d83ed3ed.tar.bz2
android-node-v8-dfa8abe1b500b86ffb3951736c209e57d83ed3ed.zip
deps: upgrade zlib to 1.2.11
PR-URL: https://github.com/nodejs/node/pull/10980 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Diffstat (limited to 'deps/zlib/test')
-rw-r--r--deps/zlib/test/example.c17
-rw-r--r--deps/zlib/test/infcover.c18
-rw-r--r--deps/zlib/test/minigzip.c12
3 files changed, 24 insertions, 23 deletions
diff --git a/deps/zlib/test/example.c b/deps/zlib/test/example.c
index 138a699bd5..eee17ce7c1 100644
--- a/deps/zlib/test/example.c
+++ b/deps/zlib/test/example.c
@@ -1,5 +1,5 @@
/* example.c -- usage example of the zlib compression library
- * Copyright (C) 1995-2006, 2011 Jean-loup Gailly.
+ * Copyright (C) 1995-2006, 2011, 2016 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -26,13 +26,13 @@
} \
}
-z_const char hello[] = "hello, hello!";
+static z_const char hello[] = "hello, hello!";
/* "hello world" would be more standard, but the repeated "hello"
* stresses the compression code better, sorry...
*/
-const char dictionary[] = "hello";
-uLong dictId; /* Adler32 value of the dictionary */
+static const char dictionary[] = "hello";
+static uLong dictId; /* Adler32 value of the dictionary */
void test_deflate OF((Byte *compr, uLong comprLen));
void test_inflate OF((Byte *compr, uLong comprLen,
@@ -59,13 +59,13 @@ void *myalloc(q, n, m)
void *q;
unsigned n, m;
{
- q = Z_NULL;
+ (void)q;
return calloc(n, m);
}
void myfree(void *q, void *p)
{
- q = Z_NULL;
+ (void)q;
free(p);
}
@@ -432,7 +432,7 @@ void test_sync(compr, comprLen, uncompr, uncomprLen)
d_stream.next_out = uncompr;
d_stream.avail_out = (uInt)uncomprLen;
- inflate(&d_stream, Z_NO_FLUSH);
+ err = inflate(&d_stream, Z_NO_FLUSH);
CHECK_ERR(err, "inflate");
d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */
@@ -573,7 +573,8 @@ int main(argc, argv)
}
#ifdef Z_SOLO
- argc = strlen(argv[0]);
+ (void)argc;
+ (void)argv;
#else
test_compress(compr, comprLen, uncompr, uncomprLen);
diff --git a/deps/zlib/test/infcover.c b/deps/zlib/test/infcover.c
index fe3d9203a0..2be01646ce 100644
--- a/deps/zlib/test/infcover.c
+++ b/deps/zlib/test/infcover.c
@@ -1,5 +1,5 @@
/* infcover.c -- test zlib's inflate routines with full code coverage
- * Copyright (C) 2011 Mark Adler
+ * Copyright (C) 2011, 2016 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -237,14 +237,14 @@ local void mem_done(z_stream *strm, char *prefix)
/* Decode a hexadecimal string, set *len to length, in[] to the bytes. This
decodes liberally, in that hex digits can be adjacent, in which case two in
- a row writes a byte. Or they can delimited by any non-hex character, where
- the delimiters are ignored except when a single hex digit is followed by a
- delimiter in which case that single digit writes a byte. The returned
- data is allocated and must eventually be freed. NULL is returned if out of
- memory. If the length is not needed, then len can be NULL. */
+ a row writes a byte. Or they can be delimited by any non-hex character,
+ where the delimiters are ignored except when a single hex digit is followed
+ by a delimiter, where that single digit writes a byte. The returned data is
+ allocated and must eventually be freed. NULL is returned if out of memory.
+ If the length is not needed, then len can be NULL. */
local unsigned char *h2b(const char *hex, unsigned *len)
{
- unsigned char *in;
+ unsigned char *in, *re;
unsigned next, val;
in = malloc((strlen(hex) + 1) >> 1);
@@ -268,8 +268,8 @@ local unsigned char *h2b(const char *hex, unsigned *len)
} while (*hex++); /* go through the loop with the terminating null */
if (len != NULL)
*len = next;
- in = reallocf(in, next);
- return in;
+ re = realloc(in, next);
+ return re == NULL ? in : re;
}
/* generic inflate() run, where hex is the hexadecimal input data, what is the
diff --git a/deps/zlib/test/minigzip.c b/deps/zlib/test/minigzip.c
index b3025a489a..e22fb08c0a 100644
--- a/deps/zlib/test/minigzip.c
+++ b/deps/zlib/test/minigzip.c
@@ -1,5 +1,5 @@
/* minigzip.c -- simulate gzip using the zlib compression library
- * Copyright (C) 1995-2006, 2010, 2011 Jean-loup Gailly.
+ * Copyright (C) 1995-2006, 2010, 2011, 2016 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -40,7 +40,7 @@
# define SET_BINARY_MODE(file)
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
#endif
@@ -156,14 +156,14 @@ void *myalloc(q, n, m)
void *q;
unsigned n, m;
{
- q = Z_NULL;
+ (void)q;
return calloc(n, m);
}
void myfree(q, p)
void *q, *p;
{
- q = Z_NULL;
+ (void)q;
free(p);
}
@@ -333,7 +333,7 @@ const char *gzerror(gz, err)
#endif
-char *prog;
+static char *prog;
void error OF((const char *msg));
void gz_compress OF((FILE *in, gzFile out));
@@ -500,7 +500,7 @@ void file_uncompress(file)
char *infile, *outfile;
FILE *out;
gzFile in;
- size_t len = strlen(file);
+ unsigned len = strlen(file);
if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
fprintf(stderr, "%s: filename too long\n", prog);