diff options
Diffstat (limited to 'src/Common/zlib/deflate.h')
-rw-r--r-- | src/Common/zlib/deflate.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/Common/zlib/deflate.h b/src/Common/zlib/deflate.h index 23ecdd31..17c22611 100644 --- a/src/Common/zlib/deflate.h +++ b/src/Common/zlib/deflate.h @@ -1,3 +1,3 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2016 Jean-loup Gailly + * Copyright (C) 1995-2018 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h @@ -219,3 +219,3 @@ typedef struct internal_state { - uchf *l_buf; /* buffer for literals or lengths */ + uchf *sym_buf; /* buffer for distances and literals/lengths */ @@ -241,9 +241,4 @@ typedef struct internal_state { - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ + uInt sym_next; /* running index in sym_buf */ + uInt sym_end; /* symbol table full when sym_next reaches this */ @@ -327,6 +322,7 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ + s->sym_buf[s->sym_next++] = 0; \ + s->sym_buf[s->sym_next++] = 0; \ + s->sym_buf[s->sym_next++] = cc; \ s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ + flush = (s->sym_next == s->sym_end); \ } @@ -335,4 +331,5 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, ush dist = (ush)(distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ + s->sym_buf[s->sym_next++] = dist; \ + s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = len; \ dist--; \ @@ -340,3 +337,3 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ + flush = (s->sym_next == s->sym_end); \ } |