Skip to content

Commit

Permalink
lzo: add some missing casts
Browse files Browse the repository at this point in the history
Add some casts to the LZO compression algorithm after they were removed
during cleanup and shouldn't have been.

Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
Cc: Edward Shishkin <edward@namesys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
rpurdie authored and Linus Torvalds committed Jul 31, 2007
1 parent 3968cb4 commit c21b37f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/lzo/lzo1x_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
ip += 4;

for (;;) {
dindex = ((0x21 * DX3(ip, 5, 5, 6)) >> 5) & D_MASK;
dindex = ((size_t)(0x21 * DX3(ip, 5, 5, 6)) >> 5) & D_MASK;
m_pos = dict[dindex];

if (m_pos < in)
goto literal;

if (ip == m_pos || (ip - m_pos) > M4_MAX_OFFSET)
if (ip == m_pos || ((size_t)(ip - m_pos) > M4_MAX_OFFSET))
goto literal;

m_off = ip - m_pos;
Expand All @@ -51,7 +51,7 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
if (m_pos < in)
goto literal;

if (ip == m_pos || (ip - m_pos) > M4_MAX_OFFSET)
if (ip == m_pos || ((size_t)(ip - m_pos) > M4_MAX_OFFSET))
goto literal;

m_off = ip - m_pos;
Expand Down

0 comments on commit c21b37f

Please sign in to comment.