X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flibchdr%2Fdeps%2Fzstd-1.5.5%2FzlibWrapper%2Fexamples%2Fexample_original.c;fp=deps%2Flibchdr%2Fdeps%2Fzlib-1.2.13%2Ftest%2Fexample.c;h=5b4e4d1d8f682b5b3a5d67be64844029562606fc;hb=648db22b0750712da893c306efcc8e4b2d3a4e3c;hp=1470bc842ee8a179722c4edcadb111bd0c9b9a6f;hpb=e2fb1389dc12376acb84e4993ed3b08760257252;p=pcsx_rearmed.git diff --git a/deps/libchdr/deps/zlib-1.2.13/test/example.c b/deps/libchdr/deps/zstd-1.5.5/zlibWrapper/examples/example_original.c similarity index 88% rename from deps/libchdr/deps/zlib-1.2.13/test/example.c rename to deps/libchdr/deps/zstd-1.5.5/zlibWrapper/examples/example_original.c index 1470bc84..5b4e4d1d 100644 --- a/deps/libchdr/deps/zlib-1.2.13/test/example.c +++ b/deps/libchdr/deps/zstd-1.5.5/zlibWrapper/examples/example_original.c @@ -1,7 +1,24 @@ /* example.c -- usage example of the zlib compression library - * Copyright (C) 1995-2006, 2011, 2016 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h */ +/* + Copyright (c) 1995-2006, 2011 Jean-loup Gailly + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgement in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ /* @(#) $Id$ */ @@ -26,46 +43,46 @@ } \ } -static z_const char hello[] = "hello, hello!"; +z_const char hello[] = "hello, hello!"; /* "hello world" would be more standard, but the repeated "hello" * stresses the compression code better, sorry... */ -static const char dictionary[] = "hello"; -static uLong dictId; /* Adler32 value of the dictionary */ +const char dictionary[] = "hello"; +uLong dictId; /* Adler32 value of the dictionary */ -void test_deflate OF((Byte *compr, uLong comprLen)); -void test_inflate OF((Byte *compr, uLong comprLen, +void test_deflate _Z_OF((Byte *compr, uLong comprLen)); +void test_inflate _Z_OF((Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); -void test_large_deflate OF((Byte *compr, uLong comprLen, +void test_large_deflate _Z_OF((Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); -void test_large_inflate OF((Byte *compr, uLong comprLen, +void test_large_inflate _Z_OF((Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); -void test_flush OF((Byte *compr, uLong *comprLen)); -void test_sync OF((Byte *compr, uLong comprLen, +void test_flush _Z_OF((Byte *compr, uLong *comprLen)); +void test_sync _Z_OF((Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); -void test_dict_deflate OF((Byte *compr, uLong comprLen)); -void test_dict_inflate OF((Byte *compr, uLong comprLen, +void test_dict_deflate _Z_OF((Byte *compr, uLong comprLen)); +void test_dict_inflate _Z_OF((Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); -int main OF((int argc, char *argv[])); +int main _Z_OF((int argc, char *argv[])); #ifdef Z_SOLO -void *myalloc OF((void *, unsigned, unsigned)); -void myfree OF((void *, void *)); +void *myalloc _Z_OF((void *, unsigned, unsigned)); +void myfree _Z_OF((void *, void *)); void *myalloc(q, n, m) void *q; unsigned n, m; { - (void)q; + q = Z_NULL; return calloc(n, m); } void myfree(void *q, void *p) { - (void)q; + q = Z_NULL; free(p); } @@ -77,9 +94,9 @@ static free_func zfree = myfree; static alloc_func zalloc = (alloc_func)0; static free_func zfree = (free_func)0; -void test_compress OF((Byte *compr, uLong comprLen, +void test_compress _Z_OF((Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen)); -void test_gzio OF((const char *fname, +void test_gzio _Z_OF((const char *fname, Byte *uncompr, uLong uncomprLen)); /* =========================================================================== @@ -432,7 +449,7 @@ void test_sync(compr, comprLen, uncompr, uncomprLen) d_stream.next_out = uncompr; d_stream.avail_out = (uInt)uncomprLen; - err = inflate(&d_stream, Z_NO_FLUSH); + inflate(&d_stream, Z_NO_FLUSH); CHECK_ERR(err, "inflate"); d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */ @@ -440,8 +457,9 @@ void test_sync(compr, comprLen, uncompr, uncomprLen) CHECK_ERR(err, "inflateSync"); err = inflate(&d_stream, Z_FINISH); - if (err != Z_STREAM_END) { - fprintf(stderr, "inflate should report Z_STREAM_END\n"); + if (err != Z_DATA_ERROR) { + fprintf(stderr, "inflate should report DATA_ERROR\n"); + /* Because of incorrect adler32 */ exit(1); } err = inflateEnd(&d_stream); @@ -555,8 +573,7 @@ int main(argc, argv) exit(1); } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) { - fprintf(stderr, "warning: different zlib version linked: %s\n", - zlibVersion()); + fprintf(stderr, "warning: different zlib version\n"); } printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n", @@ -573,8 +590,7 @@ int main(argc, argv) } #ifdef Z_SOLO - (void)argc; - (void)argv; + argc = strlen(argv[0]); #else test_compress(compr, comprLen, uncompr, uncomprLen);