2010-03-22 Joel Sherrill <joel.sherrill@oarcorp.com>

* ChangeLog.zlib, FAQ, Makefile.am, README, adler32.c, compress.c,
	crc32.c, deflate.c, deflate.h, infback.c, inffast.c, inflate.c,
	inflate.h, inftrees.c, inftrees.h, trees.c, uncompr.c, zconf.h,
	zlib.3, zlib.h, zutil.c, zutil.h: Update to zlib 1.2.4.
	* gzclose.c, gzguts.h, gzlib.c, gzread.c, gzwrite.c, doc/algorithm.txt:
	New files.
	* algorithm.txt, gzio.c: Removed.
This commit is contained in:
Joel Sherrill
2011-03-18 10:11:29 +00:00
parent 41ca776ff7
commit 6121dc7736
28 changed files with 4033 additions and 2244 deletions

View File

@@ -24,35 +24,35 @@ const char * const z_errmsg[10] = {
""};
const char * ZEXPORT zlibVersion(void)
const char * ZEXPORT zlibVersion()
{
return ZLIB_VERSION;
}
uLong ZEXPORT zlibCompileFlags(void)
uLong ZEXPORT zlibCompileFlags()
{
uLong flags;
flags = 0;
switch (sizeof(uInt)) {
switch ((int)(sizeof(uInt))) {
case 2: break;
case 4: flags += 1; break;
case 8: flags += 2; break;
default: flags += 3;
}
switch (sizeof(uLong)) {
switch ((int)(sizeof(uLong))) {
case 2: break;
case 4: flags += 1 << 2; break;
case 8: flags += 2 << 2; break;
default: flags += 3 << 2;
}
switch (sizeof(voidpf)) {
switch ((int)(sizeof(voidpf))) {
case 2: break;
case 4: flags += 1 << 4; break;
case 8: flags += 2 << 4; break;
default: flags += 3 << 4;
}
switch (sizeof(z_off_t)) {
switch ((int)(sizeof(z_off_t))) {
case 2: break;
case 4: flags += 1 << 6; break;
case 8: flags += 2 << 6; break;
@@ -130,8 +130,8 @@ void z_error (m)
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
const char * ZEXPORT zError(
int err)
const char * ZEXPORT zError(err)
int err;
{
return ERR_MSG(err);
}
@@ -146,10 +146,10 @@ const char * ZEXPORT zError(
#ifndef HAVE_MEMCPY
void zmemcpy(
Bytef* dest,
const Bytef* source,
uInt len)
void zmemcpy(dest, source, len)
Bytef* dest;
const Bytef* source;
uInt len;
{
if (len == 0) return;
do {
@@ -157,10 +157,10 @@ void zmemcpy(
} while (--len != 0);
}
int zmemcmp(
const Bytef* s1,
const Bytef* s2,
uInt len)
int zmemcmp(s1, s2, len)
const Bytef* s1;
const Bytef* s2;
uInt len;
{
uInt j;
@@ -170,9 +170,9 @@ int zmemcmp(
return 0;
}
void zmemzero(
Bytef* dest,
uInt len)
void zmemzero(dest, len)
Bytef* dest;
uInt len;
{
if (len == 0) return;
do {
@@ -213,7 +213,7 @@ local ptr_table table[MAX_PTR];
* a protected system like OS/2. Use Microsoft C instead.
*/
voidpf zcalloc (voidpf opaque, uInt items, uInt size)
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{
voidpf buf = opaque; /* just to make some compilers happy */
ulg bsize = (ulg)items*size;
@@ -272,7 +272,7 @@ void zcfree (voidpf opaque, voidpf ptr)
# define _hfree hfree
#endif
voidpf zcalloc (voidpf opaque, uInt items, uInt size)
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
{
if (opaque) opaque = 0; /* to make compiler happy */
return _halloc((long)items, size);
@@ -297,16 +297,19 @@ extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
voidpf zcalloc (voidpf opaque, uInt items, uInt size)
voidpf zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
{
if (opaque) items += size - size; /* make compiler happy */
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
(voidpf)calloc(items, size);
}
void zcfree (
voidpf opaque,
voidpf ptr)
void zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{
free(ptr);
if (opaque) return; /* make compiler happy */