Skip to content
Permalink
Browse files

Make the dictionary size configurable; minor fixes

  • Loading branch information...
sergeuz authored and avtolstoy committed Sep 3, 2018
1 parent be54fea commit af839bf788cec53c0d72f22e46cf58701498e264
Showing with 15 additions and 0 deletions.
  1. +4 −0 miniz.h
  2. +3 −0 miniz_common.h
  3. +4 −0 miniz_tdef.h
  4. +4 −0 miniz_tinfl.h
@@ -163,12 +163,14 @@
#define MINIZ_X86_OR_X64_CPU 0
#endif

#ifndef MINIZ_LITTLE_ENDIAN
#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */
#define MINIZ_LITTLE_ENDIAN 1
#else
#define MINIZ_LITTLE_ENDIAN 0
#endif
#endif

/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */
#if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES)
@@ -181,12 +183,14 @@
#endif
#endif

#ifndef MINIZ_HAS_64BIT_REGISTERS
#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__)
/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). */
#define MINIZ_HAS_64BIT_REGISTERS 1
#else
#define MINIZ_HAS_64BIT_REGISTERS 0
#endif
#endif

#ifdef __cplusplus
extern "C" {
@@ -1,4 +1,7 @@
#pragma once

#include "miniz_config.h"

#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
@@ -79,7 +79,11 @@ enum
TDEFL_MAX_HUFF_SYMBOLS_0 = 288,
TDEFL_MAX_HUFF_SYMBOLS_1 = 32,
TDEFL_MAX_HUFF_SYMBOLS_2 = 19,
#ifdef MINIZ_LZ_DICT_SIZE
TDEFL_LZ_DICT_SIZE = MINIZ_LZ_DICT_SIZE,
#else
TDEFL_LZ_DICT_SIZE = 32768,
#endif
TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1,
TDEFL_MIN_MATCH_LEN = 3,
TDEFL_MAX_MATCH_LEN = 258
@@ -50,7 +50,11 @@ void tinfl_decompressor_free(tinfl_decompressor *pDecomp);
#endif

/* Max size of LZ dictionary. */
#ifdef MINIZ_LZ_DICT_SIZE
#define TINFL_LZ_DICT_SIZE MINIZ_LZ_DICT_SIZE
#else
#define TINFL_LZ_DICT_SIZE 32768
#endif

/* Return status. */
typedef enum {

0 comments on commit af839bf

Please sign in to comment.
You can’t perform that action at this time.