From 709c4672d4a387f56839e47ed6a985cd2f950a8f Mon Sep 17 00:00:00 2001 From: Brotli Date: Fri, 12 Apr 2024 09:15:22 -0700 Subject: [PATCH] Fix minor syntax issues. Missing semicolons. Move checks below variable declarations for c89. PiperOrigin-RevId: 624199887 --- c/enc/hash.h | 2 +- c/enc/hash_forgetful_chain_inc.h | 2 +- c/enc/hash_longest_match64_inc.h | 2 +- c/enc/hash_longest_match_inc.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/c/enc/hash.h b/c/enc/hash.h index f3a915b67..d993b6a78 100644 --- a/c/enc/hash.h +++ b/c/enc/hash.h @@ -557,7 +557,7 @@ static BROTLI_INLINE void FindCompoundDictionaryMatch( offset = distance_offset - distance; limit = source_size - offset; limit = limit > max_length ? max_length : limit; - BROTLI_DCHECK(cur_ix_masked + limit <= ring_buffer_mask) + BROTLI_DCHECK(cur_ix_masked + limit <= ring_buffer_mask); len = FindMatchLengthWithLimit(&source[offset], &data[cur_ix_masked], limit); if (len >= 2) { diff --git a/c/enc/hash_forgetful_chain_inc.h b/c/enc/hash_forgetful_chain_inc.h index 17f31fae3..0e28b7eb0 100644 --- a/c/enc/hash_forgetful_chain_inc.h +++ b/c/enc/hash_forgetful_chain_inc.h @@ -203,12 +203,12 @@ static BROTLI_INLINE void FN(FindLongestMatch)( uint8_t* BROTLI_RESTRICT tiny_hashes = FN(TinyHash)(self->extra[0]); FN(Bank)* BROTLI_RESTRICT banks = FN(Banks)(self->extra[1]); const size_t cur_ix_masked = cur_ix & ring_buffer_mask; - BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask) /* Don't accept a short copy from far away. */ score_t min_score = out->score; score_t best_score = out->score; size_t best_len = out->len; size_t i; + BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask); const size_t key = FN(HashBytes)(&data[cur_ix_masked]); const uint8_t tiny_hash = (uint8_t)(key); out->len = 0; diff --git a/c/enc/hash_longest_match64_inc.h b/c/enc/hash_longest_match64_inc.h index 9834c2a6c..62d51f629 100644 --- a/c/enc/hash_longest_match64_inc.h +++ b/c/enc/hash_longest_match64_inc.h @@ -165,12 +165,12 @@ static BROTLI_INLINE void FN(FindLongestMatch)( uint16_t* BROTLI_RESTRICT num = self->num_; uint32_t* BROTLI_RESTRICT buckets = self->buckets_; const size_t cur_ix_masked = cur_ix & ring_buffer_mask; - BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask) /* Don't accept a short copy from far away. */ score_t min_score = out->score; score_t best_score = out->score; size_t best_len = out->len; size_t i; + BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask); out->len = 0; out->len_code_delta = 0; /* Try last distance first. */ diff --git a/c/enc/hash_longest_match_inc.h b/c/enc/hash_longest_match_inc.h index 42b95325a..6de9ba5a0 100644 --- a/c/enc/hash_longest_match_inc.h +++ b/c/enc/hash_longest_match_inc.h @@ -164,12 +164,12 @@ static BROTLI_INLINE void FN(FindLongestMatch)( uint16_t* BROTLI_RESTRICT num = self->num_; uint32_t* BROTLI_RESTRICT buckets = self->buckets_; const size_t cur_ix_masked = cur_ix & ring_buffer_mask; - BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask) /* Don't accept a short copy from far away. */ score_t min_score = out->score; score_t best_score = out->score; size_t best_len = out->len; size_t i; + BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask); out->len = 0; out->len_code_delta = 0; /* Try last distance first. */