Skip to content

Commit

Permalink
[PATCH] lib/zlib*: cleanups
Browse files Browse the repository at this point in the history
This patch contains the following possible cleanups:
- #if 0 the following unused functions:
  - zlib_deflate/deflate.c: zlib_deflateSetDictionary
  - zlib_deflate/deflate.c: zlib_deflateParams
  - zlib_deflate/deflate.c: zlib_deflateCopy
  - zlib_inflate/infblock.c: zlib_inflate_set_dictionary
  - zlib_inflate/infblock.c: zlib_inflate_blocks_sync_point
  - zlib_inflate/inflate_sync.c: zlib_inflateSync
  - zlib_inflate/inflate_sync.c: zlib_inflateSyncPoint
- remove the following unneeded EXPORT_SYMBOL's:
  - zlib_deflate/deflate_syms.c: zlib_deflateCopy
  - zlib_deflate/deflate_syms.c: zlib_deflateParams
  - zlib_inflate/inflate_syms.c: zlib_inflateSync
  - zlib_inflate/inflate_syms.c: zlib_inflateSyncPoint

Signed-off-by: Adrian Bunk <[email protected]>
Cc: Matt Mackall <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AdrianBunk authored and Linus Torvalds committed Jan 10, 2006
1 parent 3af1376 commit 87c2ce3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 4 deletions.
11 changes: 11 additions & 0 deletions include/linux/zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,11 @@ extern int deflateInit2 (z_streamp strm,
not perform any compression: this will be done by deflate().
*/

#if 0
extern int zlib_deflateSetDictionary (z_streamp strm,
const Byte *dictionary,
uInt dictLength);
#endif
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
Expand Down Expand Up @@ -478,7 +480,10 @@ extern int zlib_deflateSetDictionary (z_streamp strm,
perform any compression: this will be done by deflate().
*/

#if 0
extern int zlib_deflateCopy (z_streamp dest, z_streamp source);
#endif

/*
Sets the destination stream as a complete copy of the source stream.
Expand Down Expand Up @@ -511,7 +516,9 @@ static inline unsigned long deflateBound(unsigned long s)
return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
}

#if 0
extern int zlib_deflateParams (z_streamp strm, int level, int strategy);
#endif
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
Expand Down Expand Up @@ -571,7 +578,9 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
inflate().
*/

#if 0
extern int zlib_inflateSync (z_streamp strm);
#endif
/*
Skips invalid compressed data until a full flush point (see above the
description of deflate with Z_FULL_FLUSH) can be found, or until all
Expand Down Expand Up @@ -636,7 +645,9 @@ extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
#endif

extern const char * zlib_zError (int err);
#if 0
extern int zlib_inflateSyncPoint (z_streamp z);
#endif
extern const uLong * zlib_get_crc_table (void);

#endif /* _ZLIB_H */
6 changes: 6 additions & 0 deletions lib/zlib_deflate/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ int zlib_deflateInit2_(
}

/* ========================================================================= */
#if 0
int zlib_deflateSetDictionary(
z_streamp strm,
const Byte *dictionary,
Expand Down Expand Up @@ -297,6 +298,7 @@ int zlib_deflateSetDictionary(
if (hash_head) hash_head = 0; /* to make compiler happy */
return Z_OK;
}
#endif /* 0 */

/* ========================================================================= */
int zlib_deflateReset(
Expand Down Expand Up @@ -330,6 +332,7 @@ int zlib_deflateReset(
}

/* ========================================================================= */
#if 0
int zlib_deflateParams(
z_streamp strm,
int level,
Expand Down Expand Up @@ -365,6 +368,7 @@ int zlib_deflateParams(
s->strategy = strategy;
return err;
}
#endif /* 0 */

/* =========================================================================
* Put a short in the pending buffer. The 16-bit value is put in MSB order.
Expand Down Expand Up @@ -572,6 +576,7 @@ int zlib_deflateEnd(
/* =========================================================================
* Copy the source state to the destination state.
*/
#if 0
int zlib_deflateCopy (
z_streamp dest,
z_streamp source
Expand Down Expand Up @@ -624,6 +629,7 @@ int zlib_deflateCopy (
return Z_OK;
#endif
}
#endif /* 0 */

/* ===========================================================================
* Read a new buffer from the current input stream, update the adler32
Expand Down
2 changes: 0 additions & 2 deletions lib/zlib_deflate/deflate_syms.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ EXPORT_SYMBOL(zlib_deflateInit_);
EXPORT_SYMBOL(zlib_deflateInit2_);
EXPORT_SYMBOL(zlib_deflateEnd);
EXPORT_SYMBOL(zlib_deflateReset);
EXPORT_SYMBOL(zlib_deflateCopy);
EXPORT_SYMBOL(zlib_deflateParams);
MODULE_LICENSE("GPL");
4 changes: 4 additions & 0 deletions lib/zlib_inflate/infblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ int zlib_inflate_blocks_free(
}


#if 0
void zlib_inflate_set_dictionary(
inflate_blocks_statef *s,
const Byte *d,
Expand All @@ -347,15 +348,18 @@ void zlib_inflate_set_dictionary(
memcpy(s->window, d, n);
s->read = s->write = s->window + n;
}
#endif /* 0 */


/* Returns true if inflate is currently at the end of a block generated
* by Z_SYNC_FLUSH or Z_FULL_FLUSH.
* IN assertion: s != NULL
*/
#if 0
int zlib_inflate_blocks_sync_point(
inflate_blocks_statef *s
)
{
return s->mode == LENS;
}
#endif /* 0 */
4 changes: 4 additions & 0 deletions lib/zlib_inflate/infblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ extern int zlib_inflate_blocks_free (
inflate_blocks_statef *,
z_streamp);

#if 0
extern void zlib_inflate_set_dictionary (
inflate_blocks_statef *s,
const Byte *d, /* dictionary */
uInt n); /* dictionary length */
#endif /* 0 */

#if 0
extern int zlib_inflate_blocks_sync_point (
inflate_blocks_statef *s);
#endif /* 0 */

#endif /* _INFBLOCK_H */
2 changes: 0 additions & 2 deletions lib/zlib_inflate/inflate_syms.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ EXPORT_SYMBOL(zlib_inflate);
EXPORT_SYMBOL(zlib_inflateInit_);
EXPORT_SYMBOL(zlib_inflateInit2_);
EXPORT_SYMBOL(zlib_inflateEnd);
EXPORT_SYMBOL(zlib_inflateSync);
EXPORT_SYMBOL(zlib_inflateReset);
EXPORT_SYMBOL(zlib_inflateSyncPoint);
EXPORT_SYMBOL(zlib_inflateIncomp);
MODULE_LICENSE("GPL");
4 changes: 4 additions & 0 deletions lib/zlib_inflate/inflate_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "infblock.h"
#include "infutil.h"

#if 0
int zlib_inflateSync(
z_streamp z
)
Expand Down Expand Up @@ -57,6 +58,7 @@ int zlib_inflateSync(
z->state->mode = BLOCKS;
return Z_OK;
}
#endif /* 0 */


/* Returns true if inflate is currently at the end of a block generated
Expand All @@ -66,6 +68,7 @@ int zlib_inflateSync(
* decompressing, PPP checks that at the end of input packet, inflate is
* waiting for these length bytes.
*/
#if 0
int zlib_inflateSyncPoint(
z_streamp z
)
Expand All @@ -74,6 +77,7 @@ int zlib_inflateSyncPoint(
return Z_STREAM_ERROR;
return zlib_inflate_blocks_sync_point(z->state->blocks);
}
#endif /* 0 */

/*
* This subroutine adds the data at next_in/avail_in to the output history
Expand Down

0 comments on commit 87c2ce3

Please sign in to comment.