Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid const warnings in zopfli's lz77.c.
  • Loading branch information
madler committed Mar 29, 2019
1 parent 1de0bd0 commit da451f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zopfli/src/zopfli/lz77.c
Expand Up @@ -301,14 +301,15 @@ static const unsigned char* GetMatch(const unsigned char* scan,

if (sizeof(size_t) == 8) {
/* 8 checks at once per array bounds check (size_t is 64-bit). */
while (scan < safe_end && *((size_t*)scan) == *((size_t*)match)) {
while (scan < safe_end && *((size_t const*)scan) ==
*((size_t const*)match)) {
scan += 8;
match += 8;
}
} else if (sizeof(unsigned int) == 4) {
/* 4 checks at once per array bounds check (unsigned int is 32-bit). */
while (scan < safe_end
&& *((unsigned int*)scan) == *((unsigned int*)match)) {
&& *((unsigned int const*)scan) == *((unsigned int const*)match)) {
scan += 4;
match += 4;
}
Expand Down

0 comments on commit da451f7

Please sign in to comment.