summaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2019-07-18 16:17:49 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2019-08-06 09:39:26 +0200
commit4bc6ffa41a7a23e04a2da409ca512a73cf268382 (patch)
tree4bcc8edfb3630888d25ece2ab72683f391d8d490 /inflate.c
parentd8eedcfa3e391cca6d247ebde2f5c64bd64582d6 (diff)
Deduplicate inflate's fixedtables(), and no longer inline the inffixed tables.
This also reduces the library size by 4120bytes or ~2.9%.
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/inflate.c b/inflate.c
index c07d149..8caacdd 100644
--- a/inflate.c
+++ b/inflate.c
@@ -122,12 +122,13 @@
/* function prototypes */
static int inflateStateCheck(PREFIX3(stream) *strm);
-static void fixedtables(struct inflate_state *state);
static int updatewindow(PREFIX3(stream) *strm, const unsigned char *end, uint32_t copy);
+static uint32_t syncsearch(uint32_t *have, const unsigned char *buf, uint32_t len);
#ifdef BUILDFIXED
void makefixed(void);
+#else
+# include "inffixed.h"
#endif
-static uint32_t syncsearch(uint32_t *have, const unsigned char *buf, uint32_t len);
static int inflateStateCheck(PREFIX3(stream) *strm) {
struct inflate_state *state;
@@ -283,7 +284,8 @@ int ZEXPORT PREFIX(inflatePrime)(PREFIX3(stream) *strm, int bits, int value) {
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
-static void fixedtables(struct inflate_state *state) {
+
+void ZLIB_INTERNAL fixedtables(struct inflate_state *state) {
#ifdef BUILDFIXED
static int virgin = 1;
static code *lenfix, *distfix;
@@ -315,8 +317,6 @@ static void fixedtables(struct inflate_state *state) {
/* do this just once */
virgin = 0;
}
-#else /* !BUILDFIXED */
-# include "inffixed.h"
#endif /* BUILDFIXED */
state->lencode = lenfix;
state->lenbits = 9;