diff options
author | Adenilson Cavalcanti <cavalcantii@chromium.org> | 2022-04-28 01:23:37 +0000 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-04-27 18:37:51 -0700 |
commit | 0078980ac63e9b1642017b3ec556e341ff70e002 (patch) | |
tree | 6723880fd5843641a37d3eb83afd77e9b3c59ac0 /trees.c | |
parent | bff956e3b03c4314ca8974699d228a12a9432c41 (diff) | |
download | zlib-0078980ac63e9b1642017b3ec556e341ff70e002.tar.gz |
[zlib] Re-sync with zlib 1.2.12, patch 14 of N
Ported:
- Avoid adding empty gzip member after gzflush with Z_FINISH.
- Fix error in comment on the polynomial representation of a byte.
- Clarify gz* function interfaces, referring to parameter names.
- Change macro name in inflate.c to avoid collision in VxWorks.
- Replace black/white with allow/block. (theresa-m)
- Add fallthrough comments for gcc.
Bug: 1032721
Change-Id: Iddabef8450dca9dced3df58473a0ecb197796dc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3611483
Reviewed-by: Noel Gordon <noel@chromium.org>
Reviewed-by: Chris Blume <cblume@chromium.org>
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996983}
NOKEYCHECK=True
GitOrigin-RevId: c47a52f8f7950377f45f850cf66092a4a6033fa6
Diffstat (limited to 'trees.c')
-rw-r--r-- | trees.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1091,9 +1091,9 @@ local void compress_block(s, ltree, dtree) * Check if the data type is TEXT or BINARY, using the following algorithm: * - TEXT if the two conditions below are satisfied: * a) There are no non-portable control characters belonging to the - * "black list" (0..6, 14..25, 28..31). + * "block list" (0..6, 14..25, 28..31). * b) There is at least one printable character belonging to the - * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). * - BINARY otherwise. * - The following partially-portable control characters form a * "gray list" that is ignored in this detection algorithm: @@ -1103,19 +1103,19 @@ local void compress_block(s, ltree, dtree) local int detect_data_type(s) deflate_state *s; { - /* black_mask is the bit mask of black-listed bytes + /* block_mask is the bit mask of block-listed bytes * set bits 0..6, 14..25, and 28..31 * 0xf3ffc07f = binary 11110011111111111100000001111111 */ - unsigned long black_mask = 0xf3ffc07fUL; + unsigned long block_mask = 0xf3ffc07fUL; int n; - /* Check for non-textual ("black-listed") bytes. */ - for (n = 0; n <= 31; n++, black_mask >>= 1) - if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) + /* Check for non-textual ("block-listed") bytes. */ + for (n = 0; n <= 31; n++, block_mask >>= 1) + if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0)) return Z_BINARY; - /* Check for textual ("white-listed") bytes. */ + /* Check for textual ("allow-listed") bytes. */ if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 || s->dyn_ltree[13].Freq != 0) return Z_TEXT; @@ -1123,7 +1123,7 @@ local int detect_data_type(s) if (s->dyn_ltree[n].Freq != 0) return Z_TEXT; - /* There are no "black-listed" or "white-listed" bytes: + /* There are no "block-listed" or "allow-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ return Z_BINARY; |