[new uImage] Move gunzip() common code to common/gunzip.c

Move gunzip(), zalloc() and zfree() to a separate file.
Share zalloc() and zfree() with cramfs uncompress routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
This commit is contained in:
Marian Balakowicz 2008-01-08 18:11:43 +01:00 committed by Wolfgang Denk
parent d45d5a18b6
commit 321359f208
5 changed files with 123 additions and 109 deletions

View file

@ -29,24 +29,8 @@
static z_stream stream;
#define ZALLOC_ALIGNMENT 16
static void *zalloc (void *x, unsigned items, unsigned size)
{
void *p;
size *= items;
size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
p = malloc (size);
return (p);
}
static void zfree (void *x, void *addr, unsigned nb)
{
free (addr);
}
void *zalloc(void *, unsigned, unsigned);
void zfree(void *, void *, unsigned);
/* Returns length of decompressed data. */
int cramfs_uncompress_block (void *dst, void *src, int srclen)